Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Using a roll query with two instances in a macro with two different values

I'm currently trying to have the answer for this roll query be used in two separate instances in this macro with two different values. &{template:atkdmg} {{mod= 11 }} {{rname= Longbow +1 }} {{r1= [[ 1d20cs>2 + 5[DEX] + 3[PB] + 2[Fighting Style] + 1[Magic Weapon] ]] }} {{?{What kind of roll?|Normal,normal=1|Advantage,advantage=1|Disadvantage,disadvantage=1}}} {{r2= [[ 1d20 + 5[DEX] + 3[PB] + 2[Fighting Style] + 1[Magic Weapon] ]] }} {{attack=0}} {{range= Ranged, Reach 150/600 ft }} {{damage=1}} {{dmg1flag=1}} {{dmg1= [[1d8 + 5[DEX] + 1[Magic Weapon] + ?{Favored Enemy?|No, 0|Yes, 4[Favored Enemy]} + ?{Hunter's Mark?|No, 0|Yes, 1d6[Hunter's Mark]} ]] }} {{dmg1type= Piercing }} {{damage=1}} {{dmg2flag=}} {{dmg2=}} {{dmg2type=dmg2type }} {{crit1=8 + [[ ?{Hunter's Mark?|No, 0|Yes, 6} ]] }} {{crit2=}} {{desc= Caedman strikes his target with an arrow }} ammo=ammo {{charname= Caedman }} If the answer to the hunter's mark question is yes, then a d6 should be rolled for damage. When rolling a critical hit, a d6 is rolled for critical hit damage which is not what I intended. In the case of a critical hit, if hunter's mark is marked as yes, then a 6 should be added to the crit, no dice roll needed. How would I go about implementing this?
1660937137

Edited 1660937274
Gauss
Forum Champion
Use a multiplicative switch in both cases.  ?{Hunters Mark?|Yes,1|No,0}*1d6 for the first instance ?{Hunters Mark?|Yes,1|No,0}*6 for the second instance (the crit) When yes you get 1*1d6 (or 1*6) = 1d6 (or 6) When no you get 0*1d6 (or 0*6) = 0
For long macros like this, it can be really helpful to separate out the queries: !?{What kind of roll?|Normal,normal=1|Advantage,advantage=1|Disadvantage,disadvantage=1} !?{Favored Enemy?|No,0|Yes,4} !?{Hunter's Mark?|No,0|Yes,6} &{template:atkdmg} {{mod= 11 }} {{rname= Longbow +1 }} {{r1= [[ 1d20cs>2 + 5[DEX] + 3[PB] + 2[Fighting Style] + 1[Magic Weapon] ]] }} {{?{What kind of roll?}}} {{r2= [[ 1d20 + 5[DEX] + 3[PB] + 2[Fighting Style] + 1[Magic Weapon] ]] }} {{attack=0}} {{range= Ranged, Reach 150/600 ft }} {{damage=1}} {{dmg1flag=1}} {{dmg1= [[1d8 + 5[DEX] + 1[Magic Weapon] + ?{Favored Enemy?}[Favored Enemy] + 1d?{Hunter's Mark?}[Hunter's Mark] ]] }} {{dmg1type= Piercing }} {{damage=1}} {{dmg2flag=}} {{dmg2=}} {{dmg2type=dmg2type }} {{crit1=8 + [[ ?{Hunter's Mark?}[Hunter's Mark] ]] }} {{crit2=}} {{desc= Caedman strikes his target with an arrow }} ammo=ammo {{charname= Caedman }} Each query can only be 'used once' - you cannot have different outputs based on a single input (query name). So whatever you have in the first instance of your 'Hunter's Mark' query will be used for all future instances, even if you write a different output for them. So the trick is to make the output work in different ways depending on the output you need for each portion. I also see that you have the r1 d20 roll set as '1d20cs>2', which means you'll get a crit on any attack roll that is 2 or higher; however, since you don't have that in the r2 field, you won't get a crit if you are rolling at advantage if the second roll is higher than the first. I'm not sure if that's the intended mechanics for you or not.
1660942326

Edited 1660942361
Gauss said: Use a multiplicative switch in both cases.  ?{Hunters Mark?|Yes,1|No,0}*1d6 for the first instance ?{Hunters Mark?|Yes,1|No,0}*6 for the second instance (the crit) When yes you get 1*1d6 (or 1*6) = 1d6 (or 6) When no you get 0*1d6 (or 0*6) = 0 Thank you! This definitely achieves what I was aiming for. Jarren said: For long macros like this, it can be really helpful to separate out the queries: !?{What kind of roll?|Normal,normal=1|Advantage,advantage=1|Disadvantage,disadvantage=1} !?{Favored Enemy?|No,0|Yes,4} !?{Hunter's Mark?|No,0|Yes,6} &{template:atkdmg} {{mod= 11 }} {{rname= Longbow +1 }} {{r1= [[ 1d20cs>2 + 5[DEX] + 3[PB] + 2[Fighting Style] + 1[Magic Weapon] ]] }} {{?{What kind of roll?}}} {{r2= [[ 1d20 + 5[DEX] + 3[PB] + 2[Fighting Style] + 1[Magic Weapon] ]] }} {{attack=0}} {{range= Ranged, Reach 150/600 ft }} {{damage=1}} {{dmg1flag=1}} {{dmg1= [[1d8 + 5[DEX] + 1[Magic Weapon] + ?{Favored Enemy?}[Favored Enemy] + 1d?{Hunter's Mark?}[Hunter's Mark] ]] }} {{dmg1type= Piercing }} {{damage=1}} {{dmg2flag=}} {{dmg2=}} {{dmg2type=dmg2type }} {{crit1=8 + [[ ?{Hunter's Mark?}[Hunter's Mark] ]] }} {{crit2=}} {{desc= Caedman strikes his target with an arrow }} ammo=ammo {{charname= Caedman }} Each query can only be 'used once' - you cannot have different outputs based on a single input (query name). So whatever you have in the first instance of your 'Hunter's Mark' query will be used for all future instances, even if you write a different output for them. So the trick is to make the output work in different ways depending on the output you need for each portion. I also see that you have the r1 d20 roll set as '1d20cs>2', which means you'll get a crit on any attack roll that is 2 or higher; however, since you don't have that in the r2 field, you won't get a crit if you are rolling at advantage if the second roll is higher than the first. I'm not sure if that's the intended mechanics for you or not. This looks really good and also solves the issue I was having, thank you very much. I had the d20 crit on 2 and higher because I was trying to test out the crit dmg. In actual use, that portion would be removed. I’m also still trying to learn roll20 macros so I haven’t really accounted for formatting too much lol