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

Shadowrun 6e dice roll macro w/ glitch detection

Hi all, I have a friend who is GMing a Shadowrun 6e and got me thinking about how to create a button for a dice roll with glitch detection. Pretty much, this means that if more than half of the dice rolled = 1, then that's a glitch (critical fail). If more than half of the dice rolled = 1 and none of the dice rolled hit AND there is a glitch, that's a critical glitch. I'm more focused on the first right now. How would I go about writing a macro that would do something like this? Essentially, I'd have the macro ask for the roller to enter X (the amount of dice to roll), allowing the macro to calculate half of X. But that's where things fall down. Is there a way to then calculate how many 1's are rolled, and if that number is greater than X, then display the total and also display the word "GLITCH!" Example: User has 10 dice to roll and enters 10 when the macro asks for number of dice to roll Dice rolls = 1,1,1,1,1,1,4,5,6,7 Macro displays: Roll total = 28 GLITCH! Is this possible?
1591149541
GiGs
Pro
Sheet Author
API Scripter
No, you cant do this. roll20 dice cant do conditional effects (if half of the dice roll x, do this), nor can they print text based on a special roll. The best you can do is sort the dice, so it makes it easier to count the 1s.
1591527754

Edited 1591590111
Oosh
Sheet Author
API Scripter
Hmmm.... you could get it to do this: Roll total = 28 GLITCH = 1 Displaying a 0 for no glitch, and a 1 for a glitch. That's the best I can think of. Is that any good? Edit - Okay, hit a snag and I give up. I can't do it. Glitch detection works, but there is no way of keeping the total. Here is the code: &{template:default}{{name=Glitch Detectoratorisor}}{{Glitch=[[abs( (ceil([[ ([[?{How many?|10} d4 kl[[floor([[?{How many?}/2]]+1)]] ]] - [[floor([[?{How many?}/2]]+1)]])/100 ]]))-1)]]}} {{Roll=?{How many?|10}d4, $[[2]] }} The only way I can think of doing the glitch detection is with a keep lowest roll.... but there is no way of keeping the total AND ditching the higher rolls that I can see. Is the total important? You can still mouse over the bottom right number and see what all the individual rolls were, but the total is lost as soon as you use the keep lowest operator, if you try to [[ ]] grab it with brackets, you lose the individual rolls and the KL fails. Someone else might be able to finish it off.... or it might be impossible! (Impossible to code for any number of dice... you could do a Wibble-inducing level of Query nesting for a certain number of dice) By the way, I just used d4 at a guess. I see from your example numbers it's a higher die type... just change the bold bit in the code if you want to play with it. Seriously though what are the odds of getting a glitch if that's a d10 or higher? They must be tiny. edit - AnyDice says 0.01% chance of a glitch with a 10d10 roll.... am I misunderstanding the rule?