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

Math.min equivalent for roll expressions?

1442161428
Lucian
Pro
API Scripter
Hi, Is there support for setting minima (or maxima, for that matter) on a dice expression? Let's say I want to roll 1d6-2, but with a minimum result of 1. A roll of 1-3 on the d6 should give a result of 1, and 4-6 should give 2-4. Hit dice in D&D are supposed to work this way, for example (assuming you have a CON penalty). Basically I just want to be able to write something like: [[max(1d6-2, 1)]] Cheers, Lucian
[[ 2d6KH1 ]] KH1 = keep highest one [[ 2d6KL1 ]] KL1 = keep lowest one  For what you want: [[ {1d6-2, 0d1+1}kh1 ]]
1442161743
Lucian
Pro
API Scripter
Aha, brilliant, thanks so much! Lucian