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 .
×
Our team is currently investigating rolling service outages. For more information, visit our most recent Forum Announcements post.
Create a free account

Maximum addition to a roll variable

Simple task to be sure. In an attempt to create an inline /roll macro for an effect I come up with this: [[ceil(@{Level}/3)]] which works fine. But the effect is meant to cap out at +6 (Meaning a level 21 character would have a result of 7 which is 1 point too high.) To prevent the inline from allowing calculations higher than a result of 6 does there exist a variable to add to the code?
Use [[ {ceil(@{Level/3}), 6}kh1]]
To be fair, I'll elaborate that this effect modifies the Armor Class Trait based on Character Level. Thanks in no small part to your influence I came up with : [[(@{selected|ArmorClass}+2)+(@{Level}/6)d1kh6]] This creates the effect of calling on the targets AC and adding 2. Then adds the CASTERS character level divided by 6. The result of that math (Hidden) is then multiplied by the top 6 results on a roll of a one sided die.. lol. Since the results of the d1 will always be 1. It'll always account as +1 to my total and the number of dice rolled cannot exceed 6, and no die will be rolled if the result of the division is less than 1. I owe it all to you, thanks! I would have never even bothered to look at kh.... Much appreciated.
1402859533

Edited 1402859566
Actually, I screwed up. It should have been KL. As in Keep Lowest 1 value.
Aye, I caught it - but it works as I've posted and tested so far. But even with all considered the whole notion of adding KH/KL was evading my logic. So thanks are certainly in order.