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

Roll d12, if the result is 12 roll d20 and keep highest

1596530056
Laurent
Pro
Sheet Author
API Scripter
Hi. I can't figure out how to write a roll that does the following: Roll a d12. Keep the result if it is below 12, but if it is 12, roll a d20 and take that result instead if it is bigger than 12. Is there a way to do it?
1596535377

Edited 1596535442
GiGs
Pro
Sheet Author
API Scripter
You could do it with a custom API script. You could also do it with a Rollable table by faking it - calculating the probabilities of every possible result and building the table. You cant do it with a normal macro. For the API route, we'd need to know how you are using it - what does a complete roll look like? What do you want to appear in chat?
1596535852
Laurent
Pro
Sheet Author
API Scripter
Custom API wouldn't be so convenient, as I would like the roll to be part of some larger inline roll. It is doable, but it'd rather use some dice expression, if possible. How would you do it with a normal macro?
1596536623
GiGs
Pro
Sheet Author
API Scripter
You cant do it with a normal macro. It is not possible at all. Macros cannot do conditionals, like "if the d20 is max, check if d20 is higher and use that instead".
1596537578
Laurent
Pro
Sheet Author
API Scripter
Ok, I'll use the API, then. Thanks.
1596542606
The Aaron
Roll20 Production Team
API Scripter
The rollable table option is not too bad. 1–11 would have a weight of 20 each, 12 has a weight of 12, 13–20 each have a weight of 1. 
1596551615
GiGs
Pro
Sheet Author
API Scripter
Yeah, the rollable table is the easiest solution, since you can all it like a dice roll.