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

Spell Macro help

My reconstruction power is 3d8+1/lvl and for every +2Power Points spent gives +1d8.  Is the following the right formula?  I feel like its not giving me the right numbers but I'm not all that sure.  Base power costs 3PP to use. Power Points Used: ?{How many} PP The power repairs [[ {3+(floor((?{How many}-3)/2))}d8+@{spellclass-1-level-total}]]
Forum Champion
try: [[ [[3+(floor((?{How many}-3)/2))]]d8+@{spellclass-1-level-total}]]
Awesome Franky that worked perfect.  I just needed those other brackets it looks like.  I have another one if you have the time.  Below is what I use for my psi powers.  Is there a way to tell it that if I don't pick a number in the box and just hit enter that it should select a minimum of 5d6?  Since its a 3rd level power I would have to spend at least 5PP to make it work so the base dmg is 5d6.  I can change the MODIFIER to 5 as a default, but how do I get the d6 that way??   Like a MIN(5(?{how many}d6) or something like that?? ?{How many}d6+?{Modifier|0} ?{Which Energy?|Fire| Cold|Electricity|Sonic} dmg to all in it's radius: [[?{How many}d6+?{Modifier|0}]]
You can specify a default value in a macro query by putting the default value inside the query after a "|", just like you have for ?{Modifier|0} it defaults to 0. The great thing about this is that you don't have to put the default value in the query if you reuse it later so ?{How many|5} and ?{How many} later on will still be the same value. ?{How many|5}d6+?{Modifier|0} ?{Which Energy?|Fire| Cold|Electricity|Sonic} dmg to all in it's radius: [[?{How many}d6+?{Modifier|0}]]
Forum Champion
Marketplace Creator
API Scripter
That's how that works! Thanks, I was trying to find that in the wiki the other day.
Another trick I figured out was to use the default value twice to lock the choice. If want to have 5 as the only option put ?{What value|5|5} and then the pull down is locked at 5. Neat trick for things like warlock spell slot level selection.
Ed, wouldn't it be easier to remove the query if there is only one possible value for it to be?
In the use case I was referring to I am overwriting an existing query, in my case the spell slot selection.
I get that, but if you are already going through the trouble of overwriting the query why not just remove the query as well and put in an attribute for the warlock's spell level? (I've never had a warlock in my games so I am wondering if maybe there is something I'm not thinking of.)
Well I don't know anything about warlocks, but you guys are freakin' wizards at macros and I love it!  Thanks for the help.  I have more questions for later. hahaha