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

Another way to set a max value, better?

So I needed to call an attribute and add it to a roll, but cap it (as the attribute can go higher than the allowed bonus) I did some searching and found this 1d8+ @{Level} + (@{Level}-@{Maxlevel})*[[(floor(1/(floor(@{Level}/@{Maxlevel})+1))-1)]] but I have no idea how this is meant to work, and dispute returning the correct answer seems overly complicated Instead a simpler way is this: 1d8+([[@{Level}]]d1k[[@{Maxlevel}]]) The square brackets are not needed in this example, but if your level or max level requires any math like floor(@{Maxlevel}/3) then they are needed. But the question is if all those d1s would be overly resource heavy compared to the other method? anyway, thoughts? problems? an even better method?
1526243822
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Even better is to use the ability of roll20 to decide between the higher (or lower) of a group of numbers: 1d8+{@{Level},@{Maxlevel}}kl1