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

How to do math with roll queries in a macro?

1488946570

Edited 1488946661
I'm trying to modify the macro below for items that roll multiple dice per charge (For reference, this is the example macro given for a Cure Light Wounds wand on the pathfinder macro examples wiki page): &{template:pf_attack} {{name=Wand:Cure Light Wounds}}{{Target=@{target|Token_Name}}} {{Charges:[[?{How many charges|1}]] =Heal [[?{How many charges|1}d8 + ?{How many charges|1} ]] HP}} As is, it asks how many charges and rolls that many dice, which works for a cure light wounds wand because it's 1d8+1 per charge so you can just use the number of charges directly. But for another item that rolls for example 3d8+5 per charge, is it possible to grab the value given for charges and multiply it by the single charge number? I'm wanting to be able to, for example, tell it 3 charges and have it automatically roll 9d8+15.
1488947005
Tetsuo
Forum Champion
Sure. You could do {{Charges:[[?{How many charges|1}]] =Heal [[[[(?{How many charges|1}*3)]]d8 + [[?{How many charges|1}]]*5]] HP}}
That works! Much thanks for the help. I didn't think something that simple would work cause I tried doing math like that with something else once before and it ended up taking the second value as the dice amount and not doing the math at all. I guess the nested rolls make a difference.