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

Nested Queries with Macros for Ranger with Quarterstaff

I am trying to make a few Token Action Macros on the Attributes & Abilities tab of a character sheet. This D&D 5E character named Urku is only a level 3 ranger but I am having issues with nested queries. My first attempt at queries was with a longbow and it worked well: &{template:atkdmg} {{mod=+[[@{dexterity_mod}+@{pb}]]}} {{rname=Longbow}} {{?{Roll Type?|Normal,normal|Advantage,advantage|Disadvantage,disadvantage}=1}} {{r1=[[1d20+@{dexterity_mod}[DEX]+@{pb}[PROF]+2[Fighting Style]]]}} {{r2=[[1d20+@{dexterity_mod}[DEX]+@{pb}[PROF]+2[Fighting Style]]]}} {{attack=1}} {{range=150/600}} {{damage=1}} {{dmg1flag=1}} ?{Modifiers?|No,{{dmg1=[[1d8+@{dexterity_mod}[DEX]]]&#125&#125 {{crit1=[[1d8]]&#125&#125|Yes,{{dmg1=[[1d8+@{dexterity_mod}[DEX]+@{global_damage_mod_roll}]]&#125&#125 {{crit1=[[1d8+@{global_damage_mod_roll}]]&#125&#125} {{dmg1type=Piercing}} {{ammo=ammo}} {{charname=Urku}} It isn't perfect because I still want it to lower the ammo amount but that is a topic for another chat. In this attempt, I ask whether or not there should be global attack damage modifiers (Modifiers?) used in calculating both the regular or crit damage of the attack. I have tested the code and it works. The problems arose when I tried to incorporate the same query of global attack damage modifiers (aka Hunter's Mark and the new Favored Foe die) to a quarterstaff attack but nesting another query inside of that to figure out if we are attacking either one-handed (1d6) or two-handed (1d8). I am only showing the nested queries below since this is where I am running into bugs: ?{Modifiers?| Yes,?{How Hard?| One-Handed, {{dmg1=[[1d6+@{strength_mod}[STR]+@{global_damage_mod_roll}]]}} {{crit1=[[1d6+@{global_damage_mod_roll}]]}}| Two-Handed, {{dmg1=[[1d8+@{strength_mod}[STR]+@{global_damage_mod_roll}]]}} {{crit1=[[1d8+@{global_damage_mod_roll}]]}} }| No,?{How Hard?| One-Handed, {{dmg1=[[1d6+@{strength_mod}[STR]]]}} {{crit1=[[1d6]]}}| Two-Handed, {{dmg1=[[1d8+@{strength_mod}[STR]]]}} {{crit1=[[1d8]]}} }} The broken code I attempted to use was: &{template:atkdmg} {{mod=+[[@{strength_mod}+@{pb}]]}} {{rname=Quarterstaff}} {{?{Roll Type?|Normal,normal|Advantage,advantage|Disadvantage,disadvantage}=1}} {{r1=[[1d20+@{strength_mod}[STR]+@{pb}[PROF]]]}} {{r2=[[1d20+@{strength_mod}[STR]+@{pb}[PROF]]]}} {{attack=1}} {{damage=1}} {{dmg1flag=1}} ?{Modifiers?|Yes,?{How Hard?|One-Handed,{{dmg1=[[1d6+@{strength_mod}[STR]+@{global_damage_mod_roll}]]}}{{crit1=[[1d6+@{global_damage_mod_roll}]]}}|Two-Handed,{{dmg1=[[1d8+@{strength_mod}[STR]+@{global_damage_mod_roll}]]}}{{crit1=[[1d8+@{global_damage_mod_roll}]]}}}|No,?{How Hard?|One-Handed,{{dmg1=[[1d6+@{strength_mod}[STR]]]}}{{crit1=[[1d6]]}}|Two-Handed,{{dmg1=[[1d8+@{strength_mod}[STR]]]}}{{crit1=[[1d8]]}}}}{{dmg1type=Bludgeoning}} {{ammo=ammo}} {{charname=Urku}} A simplified second attempt was using this code which overall works but the outputs look funny if the global damage modifiers aren't used at all since you have 0 values without descriptions where the modifiers would be, and it especially looks weird if you score a critical strike since the crit damage if I hovered over it had a value but it displayed as a 0 due to the bug from the global damage modifier: &{template:atkdmg} {{mod=+[[@{strength_mod}+@{pb}]]}} {{rname=Quarterstaff}} {{?{Roll Type?|Normal,normal|Advantage,advantage|Disadvantage,disadvantage}=1}} {{r1=[[1d20+@{strength_mod}[STR]+@{pb}[PROF]]]}} {{r2=[[1d20+@{strength_mod}[STR]+@{pb}[PROF]]]}} {{attack=1}} {{damage=1}} {{dmg1flag=1}} ?{How Hard?|One-Handed,{{dmg1=[[1d6+@{strength_mod}[STR]+@{global_damage_mod_roll}]]&#125&#125 {{crit1=[[1d6+@{global_damage_mod_roll}]]&#125&#125|Two-Handed,{{dmg1=[[1d8+@{strength_mod}[STR]+@{global_damage_mod_roll}]]&#125&#125{{crit1=[[1d8+@{global_damage_mod_roll}]]&#125&#125}{{dmg1type=Bludgeoning}} {{ammo=ammo}} {{charname=Urku}} Any ideas on how to fix my staff issues? Help would be greatly appreciated!
I'd prefer to be able to not have to go into my character sheet and just use my token and macros so if it can be done using nested queries that is IDEAL but the second attempt works for at least the moment...
1668918038
Gauss
Forum Champion
Couple things here:  1) Instead of doing one handed vs two handed full macros, substitute the query for the damage dice size instead. It will greatly simplify what is breaking. Then you can go back to the Longbow macro's style of macro.  2) For what you are doing it is generally recommended to use Chat Menus rather than nested queries. They work a lot better and still let you do it from a  single macro button. With less button presses usually.