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

Multiple Results for One Query Selection (including FX)

Hello all! Long-time Roll20 user, first-time forum poster, diving into macros and such to create a seamless experience for my players. I'm not a coder at all, so apologies if this seems simple or has been answered elsewhere. Is there a way (preferably without API) to create multiple results based off one query answer? For example, let's take Rowan. Rowan is a Wot4E monk who can choose to use Fangs of the Fire Snake to deliver fire damage instead of bludgeoning, So my query looks something like: **On a hit:**  @{target|token_name} takes ?{Are you using Fangs of the Fire Snake? | Yes, [[1d6+3]] fire damage! | No, [[1d6+3]] bludegoning damage! } Okay, simple enough. But what if I want her "Yes" answer to accomplish TWO things, instead of just the damage roll and the text. For example, adding an FX. I've tried something like: **On a  hit:**  @{target|token_name} takes ?{Are you using Fangs of the Fire Snake? | Yes, {[[1d6+3]] fire damage!} {/fx burn-fire} | No, [[1d6+3]] bludegoning damage! } I've tried various versions of this, including using the HTML codes to break up the curly-cues, commas and straight lines. No luck. Any help would be much appreciated!
1572289828
Ziechael
Forum Champion
Sheet Author
API Scripter
The secret to queries is not to think of them as part of the code, take the query out and replace it with the various results and you get you actual outcome since the macro will replace the entire query, and any matching queries with the result you choose... ok that was just confusing to type... but for your use case you want to run another line of code after the damage outcome... easiest way? Add another line to your code, a good old hard return will do the job nicely: **On a hit:** @{target|token_name} takes ?{Are you using Fangs of the Fire Snake?|Yes,[[1d6+3]] fire damage! /fx burn-fire|No,[[1d6+3]] bludegoning damage! }
1572289907
Ziechael
Forum Champion
Sheet Author
API Scripter
That will default to running the burn on the selected token rather than the target one, to run it on the target you'll want to add an @{target|token_id} after the fx call: **On a hit:** @{target|token_name} takes ?{Are you using Fangs of the Fire Snake?|Yes,[[1d6+3]] fire damage! /fx burn-fire @{target|token_id} |No,[[1d6+3]] bludegoning damage! }
1572289985
Ziechael
Forum Champion
Sheet Author
API Scripter
Super bonus points for trimming it further, since the only change is the damage type and the fx you can keep the roll outside the query: **On a hit:** @{target|token_name} takes [[1d6+3]] ?{Are you using Fangs of the Fire Snake?|Yes,fire damage! /fx burn-fire @{target|token_id}|No,bludegoning damage! }
My mind is officially blown... so simple yet so elegant. New way of looking at queries, and I guess I didn't even realize I could keep rolls outside queries instead of duplicating them. This was so helpful- thank you so much Ziechael!