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

Pathfinder Sheet spell macro

I have this in the description of my spell An explosion of energy reaches out doing ?{How many}d6+?{Modifier|0} ?{Which Energy?|Fire| Cold|Electricity|Sonic} dmg to all in it's radius: [[?{How many}d6+?{Modifier|0}]] Fire +1 dmg /die REF save for 1/2 dmg Cold +1 dmg /die FORT save for 1/2 dmg Electricity +2 on Caster Level to overcome Spell Resistance and +2 on Save DC Sonic -1dmg / die ignores object's hardness Augment: +1 PP / +1d6dmg For each 2 PP spent this way DC increases by 1. When I cast it, it asks me to put in the amount of dice to use and the mod.  Is there a way to get the DC to adjust itself based on the # of dice that I select.  (the power does 3d6 damage normally plus for every 2 additional dice of damage the DC goes up by 1.  Is there a way to program the DC field so that it checks to see how many dice over 3 I chose and adds that divided by two as a bonus to the DC?) Thanks for the help! :-)
I could be very much mistaken [and happily acceptable to be corrected] but you cannot take a roll that was done and later use it in a macro without API help. That being the case thou, you can take a previous call (ie ?{How many} ) and reapply that in another location by simply calling it again without any problems. I'm very much not an expert and can't really look at code and see the problem, but if I understand the situation correctly this might be a way to try and do it. DC [[ #01  [Base DC] + (( ?{How many} - 3 ) / 2) ]] Replace #01 with whatever the Base DC is for this situation.
1489328587

Edited 1489328656
Tetsuo
Forum Champion
Kiwi has the basic gist of it, though you may want to make use of the floor command, which rounds numbers down. This is useful in case ?{how many}-3 ends up being an odd number. this would get rid of the decimal. DC [[ #01 [Base DC] + floor (( ?{How many} - 3 ) / 2) ]]
1489332954

Edited 1489334085
Since the DC is a calculated number from the Character sheet I am just going to put that in the formula so that it is always updated when the sheet changes.  I will try it and see how it works. Ok, that works great!  Now how do I get it to show up in the "DC" area of the roll template for my spell.  I can place the formula in the description section but if possible I would like it to show up in the "DC" area that comes with the template. Any ideas??
If you have a character sheet, what spell are you casting and what system? I was going to use floor, but most people I have seen using things like this, don't tend to use numbers that would give a bonus. If its pathfinder, you have the English Character Sheet, and its a Level 1 Spell, you can use @{Cname|spellclass-0-level-1-savedc} where Cname is the name of your character sheet. in place of #01 in the example above.
1489335703

Edited 1489337400
DC [[ @{spellclass-1-level-2-savedc} +floor((?{How many}-3)/2)]] I used this for the Pathfinder English Sheet and it works in the description section, but where would I type that to get it to show up in the Template of the spell??? I want the 22 DC from the description section to show up where the 19 DC is beside the "Save:" area. Also, do you know the correct syntax to make this work? The power repairs [[3+ floor((?{How many}-3)/2)d6+@{spellclass-1-level-total}]] (I want it to repair minimum 3d6 +1 additional d6 based on the number of Power Points that I select.  5PP should return a total of 4d6+CL in repair)  I can't figure out how to get it right.