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

[Rogue Trader] Need Help Creating a Roll Template w/ Logic

So I've been working on a roll table and it's coming along, until I tried adding some logic. I have an issue I'm struggling to solve though. I want to be able to check the dice result of an inline roll, and if the dice result is above 95, display a hidden section. Game-wise I'm trying to add a section that appears in the template to display if a weapon jams. The code looks like this: <rolltemplate class="sheet-rolltemplate-rt_attack"> <table> <tr><th>{{name}}</th></tr> <tr><td>{{roll}}{{#rollGreater() roll 95}}<span class="tcat">{{jam}}</span>{{/rollGreater() roll 95}}</span></td></tr> <tr><td>{{text}}</td></tr> </table> </rolltemplate> Which outputs like so  But when I implement the actual code of the attack macro, which checks for levels of success, I get this: Even though the dice result is above 95, it doesn't matter, as the  rollGreater  function is checking the total for the result. It won't be possible to have  rollGreater  check for the correct degree of success either, as this will be different once modifiers are included. Is there something I can do to only check for the dice result? Is there a way of setting what dice results trigger  rollWasCrit  and  rollWasFumble ? Or would it be possible with some wizardry to have the dice be rolled in a hidden inline roll and have it referenced for the macro? Thanks!
1565300233

Edited 1565300316
Finderski
Pro
Sheet Author
Compendium Curator
Look at this wiki . I think you're going to want rollWasCrit() Sorry...multi-tasking (on a conference call), I believe rollWasCrit uses the Max roll and Fumble as a 1, but I could be wrong on that.  There are also dice modifiers that can change the crit range.
1565308421

Edited 1565308625
Wes
Sheet Author
You can achieve what you are looking for by setting the critical success point on your die. Then the roll template logic will kick in and show the section for a critical success (or in your case a failure). Where the roll named "roll": [[ ( a + b + c + d - ( 1d100 cs>95 )) / 10 ]] is called in this roll template: <rolltemplate class="sheet-rolltemplate-rt_attack"> <table> <tr><th>{{name}}</th></tr>         <tr><td>             {{#roll}}                 {{roll}}             {{/roll}}         </td></tr> {{#rollWasCrit() roll 95}}     <tr><td>                 <span class="tcat">{{jam}}</span>             </td></tr>         {{/rollWasCrit() roll 95}} <tr><td>{{text}}</td></tr> </table> </rolltemplate> I reformatted the html for easier reading. Note that you can use {{#property}} & {{/property}} to only show that section if it contains a value. I mention it because if you see the rollWasCrit section, I placed the entire row of the table inside so that it only shows up when there is a critical. Wes
Thanks guys, using rollWasCrit combined with the cs>96  dice modifier I've got what I wanted to achieve!