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

Macro with special attack and a roll query

Hello d20, new user here. I am loving this program so far. I have a macro question about a special attack like Sneak Attack. I found the formula in the Wiki that works well: /roll 1d6 +4 + ?{Sneak Attack?| No, [[0]] |Yes,[[3d6]] } What if I wanted to make the actual sneak attack damage variable instead of always 3d6? I tried the following, replacing the 3d6 with a roll query: /roll 1d6 +4 + ?{Sneak Attack?| No, [[0]] |Yes ,[[?{Number of Dice|1}d6]] } However this didn’t work. The results looked like this: rolling 1d6 +4 + [[5 (3) = 3 Does anyone know how to do this? Can you even use a query inside a conditional Yes/No macro? Thanks so much, Jeff
Hi,  Jeff M. Nesting a child Roll Query within a parent Roll Query is very possible, but requires that some of the characters that compose the syntax of the child Roll Queries be subject to special character replacement, as outlined by Advanced Usage for Roll Queries . You might also wish to check out the  Example (nesting Roll Queries) within that Wiki section.
1461186914

Edited 1461188417
It worked! Thank you to Silvyre. It functioned great but one note of caution if you make any changes to the macro it “forgets” that you replaced those characters and doesn’t work anymore.