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

Limiting a modifier to a certain value or less.

So I'm setting up a macro that will simulate a Cure Light Wounds spell, that can be used by any player. The die roll for this is 1d8, plus 1 point per caster level, to a maximum of 5. The character sheets have caster level listed as an Attribute; at the moment they're only level 1 or 2, but will eventually go higher. The die roller looks something like this: [[1d8+(@{Level})]] After they reach level 6, how can I limit this to 5 or less? < and > don't work, as they tend to explode or do nothing at all, depending. Anybody know of a solution to this? -Phnord
[[1d8 + {@{Level}, 5}KL1]]
Beauty! I knew there was a way to do it, thanks HoneyBadger, that worked perfectly. -Phnord
Up for one more? Can you make this work: Half level, rounded down, = number of d6 rolled. [[({floor(@{level}/2),1}kh1)d6]] doesn't seem to work, it just gives me a result of 2 every time. (level = 5 for testing purposes)
1394259694
GiGs
Pro
Sheet Author
API Scripter
First, if you want to change the cure light wounds so the dice is rolled visibly in chat, you can use this: 1d8 + [[{@{Level}, 5}KL1]] For the second macro, use this: /roll [[{floor(@{Level}/2),1}kh1]]d6
Thanks GG, but I want everything to be inline rolls. I tried every combination of bracketing I could think of but couldn't get it to work... Then I just realized how much easier it would be to use Level and MaxLevel, and that works like a charm. [[@{selected|level|levelMax}d6]] works just the way I want it to; although level Max is actually 1/2 Level, rounded up. Still works. Thanks anyway! -Phnord
1394270465
GiGs
Pro
Sheet Author
API Scripter
Eureka! I tried using inline rolls, but couldn't get the second one to work either. But while testing, i just discovered something very useful. If you use a fraction as the number of dice, roll20 rounds to the nearest automatically (halves rounding up). So, this [[((@{Level}-1)/2)d6]] does what you need, with no extra stat needed.