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

Penetrating Dice and Rolling a 1 Recognition

1591224632
Eli N.
Pro
Compendium Curator
So in hackmaster, when you roll the max value on a dice, you get to roll another dice and subtract 1 from that value. In Roll20 this is done with a 1d20!p. So I worked on a roll recognition that would identify if you rolled a 1, 20 or 19. And it would tell you fumble, critical, near-perfect.  One of my companions came up with this solution. Using 1d20cs>19cf1cf19 and the following code  {{#def_roll}} <tr><td><span class="tcat">Defense Roll: </span>{{def_roll}}</td></tr> {{#rollWasCrit() def_roll}}{{#^rollWasFumble() def_roll}} <tr><td><span class="tcat">Perfect Defense!</span></td></tr> {{/^rollWasFumble() def_roll}}{{/rollWasCrit() def_roll}} {{#rollWasCrit() def_roll}}{{#rollWasFumble() def_roll}} <tr><td><span class="tcat">Near-Perfect Defense!</span></td></tr> {{/rollWasFumble() def_roll}}{{/rollWasCrit() def_roll}} {{#rollWasFumble() def_roll}}{{#^rollWasCrit() def_roll}} <tr><td><span class="tcat">Fumble! (Automatic Fatigue Gain)</span></td></tr> {{/^rollWasCrit() def_roll}}{{/rollWasFumble() def_roll}} It works perfectly for the d20. However Hackmaster uses multiple dice for defense. If I roll a d12 in this template, it will give me a perfect result on a natural 12, a fumble on a 1 and a near-perfect if I roll a 12 and then the penetrating dice rolls a 1.  If I use 1d12!pcs>19cf1cf19 then it never shows a perfect or near perfect but it shows a 1 if I roll a 1 or a 12 and then a 1. Ideally I just want it to show a fumble on a 1, and a near-perfect on exactly a 19 (sum of 12+7), and a perfect on exactly a 20 (sum of 12+8). Is there anyway to do this? 
1591224805
Eli N.
Pro
Compendium Curator
Would it be possible to change it to  {{#^rollGreater() def_roll critvalue}} <tr><td><span class="tcat">Perfect Defense!</span></td></tr> {{/^rollGreater() def_roll critvalue}} with the value of critvalue being 20+defense modifications.  Also is there a  /^rollEqual()
1591226032
GiGs
Pro
Sheet Author
API Scripter
#rollTotal() is what you need for rolling equal, and #^RollTotal()  for not equal. Yes, rollGreater() and rollTotal() sound like what you need here. That second post looks right, based on what i can gather of your needs from your first post.
1591237120

Edited 1591237390
Eli N.
Pro
Compendium Curator
Is there a way to do equal to or greater? I tried this              {{#^rollGreater() def_roll perf}}                 <tr><td><span class="tcat">Perfect Defense!</span></td></tr>             {{/^rollGreater() def_roll perf}}                          {{#rollTotal() def_roll perf}}                 <tr><td><span class="tcat">Perfect Defense!</span></td></tr>             {{/rollTotal() def_roll perf}} And it said perfect defense on every roll             {{#^rollGreater() perf def_roll}}                 <tr><td><span class="tcat">Perfect Defense!</span></td></tr>             {{/^rollGreater() perf def_roll}}                          {{#rollTotal() def_roll perf}}                 <tr><td><span class="tcat">Perfect Defense!</span></td></tr>             {{/rollTotal() def_roll perf}} When I did this it fixed that problem, but on results that should have been a critical (def_roll > perf) it said nothing 
1591239623
GiGs
Pro
Sheet Author
API Scripter
Doing Equal or Greater is a bit counterintuitive. {{#^rollLess() means NOT Less Than, in others words, Equal or Greater. So you dont need two rollGreater and rollTotal. This should do the trick:             {{#^rollLess() def_roll perf}}                 <tr><td><span class="tcat">Perfect Defense!</span></td></tr>             {{/^rollLess() def_roll perf}} But you said earlier there was a difference between rolls of 19 and 20+. If you want to represent that with absolute numbers, you need to do it differently.             {{#rollGreater() def_roll 19}}                 <tr><td><span class="tcat">Perfect Defense!</span></td></tr>             {{/rollGreater() def_roll 19}}                          {{#rollTotal() def_roll 19}}                 <tr><td><span class="tcat">Near Perfect Defense!</span></td></tr>             {{/rollTotal() def_roll 19}} You earlier said "with the value of critvalue being 20+defense modifications." If that's needed, you would actually make critvalue =   19+defense modifications. then you can use             {{#rollGreater() def_roll crit}}                 <tr><td><span class="tcat">Perfect Defense!</span></td></tr>             {{/rollGreater() def_roll crit}}                          {{#rollTotal() def_roll crit}}                 <tr><td><span class="tcat">Near Perfect Defense!</span></td></tr>             {{/rollTotal() def_roll crit}}