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

Stop rolling if value is reached, with a maximum limit of die thrown

My homebrew TTRPG uses specific training means where players have up to 5 dies to throw during each training session,  they have to stop training when they roll a specific value or more (As in they met an unexpected problem while training) if not they keep throwing until 5 dies are thrown Is there a way to keep throwing as long as 95 or more isn't reached, but with a maximum of 5 throws ? IE : I roll a D100 up to 5 times if 95 or more isn't rolled 15 75 89 2 4 <= This training is fine, no specific problem encountered 15 19 98 <= 95 or more, I stop there, my character have reached a bottleneck
1738193494
Gauss
Forum Champion
Hi Lord Excarnis McBat,  To clarify, are you summing the dice? Or is it roll until you hit 95+ or 5 dice are rolled whichever comes first?
$[[0.computed]] + $[[2.computed]] + $[[4.computed]] + $[[6.computed]] + $[[8.computed]] + [[ [[{[[ [[{[[ [[{[[ [[{[[1d100]],100}<94]]d100]],100}<94f=0]]d100]],100}<94f=0]]d100]],100}<94f=0]]d100]] This'll give you 5 rolls, returning 0 for all rolls after you roll 95 or above. If you want to sum them up, that can be done, but it's a little bit more complicated.
1738195581
Gauss
Forum Champion
Nice solution Tuo, I was working on something similar although I did not know about the f=0 option. 
Gauss said: Nice solution Tuo, I was working on something similar although I did not know about the f=0 option.  It's something I only learned very recently, too - somehow I had overlooked that particular argument for years. If the roll above 95 is discarded and we want to sum the rolls, we can actually do something a lot simpler: [[ [[{[[1d100!<94<94]],5}kl1]]d94]] This'll check how many rolls below 95 you make in a row, and rolls that many or 5 d94, whichever is lower.
1738247681

Edited 1738247768
Tuo said: $[[0.computed]] + $[[2.computed]] + $[[4.computed]] + $[[6.computed]] + $[[8.computed]] + [[ [[{[[ [[{[[ [[{[[ [[{[[1d100]],100}<94]]d100]],100}<94f=0]]d100]],100}<94f=0]]d100]],100}<94f=0]]d100]] This'll give you 5 rolls, returning 0 for all rolls after you roll 95 or above. If you want to sum them up, that can be done, but it's a little bit more complicated. No need to sum 'em up, I just need to stop the rolls once it reaches 95 or more, so it's good ! Wonderful work, perfect to understand what's happening ! In case you're wondering basically training are separated into morning and afternoon trainings, and each roll is an hour of training. when a crit fail happens, it's a simulation of getting stuck in a complicated formula or harming yourself by over-exercising so any subsequent roll for the rest of the 1/2 day are cancelled !