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 Macro - Lay on Hands

Howdy, Hitting a bit of a stumbling block on this one. Lay on hands calls for a d6 for every 2 levels. I'm trying to write a macro using just a lvl attribute. [[(@{level}*.5)d6]] won't work, since it rounds up on odd levels, and we need to round down, but no version of [[(floor(@{level}/2))d6]] that I've tried seems to work, I just keep getting syntax errors or 'could not determine result' errors. Is this sort of macro not possible, or am I just missing something obvious? Cheers for help.
Grouped rolls like KL1, certain rounding functions, and Calculated Dice Roll's currently don't play nice with each other. The only way to combine them is to do a plain regular /roll and inside THAT, do your calculations. For example, Lay On Hands = (Level / 2 D6's) would come out as /r [[ floor( @{level} / 2 ) ]]d6 I have a bunch of example macros for Pathfinder and some explanations over at <a href="https://wiki.roll20.net/Macros_-_Pathfinder_Exampl" rel="nofollow">https://wiki.roll20.net/Macros_-_Pathfinder_Exampl</a>...
1420871557

Edited 1420873471
Lithl
Pro
Sheet Author
API Scripter
Use (@{level} / 2 - 0.5)d6. The number of dice rolled is automatically rounded to the nearest whole number (since rolling fractional dice doesn't make sense unless you're Cohen the Barbarian), which rounds up at X.5. If you subtract 0.5 from a halved number, it will function the same as flooring the result. 1 / 2 - 0.5 = 0.5 - 0.5 = 0 =&gt; 0 = floor(1 / 2) 2 / 2 - 0.5 = 1 - 0.5 = 0.5 =&gt; 1 = floor(2 / 2) 3 / 2 - 0.5 = 1.5 - 0.5 = 1 =&gt; 1 = floor(3 / 2) etc. The concept can be extended, although not easily generalized. round(X / N - 1 / N) == floor(X / N) for all integers X when N = 2 or N = 3, but never holds for N = 1 (not that you need it for N = 1...) and only holds most of the time for larger N. There's probably variants of the same idea you can use for larger N, it's just not so trivial to generalize for all N. (eg, round(X / N - 2 / (N + 1)) == floor(X / N) holds for N = 4 and 5)
Thanks to both for responding. Your solution was perfect, Brian, exactly what I was looking for.
Just found this posting by chance (been searching for some info on macros for my campaign) and have to say Brian your solution is IMHO perfect (the output is much cleaner than with the combined solution). Many thanks for that advice!