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

fumbles and variable exploding dice

We've been play testing a dice idea in person, and I'm uncertain how to realize the fumble mechanic in Roll20. We are using exploding polyhedrals, and the number of dice is variable. If you roll 2 dice and they both come up ones, or if you roll 3 or more dice and at least 3 come up ones, then it's a fumble. For example, if you're rolling d8!+2d6!+2d4!, and of the five dice, 3 come up ones, then it's a fumble. This seems tricky, and I don't know if the exploding dice make it even harder. I am uncertain how to do this in a macro.
1626064164
GiGs
Pro
Sheet Author
API Scripter
You cant do that without the API, a Pro subscriber perk. The basic dice mechanics can only look at values on a single die at a time - you can't check if two dice show 1s, or if 3 out of 5 dice show 1s.
1626092310
timmaugh
Forum Champion
API Scripter
If APIs are on the table, you can do this with a few metascripts. Plugger comes with a plug-in function getDiceByVal() which can a return a count of dice based on their value. With this you can get the number of dice that roll a 1. You can also get the total number of dice rolled by counting the dice that roll from 1 to the largest number they could roll (100 on a d100, for instance). This is helpful if the same macro could one time be rolled with 1d8 + 2d6 and another time be rolled with 1d8 + 1d6 and you don't know how many dice are rolled until the moment you use the macro (maybe you pick them with a dropdown). Now you just need one more piece of information: what is the threshold for each of the number of dice you are rolling. You said for 2 that threshold is 2, and for 3 or more it is 3. If that is the end of the step function, that isn't too much to handle in-line. If it starts to get to be a larger table, the Muler metascript provides a way to lookup data against a "mule" -- or table of variables. With all of the numbers you need, you have to be able to differentiate your output: do THIS if it is a failure/fumble; do THAT if it isn't. APILogic offers a way to compare the numbers we've now arrived at and include only parts of the command line based on the result. As a loose example, let's say you wanted to output a roll template filled with certain information if the character fumbled, but certain other roll information otherwise. IF OnesRolled is greater than or equal to the FumbleThreshold for this many dice, include this part of the command line: {{Fumble=@{selected|token_name} rolled OnesRolled 1s. Bad things happen.}} ELSE include this part of the command line: {{Result=@{selected|token_name} rolled $[[0]].}} Then it's just a matter of putting that into the right syntax pattern for APILogic to recognize, and sprinkling a little ZeroFrame template output over the whole thing. If scripts are on the table as a solution and you want the specific command to make the above work, post back.