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

Need help for a dice roll formula

Hello all, I'm trying to do a dice query in one roll that will simulate an optional rule in trail of cthulhu Launch a D6. If 1 reroll. if gain 1, critical failure. Same for 6, reroll, in case 6, criticial success I don't want to sum the dice I'm also looking for a way to apply damage easily with the second dice roll I would like to apply the max between 0 and the dice roll with modifiers. It happens the result is negativ, so i don't want to give back health to players. I have not find max function in the doc
1612659760
David M.
Pro
API Scripter
Are you comparing the roll to a difficulty score? How do you determine success normally? Or is this separate from some standard skill check?
1612667944

Edited 1612668001
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
JPL said: Launch a D6. If 1 reroll. if gain 1, critical failure. Same for 6, reroll, in case 6, criticial success I don't want to sum the dice if you don't care about about having two dice rolled at the same time... preroll both dice at  once (you will see both if you use 3d dice) otherwise create a roll inside a roll <button class="sheet-dicefontd10" name="roll_skill" type="roll" value="@{gm_toggle} &{template:rolls} {{roll1=[[1d6]]}} {{confirm_crit=[confirm](~confirm-critical)}}">k</button> <button class="sheet-none" name="roll_confirm-critical" type="roll" value="@{gm_toggle} &{template:confirmation} {{roll2=[[1d6]]}}}"></button> and in the roll template has a line like this one {{#rollTotal() roll1 6}} <div class="sheet-template-row"> <span class="inlinerollresult">{{confirm_crit}}</span></div>{{/rollTotal() hasdamage 1}} {{/rollTotal() roll1 6}} It will create a second button the player can press to roll to confirm the critical (and you can compare it to the same result) Similar for the one The second method is better if you like to see your dice rolled on the table
very nice solution indeed ! i was sure something exist :)