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 .
×

Roll template - failure margin

Hi Everyone, I'm trying to adapt a rule on failure margin calculation from a RPG. I have some difficulties with this because it need to do a substraction. what is the rule : roll 1d20, if result is above a treshold (not described here as not usefull), it is a failure and severity of the failure is calculated as roll result minus treshold. then failure margin (FM) depend of this substraction result (let's say 1-2, FM =1, 3-5, FM = 2, 6-10, FM = 3, ...etc (it is not simple rule, it need a table))  As i didn't found a way to do a roll once for all input parameter, i can't calculate it as input of the roll template. As roll template and even rollbetween can't accept variable for all slot. I can't calculate it in roll template. Any idea, did i missed something ? Thanks for reading and help if any.
1586696472
GiGs
Pro
Sheet Author
API Scripter
I think this can be done in a rolltemplate with the logic functions, but you'll have to describe specifics. Describe exactly how the roll works.
I don't see how logic function will help. it is only showing part of the roll template if input have value. this is for having one roll template for different type of roll. game roll is as described above. roll under or equal to treshold is a succes with a succes margin calculated on result of the roll (like failure margin).
1586766583
GiGs
Pro
Sheet Author
API Scripter
You would represent the roll as a calculation, like {{roll=[[roll - threshold]]}} The in the rolltemplate, you can use the logictemplates: if the result is positive, it can report a success. If its negative, it can compare vs the thresholds to report which level of failure applies.
Dice = math = logic.
in case of sending the calculated value (roll minus treshold), i loose the roll result that i need to caculate success margin (as i don't found a way to pass the same roll result 2 times)
1586853790
GiGs
Pro
Sheet Author
API Scripter
Thats posisble, but maybe you can calculate the success margin and failure margin at the same time? How is success margin calculated?
success margin is on "as is" the roll result (1d20). 
1586897811
GiGs
Pro
Sheet Author
API Scripter
Without more specific details, i  cant be 100% sure, but itsound like you're right. If so, only a custom API script will be able to do it.