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

2d? every 4th

Ok so, i've been working on making all my spell macros automatically update their level dependent variables for me to speed up the process of leveling up during a campaign, but i've run into a slight snag with a particular spell... unlike most of my spells that deal 1d? every X levels or 2d? every 1-2 levels this particular spell deals 2d? every 4th... at first I figured it'd be no different than the 2d? every 1-2 level spells but it would appear I was wrong about that... since floor/ceil can't be included in an equation to determine the number of dice i end up with some odd results when the level variable moves from 1-2 up to 3+. +2 every 1-2 my results are always Odd.5 or Even giving me an even number of dice every time... but with +2 every 3 or more i get a wider range of results including many Even.# results yielding an odd number of dice where there should only be even. So to put it simply... I need a calculation that will always yield an even number of dice for a +2 every 4th level modifier... (((@{casterlevel}-3)/4)*2)d? I thought taking my +1 every 4th calculation and doubling the result would work but it doesn't... and it gets progressively worse as level increases.. for example, at 12th level It should add it's 3rd set of dice giving the spell 6 dice but instead the calculation yields a result of 5 dice since (12-3)/4 = 2.25 doubled is 4.5. I considered adding 1.5 to the end of the equation, but then i'd be getting my 5th and 6th dice at 11th and a 5th dice at 10th switching to a +1 every 2nd calculation solves the issue of the calculation giving progressivly fewer dice than it should at every 4th level, but still results in odd dice on every even level between ((@{casterlevel}-1)/2)d? so any help to resolve this would be greatly appriciated
1405534718
Gauss
Forum Champion
To clarify, what is the exact progression of dice this should have? 3 +1 every 4 levels?
1405540257
Lithl
Pro
Sheet Author
API Scripter
/r [[floor(@{level} / 4) * 2]]d@{die-size}
1405668753

Edited 1405669706
the progression of the actual spell is +2d6 every 4 levels (Force Missile) if it was a +1d6 every 4 levels i wouldn't be having any issues... or if it was just a flat +2 every 4 for that matter... the issue comes up when dealing with multiple level dependent dice... I have a working equation for adding a single extra die at any level interval, but adding multiple dice is when it gets tricky with anything other than every 1-2 levels... since my equation involves subtracting 1 less than the level interval in order to insure that the end result is less than or equal to the number of dice for that level since the dice engine rounds up a result of 1.xd6 yielding 2d6 rather than down to 1d6, this was a necessary fail-safe to avoid rolling 3d6 at a level that should still roll 2d6 due to a fractional increase bumping the result up to 2.xd6. But this method only works for adding a single die at various level intervals... when I start adding multiple dice however the whole equation goes awry and I start getting dice rolls that aren't even possible for the specific ability. Multiple dice isn't really an issue for me only when the level interval is 1... Also i need this to function in an in-line roll so a "/r [[floor()]]d6" style solution won't work for this, I use in-line rolls in all my macros to not flood the chat panel with dice results, and it allows for a little extra RP flavor in the macro's text. Some of my macros can get quite dice heavy or involve multiple sets of rolls or variable values so avoiding "/r" entirely helps out a lot and speeds the game along since we don't have to scroll through and figure out which set of dice was for what all the time
1405670663

Edited 1405670784
Gauss
Forum Champion
You mentioned that you would not have this problem if it were +1d6 every 4 levels. My suggestion? Use the formula for +1d6 every 4 levels twice in your macro. Basically: Xd6 +Xd6 where X is your formula for once every 4 levels.
1405694444
Lithl
Pro
Sheet Author
API Scripter
Chell said: my equation involves subtracting 1 less than the level interval in order to insure that the end result is less than or equal to the number of dice for that level since the dice engine rounds up a result of 1.xd6 yielding 2d6 rather than down to 1d6, this was a necessary fail-safe to avoid rolling 3d6 at a level that should still roll 2d6 due to a fractional increase bumping the result up to 2.xd6 Actually, the engine rounds to the nearest whole number (round), not round up (ceil). Compare /r (1.25)d20 and /r (1.5)d20
1405710795
Gauss
Forum Champion
I spent some time and tested this out. It should work for you. [[(@{casterlevel}/4-0.5)d6 +(@{casterlevel}/4-0.5)d6]]
1405716561

Edited 1405716892
Gauss said: You mentioned that you would not have this problem if it were +1d6 every 4 levels. My suggestion? Use the formula for +1d6 every 4 levels twice in your macro. Basically: Xd6 +Xd6 where X is your formula for once every 4 levels. thats... actually a pretty logical solution... Brian said: Chell said: my equation involves subtracting 1 less than the level interval in order to insure that the end result is less than or equal to the number of dice for that level since the dice engine rounds up a result of 1.xd6 yielding 2d6 rather than down to 1d6, this was a necessary fail-safe to avoid rolling 3d6 at a level that should still roll 2d6 due to a fractional increase bumping the result up to 2.xd6 Actually, the engine rounds to the nearest whole number (round), not round up (ceil). Compare /r (1.25)d20 and /r (1.5)d20 I tested this back when I made the macro originaly and it always rounded up... did they change something in the past month?