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

Success/Fail indicators in Roll Template Equations with Multiple Dice

1430440125

Edited 1430440258
I'm a bit new to the forum, so forgive me if this topic may be in the wrong section. I’m having a bit of difficulty with the new roll templates. I’m attempting to find a way to get it to show a critical success/fail whenever two (or more) dice are involved in a roll. The border around the total result will turn red or green whenever one of the dice (not both of them) rolls their highest or lowest. Example: A PC has a unique statistic (we’ll pretend it’s simply named @{Stat},) that involves a dice, let’s say a d6. For good measure, we’ll also include a miscellaneous modifier (@{Mod}) with a static number, such as a +2. The roll is 1d20+@{Stat}+@{Mod} (or 1d20+1d6+2). So the highest possible roll, a critical success, would be a 28. The lowest would be a 4. Presently, the roll template is set up so whenever the result is a 19+1+2, the result will show a red box around a 22, instead of a red box around only a 4. Whenever a 2+6+2 is rolled, a green box appears around the resulting 10 instead of only around the 28. I’m certain I’m missing something, either an extra line of code or some CSS trick that I could implement to have the desired result from the success/fail indicator. It's also possible that I may have missed another forum post with the solution I'm seeking (in which case, I apologize if I'm repeating a topic.) Any ideas? Do I need to clarify something?
1430440784

Edited 1430441075
Wes
Pro
Sheet Author
I don't believe that the Templates have the ability to check both dice. You should be able to achieve the outcome you are looking for with nested inline rolls, I believe that the first roll is considered just a number after the roll has happened. so [[1d20+[[@{stat}]]+2]] where @{stat} is a 1d6, Will return a Critical Success or Fail only on the 1d20 roll. Edit: There I go misreading your original wanted outcome again.... Sorry I gave a solution for only having the roll show fail success on the 1d20 not both the d20 and d6 combined.
Wes: No problem. I understand this may be an unusual question. As amazing as Roll20 is, there's still limits on what can immediately be done with programming.
it's not an absolutely perfect solution... but it's probably the closest we can get with the tools roll20 has atm... [[1+1d(19+@{stat})+2]] where stat would be simply 6 instead of d6 with this method... this will result in a red outline on a 4 and a green outline on a 28 and all others show no outline... It's not 100% accurate though since a roll with 2 die makes certain totals more common than others making this something that should really use a weighted roll table to accomplish... but to my knowledge there are no crit/fail parameters for roll tables.