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 .
×

Modifier macro breaks the rest of the macro

So I've been working on a TTRPG system, and to make it as easy and clutter free as possible, I'm making macros to assist with rolls and attacks. Everything works perfectly fun until I add ?{Modifier|0} into the mix, then all hell breaks loose. Here's an example block of macro code that works: ?{Attack Style | Normal Attack,/r 1d20+@{selected|DEX}+@{selected|Blade} /r 1d6+@{selected|STR}+@{selected|Blade}| Precise Attack,@{selected|character_name} stabs at a weak spot! /r 1d20+@{selected|STR}+@{selected|Blade}+1d4 /r 1d6+@{selected|STR}+@{selected|Blade} @{selected|character_name} expends 2 Stamina.| Hard Hit,@{selected|character_name} strikes with ferocity! /r 1d20+@{selected|STR}+@{selected|Blade} /r 2d6kh1+@{selected|STR}+@{selected|Blade} @{selected|character_name}expends 3 Stamina. | Pinning Strike,@{selected|character_name} pins their target down! /r 1d20+@{selected|STR}+@{selected|Blade} /r 1d6+@{selected|STR}+@{selected|Blade} The target has their speed reduced to 0! @{selected|character_name}expends 3 Stamina | Supporting Strike,{selected|character_name} sets up for the next attack! /r 1d20+@{selected|STR}+@{selected|Blade} /r 1d6+@{selected|STR}+@{selected|Blade} The next attack made at the target has advantage! @{selected|character_name} expends 3 Stamina.} Whenever the character attacks with an Iron Spear, they have the option of a normal attack, precise attack, hard hit, pinning strike, or supporting strike. A drop down box appears, the appropriate options show up, dice rolls as normal with descriptive text as normal. However, when the ?{Modifier|0} is added to any d20 line, it breaks completely. "Normal attack" and "0" are the only two options, and while there is a modifier box that pops up, it still spits out all the flavor text rather than just the appropriate bit. If anyone knows a way to fix this or needs more info to find said fix, please let me know and thanks in advance!
1677259640

Edited 1677259820
Gauss
Forum Champion
You are nesting queries , that increases the level of difficulty significantly.  When the 2nd (nested) query is reached the initial query sees the nested query's "}" as the end of ITs query. So it breaks.  Note: this doesn't happen for Attributes due to how Attributes get resolved first, before queries.  You will need to use HTML Entities to resolve this.  Note: your level of nesting is readily doable with HTML Entities, but if you add any more nested queries to your macro I would suggest Chat Menus instead.