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

Nesting Problems

I am currently trying to create a macro where the players can select which potion they want to use and it auto rolls the healing and applies it, however, I've hit a bit of a snag.  While the individual potion macros work, they immediately flop when I try to nest them. The code for the nest is: ?{Which potion?|Healing,#Healing-Potion |Greater,#Greater-Healing  }} However, when I run it I get this Not entirely sure what I'm doing wrong. And for those wondering what the potion code looks like, I'm utilizing the PowerCards API to run it: !token-mod --set bar1_value#[[{@{selected|bar1|max},[[@{selected|bar1}+2d4+2]]}kl1]] --report all#"{name} drinks a Potion of Healing and heals {bar1_value:change} hp"
<a href="https://wiki.roll20.net/Macros#Nesting_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Nesting_Macros</a> Due to the&nbsp; order of operations , Macro calls nested within Roll Queries are fully expanded before the Roll Query is executed. This means that if a macro nested within a Roll Query contains any "problematic characters" that conflict with Roll Query syntax (such as "}" "," and "|"), that nested macro may cause the Roll Query to break (because the Roll Query will treat problematic characters in the called macro as Roll Query syntax). This is a common issue, where basically Roll10 expands all of the macros in the nested query, so it becomes: ?{Which potion?|Healing,!token-mod --set bar1_value#[[{@{selected|bar1|max},[[@{selected|bar1}+2d4+2]]}kl1]] --report all#"{name} drinks a Potion of Healing and heals {bar1_value:change} hp" |Greater, ... As soon as the first } is seen from&nbsp; bar1_value#[[{@{selected|bar1|max} , Roll20 closes the query. The better option is to use a chat menu.&nbsp; <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072</a> Here is a similar example from a post a month ago on healing potions: <a href="https://app.roll20.net/forum/post/9174202/fun-macros-for-non-api-users-such-as-myself/?pageforid=9190118#post-9190118" rel="nofollow">https://app.roll20.net/forum/post/9174202/fun-macros-for-non-api-users-such-as-myself/?pageforid=9190118#post-9190118</a>
Jarren K. said: As soon as the first } is seen from&nbsp; bar1_value#[[{@{selected|bar1|max} , Roll20 closes the query. I still find this completely idiotic.&nbsp; Roll20... please improve your parser.&nbsp; When a closing brace is seen, it should only close the previous opening brace, not the whole god damn query!