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

Single query multiple use macro

1701312543

Edited 1701312565
F P.
Pro
So I'm looking to use a single query for mutliple functions within the same macro.  In this case a Melf's Minute Meteors spell where I'd like to determine the number of meteors (by casting level) and then select 1 or 2 meteors to fire and multiply that query for the damage.  The goal is to create something that looks like this: Unfortunately, I can't figure out how or if I can use the second query to also multiply the damage.  If I do a straight query multiplied by the damage dice I get the right results but not the clear sentence structure I'm looking for in the resulting chat message.  Is it possible to use the second query to list the # of meteors fired and then separately multiply that number by the damage dice? Current text of macro below: /em evokes [[(?{slot level?|3}-3)*2+6]] small meteors of fire and launches [[?{1 or 2|1}]] for {{2d6}} fire damage in a 5 foot radius sphere (DEX save DC@{selected|spell_save_dc} for half damage.)
1701313619

Edited 1701313757
Gauss
Forum Champion
To confirm,  If you launch 1 you want it to be 2d6?  If you launch 2 you want it to be 2d6 multiplied by 2? Or do you want it to be 4d6? Or do you want it to be 2d6 and 2d6 (separate rolls)?
1701398527
timmaugh
Pro
API Scripter
If I read that spell correctly, it looks like you want the 2d6 for a meteor, and then you want another 2d6 for your (potential) second meteor. The issue is that you don't have to send them to the same point, so you're not always necessarily adding them into a single, unified amount of damage. Here's a unified damage command where they are totaled as you described... multiplying them (I also created entries in a dropdown query to avoid human-error in typing something that would break the roll): /em evokes [[(?{slot level?|3|4|5|6|7|8|9|10}-3)*2+6]] small meteors of fire and launches [[?{1 or 2|1|2}]] for [[?{1 or 2} * 2d6]] fire damage in a 5 foot radius sphere  (DEX save DC@{selected|spell_save_dc} for half damage.) Here's a unified damage command where they are separate die rolls that are still totaled together (providing a little more range of result): /em evokes [[(?{slot level?|3|4|5|6|7|8|9|10}-3)*2+6]] small meteors of fire and launches [[?{1 or 2|1|2}]] for [[[[?{1 or 2} * 2]]d6]] fire damage in a 5 foot radius sphere   (DEX save DC@{selected|spell_save_dc} for half damage.) And here's a solution that provides differentiated values for the two rolls as well as a totaled solution, in case you had different targets: /em evokes [[(?{slot level?|3|4|5|6|7|8|9|10}-3)*2+6]] small meteors of fire and launches [[?{1 or 2|1|2}]] for [[[[2d6]]+[[[[2*[[(?{1 or 2}+1)%2]]]]d6]]]] fire damage (individual meteors of $[[2]] and $[[5]]) in a 5 foot radius sphere  (DEX save DC@{selected|spell_save_dc} for half damage.) If scripts are available, give me a minute and I might be able to come up with a metascript version...
1701399298
timmaugh
Pro
API Scripter
Yep, with the MetaScriptToolbox installed, you can do this and get different output depending on how many meteors you pick: !/em evokes {&global ([meteorRoll][[[[2d6]]+[[[[2*[[(?{1 or 2|1|2}+1)%2]]]]d6]]]])}[[(?{slot level?|3|4|5|6|7|8|9|10}-3)*2+6]] small meteors of fire and launches [[?{1 or 2}]] for {&if ?{1 or 2} = 1}meteorRoll fire damage{&else}a total of meteorRoll fire damage (individual meteors of $[[0]] and $[[3]]){&end} in a 5 foot radius sphere (DEX save DC@{selected|spell_save_dc} for half damage.) {&simple} Here is some example output, running it twice. The first time I picked 2 meteors to send. The second, I only sent 1.
1701442652
timmaugh
Pro
API Scripter
Don't listen to bad bots.
Thank you very much!  Exactly what I was looking for... timmaugh said: Yep, with the MetaScriptToolbox installed, you can do this and get different output depending on how many meteors you pick: !/em evokes {&global ([meteorRoll][[[[2d6]]+[[[[2*[[(?{1 or 2|1|2}+1)%2]]]]d6]]]])}[[(?{slot level?|3|4|5|6|7|8|9|10}-3)*2+6]] small meteors of fire and launches [[?{1 or 2}]] for {&if ?{1 or 2} = 1}meteorRoll fire damage{&else}a total of meteorRoll fire damage (individual meteors of $[[0]] and $[[3]]){&end} in a 5 foot radius sphere (DEX save DC@{selected|spell_save_dc} for half damage.) {&simple} Here is some example output, running it twice. The first time I picked 2 meteors to send. The second, I only sent 1.