
<rolltemplate class="sheet-rolltemplate-stat"> <h2 class="sheet-caption">{{name}}</h2> {{#SoZ}} <h3 class='sheet-caption'>Stat of Zero</h3> <div class="sheet-result"> <div class='sheet-BonusPenalty'> Stat of Zero: </div> <div class='sheet-BPTot'> {{SoZRoll}} </div> <!--</div>--> {{/SoZ}} {{^SoZ}} <h3 class='sheet-caption'>{{stat}}{{#skill}} {{skill}}{{#specialization}} {{specialization}}{{/specialization}}{{/skill}}</h3> <div class="sheet-result"> <div class='sheet-dieRoll1'> {{#rollTotal() r1 1}} a<span class='sheet-trueRoll'>{{r1}}</span> {{/rollTotal() r1 1}} {{#rollTotal() r1 2}} b<span class='sheet-trueRoll'>{{r1}}</span> {{/rollTotal() r1 2}} {{#rollTotal() r1 3}} c<span class='sheet-trueRoll'>{{r1}}</span> {{/rollTotal() r1 3}} {{#rollTotal() r1 4}} d<span class='sheet-trueRoll'>{{r1}}</span> {{/rollTotal() r1 4}} {{#rollTotal() r1 5}} e<span class='sheet-trueRoll'>{{r1}}</span> {{/rollTotal() r1 5}} {{#rollTotal() r1 6}} f<span class='sheet-trueRoll'>{{r1}}</span> {{/rollTotal() r1 6}} </div> <div class='sheet-dieRoll2'> {{#rollTotal() r2 1}} a<span class='sheet-trueRoll'>{{r2}}</span> {{/rollTotal() r2 1}} {{#rollTotal() r2 2}} b<span class='sheet-trueRoll'>{{r2}}</span> {{/rollTotal() r2 2}} {{#rollTotal() r2 3}} c<span class='sheet-trueRoll'>{{r2}}</span> {{/rollTotal() r2 3}} {{#rollTotal() r2 4}} d<span class='sheet-trueRoll'>{{r2}}</span> {{/rollTotal() r2 4}} {{#rollTotal() r2 5}} e<span class='sheet-trueRoll'>{{r2}}</span> {{/rollTotal() r2 5}} {{#rollTotal() r2 6}} f<span class='sheet-trueRoll'>{{r2}}</span> {{/rollTotal() r2 6}} </div> </div> {{/^SoZ}} </rolltemplate>and here's a snippet of the CSS:
/* Stat Roll Template */ .sheet-rolltemplate-stat h2.sheet-caption { text-align: center; color: white; background-color: black; border-radius: 15px; font-size: 1.125em; font-weight: bold; margin: 5px; margin-bottom: 0px; } .sheet-rolltemplate-stat h3.sheet-caption { text-align: center; color: black; background-color: black; border-radius: 15px; font-size: 1.125em; font-weight: bold; font-family: "Patrick Hand"; margin: 5px; border: 1px solid #a8393f; background-color: #f7dadb; margin-bottom: 0px; } .sheet-rolltemplate-stat h4 { text-align: center; margin-bottom: 5px; } .sheet-rolltemplate-stat div.sheet-result { display: block; padding: 5px; border-radius: 15px; border: solid 1px black; text-align: center; margin-bottom: 5px; background-color: white; } .sheet-rolltemplate-stat .sheet-dieRoll1, .sheet-rolltemplate-stat .sheet-dieRoll2, .sheet-rolltemplate-stat .sheet-dieRoll3, .sheet-rolltemplate-stat .sheet-dieRoll4 { display: inline-block; width: 25%; padding: 5px; text-align: center; font-family: "dicefontd6"; font-size: 3em; z-index: 0; } .sheet-rolltemplate-stat .sheet-dieRoll1, .sheet-rolltemplate-stat .sheet-dieRoll3 { border-right: 1px solid black; } .sheet-rolltemplate-stat .sheet-dieRoll2, .sheet-rolltemplate-stat .sheet-dieRoll4 { border-left: 1px solid black; margin-left: -5px; }And here's the output
{{r1=[[1d6]]}} {{r2=[[1d6]]}}Then, the roll template can evaluate r1, and if it matches 1, then I display the letter 'a' using the font "dicefontd6." I have to do that evaluation for every number on the die. So, if you were using d10s, then you'd have to check r1 to see if it equals 1, see if it equals 2, ..., see if it equals 10. The letter would change depending on which die face you want to show. The special function #rollTotal() is what you use to evaluate the die roll.
<button type='roll' value="&{template:test1} {{charname=@{character_name}}} {{attack=[[1d10]]}} {{armor=[[1d4]]}}" name="roll_test1"></button>and the rolltemplate
<rolltemplate class="sheet-rolltemplate-test1"> <table> <tr><th colspan="2" style="background: #4F2A1B;">{{charname}}</th></tr> <tr> <td class="tcat">Attack</td> <td>{{attack}}</td> </tr> <tr> <td class="tcat">Armor</td> <td>{{armor}}</td> </tr> <tr> <td class="tcat">Damage</td> <td>[["{{attack}}-{{armor}}"]]</td> </tr> </table> </rolltemplate>
No, but if the range of possible values is small enough, you could essentially do the same thing as Finderski's dice; "Attack was 5 and armor was 2, so display 3".Tomaxx said:
In Blue Planet they roll 1, 2, or 3 d10, so worst case its doable.
I have a question: is it possible to make math operations like additions or subtractions inside a rolltemplate?
Thanks Brian.Brian said:
No, but if the range of possible values is small enough, you could essentially do the same thing as Finderski's dice; "Attack was 5 and armor was 2, so display 3".
{{r1=[[1d10]]}} {{r2=[[1d10]]}} {{r3=[[1d10]]}} {{modifier=[[2]]}}Then, you'd evaluate each of the d10s, and display them however you want, have another row (perhaps) and display the modifier.
SkyCaptainXIII said:
It's doable in PowerCards if you want to include that script as a requirement for the character sheet.