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

An "equation" that only calculates until a certain point "reduce penalty up to 0"

So, I'm fairly new to roll20, and I'm trying to set up my character sheet for my first character. I currently have this equation: -4 + floor( ( @{level}+1 ) /4 ) It starts with a penalty of -4, then reduces that penalty based on level (starting at level 3, and further at 7, 11, 15, 19) But here's the problem... because technically this formula will result in a +1 at level 19, yet the ability that does this "reduces the penalty to a maximum of 0". Now, the reason this is, because the initial -4 is based on a variable that can cause it to go further into the negative(-6, -8, etc), so the abilitiy reduces the penalty by a total of 5 at level 19. So is there any way to tell this equation that it should never be greater than 0, without creating and adding an exception to the equation, e.g. appending " - floor( @{level}/19 ) ", which would subtract 1 further, only if level is 19 or greater.
You can use the keep lower functionality of the dice roller to do this kind of comparison. It does require dice on both sides of the comparison however. [[{-4+floor((?{level|1}+1)/4)+0d0,0d0}kl1]] For more information see  here .
1495224207

Edited 1495224295
Silvyre
Forum Champion
Kyle G. said: It does require dice on both sides of the comparison however. Only if one of the sub-roll expressions contains a sum roll . If none of the sub-roll expressions contain any sum or success rolls, everything should work just as well.
In that case, this is easier to understand. Thanks Silvyre [[-4+floor(({?{level|1},18}kl1+1)/4)]]
Kyle G. said: [[-4+floor(({?{level|1},18}kl1+1)/4)]] Correct me if I'm wrong, but this is still adding a static exception, saying only to use level as long as its value is lower than 18, meaning that I would not be able to just use the same equation, for a base of -6. This equation would result in -2, when in fact, at level 19 and 20, would be -1. If that's the case, then it's still not quite what I'm looking for. I'm okay with using static exceptions if needed, but I was hoping for a flexible exception.
AH! Wait! You're onto something. The equation should still work... if we change where that addition is... { (-4+floor((@{level}+1)/4) ) , 0 }kl1 This should use whichever of the two is lowest... either the result of the equation, or 0. meaning when the equation becomes positive, it will use 0... in theory. Will have to test, but thank you. I believe this is exactly what I was looking for.