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

Need some help for Character Sheet's roll template

Hi, I've modified t he roll template from the roll20  character sheet  for Pathfinder and I can't get it to work the way I want.  The roll is pretty straightforward and consists of: 2 attack rolls confirmation roll (if an attack roll is a critical) damage and critical damage (if an attack roll is a critical) damage2 & damage3 (extra damage type) I run into two issues: If only  the second attack roll is a critical, the confirmation roll is shown but not the critical damage If both attack rolls are a critical, two confirmation rolls are shown (always the same results) instead of only one I've tried numerous ways to make it work, but to no avail. I don't know if its possible, but if it is I'm sure some of you can point me in the right direction or offer an alternative. I know the css classes and styles are a mess but I'll clean this up later. Thanks a lot. Sebastien Here is the roll template code: < rolltemplate class = "sheet-rolltemplate-pc" >     {{#name}}         {{#rollTotal() showchar 1}}             < div class = "charname smallname bold" > {{charname}} </ div >         {{/rollTotal() showchar 1}}     {{/name}}     {{#smallname}}         < div class = "charname smallname bold" style = " line-height: 40px;" >             {{#rollTotal() showchar 1}}{{charname}} /{{/rollTotal() showchar 1}}             {{smallname}}         </ div >     {{/smallname}}     < div class = "bordered" >         {{#type}} < div class = "icon sheet-{{type}}" ></ div > {{/type}}         {{#name}}             < div class = "vtop" >                 < div class = "blacklabel top" >                     < span class = "big" > {{name}} </ span >                     {{#feattype}} < span class = "med" > ({{feattype}}) </ span > {{/feattype}}                     {{#abilitytype}} < span class = "med" > ({{abilitytype}}) </ span > {{/abilitytype}}                     {{#casterclass}} < span class = "med" > ({{casterclass}} </ span > {{#level}} < span class = "med" > {{level}} </ span > {{/level}} < span class = "med" > ) </ span > {{/casterclass}}                     < img class = "brdright" src = "..." />                 </ div >                 {{^roll1}}{{#roll}} < div class = "resright" > {{roll}} </ div >< div class = "resright" > {{roll2}} </ div > {{/roll}}{{/roll1}}             </ div >             {{^roll1}}                 {{#attack}}                     {{#rollWasCrit() roll}}                         < div class = "vtop" >                             < div class = "blacklabel long left" style = " background-color: #0e7505; height: 30px;" >                                 < img class = "brdright" style = " background-color: #0e7505; height: 30px;" src = "..." />                                 < span data-i18n = "confirm-crit" style = " line-height: 30px;" > Crit Confirm? </ span >                             </ div >                             < span style = " font-size: 1.2em; line-height: 30px;" > {{critconfirm}} </ span >                         </ div >                     {{/rollWasCrit() roll}}                     {{#rollWasCrit() roll2}}                         < div class = "vtop" >                             < div class = "blacklabel long left" style = " background-color: #0e7505; height: 30px;" >                                 < img class = "brdright" style = " background-color: #0e7505; height: 30px;" src = "..." />                                 < span data-i18n = "confirm-crit" style = " line-height: 30px;" > Crit Confirm? </ span >                             </ div >                             < span style = " font-size: 1.2em; line-height: 30px;" > {{critconfirm}} </ span >                         </ div >                     {{/rollWasCrit() roll2}}                 {{/attack}}             {{/roll1}}                     {{/name}}         {{#damage}}             {{#dmg1flag}}                 < div class = "flexdmg vtop" >                     < div class = "blacklabel med" style = " background-color: #7c0b0b; width: 123px; height: 30px;" >                         < span style = " text-align: center; font-size: 1.2em; line-height: 30px;" data-i18n = "damage" > Damage </ span >                         < img class = "brdright" style = " background-color: #7c0b0b; height: 30px;" src = "..." />                     </ div >                     < span style = " font-size: 1.2em;" >                     {{#rollGreater() dmg1 0}}{{dmg1}}{{/rollGreater() dmg1 0}}                     {{#rollLess() dmg1 1}}{{nonlethal}}{{/rollLess() dmg1 1}} </ span >                     {{#dmg1crit}}                         {{#roll}}{{#rollWasCrit() roll}} < span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" > t </ span > < span style = " font-size: 1.2em;" > {{dmg1crit}} </ span > {{/rollWasCrit() roll}}{{/roll}}                         {{^roll}} < span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" > t </ span > {{dmg1crit}}{{/roll}}                     {{/dmg1crit}}                     < span class = "notes inl" >   {{dmg1type}} </ span >                 </ div >             {{/dmg1flag}}             {{#dmg2flag}}                 < div class = "flexdmg" style = " padding-top: 1px;" >                     < div class = "blacklabel med" style = " background-color: #b81b1b; width: 115px;" >                         < span style = " text-transform: capitalize;" > {{dmg2name}} </ span >                         < img class = "brdright" style = " background-color: #b81b1b;" src = "..." />                     </ div >                     {{#rollGreater() dmg2 0}}{{dmg2}}{{/rollGreater() dmg2 0}}                     {{#rollLess() dmg2 1}}{{nonlethal}}{{/rollLess() dmg2 1}}                     < span class = "notes inl" >   {{dmg2type}} </ span >                 </ div >             {{/dmg2flag}}             {{#dmg3flag}}                 < div class = "flexdmg" >                     < div class = "blacklabel med" style = " background-color: #b81b1b; width: 115px;" >                         < span style = " text-transform: capitalize;" > {{dmg3name}} </ span >                         < img class = "brdright" style = " background-color: #b81b1b;" src = "..." />                     </ div >                     {{#rollGreater() dmg3 0}}{{dmg3}}{{/rollGreater() dmg3 0}}                     {{#rollLess() dmg3 1}}{{nonlethal}}{{/rollLess() dmg3 1}}                     < span class = "notes inl" >   {{dmg3type}} </ span >                 </ div >             {{/dmg3flag}}         {{/damage}} </ rolltemplate >
1688276144

Edited 1688283372
GiGs
Pro
Sheet Author
API Scripter
Here's the problem for your second question: {{#rollWasCrit() roll}}                         < div class = "vtop" >                             < div class = "blacklabel long left" style = " background-color: #0e7505; height: 30px;" >                                 < img class = "brdright" style = " background-color: #0e7505; height: 30px;" src = "..." />                                 < span data-i18n = "confirm-crit" style = " line-height: 30px;" > Crit Confirm? </ span >                             </ div >                             < span style = " font-size: 1.2em; line-height: 30px;" > {{critconfirm}} </ span >                         </ div >                     {{/rollWasCrit() roll}}                     {{#rollWasCrit() roll2}}                         < div class = "vtop" >                             < div class = "blacklabel long left" style = " background-color: #0e7505; height: 30px;" >                                 < img class = "brdright" style = " background-color: #0e7505; height: 30px;" src = "..." />                                 < span data-i18n = "confirm-crit" style = " line-height: 30px;" > Crit Confirm? </ span >                             </ div >                             < span style = " font-size: 1.2em; line-height: 30px;" > {{critconfirm}} </ span >                         </ div >                     {{/rollWasCrit() roll2}} You check those independently. You need to check one, then only if that is false, check the other. IIRC rolltemplates don't support AND / OR logic, so you need to fake it. For that second roll2, do something like: {{#^rollWasCrit() roll}} {{#rollWasCrit() roll2}}                         < div class = "vtop" >                             < div class = "blacklabel long left" style = " background-color: #0e7505; height: 30px;" >                                 < img class = "brdright" style = " background-color: #0e7505; height: 30px;" src = "..." />                                 < span data-i18n = "confirm-crit" style = " line-height: 30px;" > Crit Confirm? </ span >                             </ div >                             < span style = " font-size: 1.2em; line-height: 30px;" > {{critconfirm}} </ span >                         </ div >                     {{/rollWasCrit() roll2}} {{/^rollWasCrit() roll}} In other words, nest it inside another test, this time checking that roll1 was NOT a critical (that's what the ^ is for). Alternatively, you could build this into the original roll macro so you just have one check. But this should work well enough.
1688276313

Edited 1688276324
GiGs
Pro
Sheet Author
API Scripter
I don't follow the rolltemplate well enough to answer the first question. An example of a typical roll would help.
1688278650

Edited 1688278806
Here is the complete roll. I've cut short a lot in the code presented above since all the sections past damage work as intended. I'm going to bed, I will test your solution tomorrow, but at first glance it looks great. My logic was terrible. @{Isoack Kruwhoirk|whispertype} &{template:pc} {{name=Hammer +1}} {{type=attackdamage}} {{showchar=@{Isoack Kruwhoirk|rollshowchar}}} {{charname=@{Isoack Kruwhoirk|character_name}}} {{nonlethal=[[1[Nonlethal]]]}} {{attack=1}}{{roll=[[1d20cs>15 +10[BAB] +2[DEX] +5[MOD] +6[SPECIAL] -3[PA] +@{Isoack Kruwhoirk|rollmod_attack}[QUERY] ]]}} {{critconfirm=[[1d20cs20 +10[BAB] +2[DEX] +5[MOD] +6[SPECIAL] -3[PA] +@{Isoack Kruwhoirk|rollmod_attack}[QUERY] +@{Isoack Kruwhoirk|critconfirm_bonus}[CRIT CONFIRM BONUS] ]]}} {{roll2=[[1d20cs>15 +10[BAB] +2[DEX] +5[MOD] +6[SPECIAL] -3[PA] +@{Isoack Kruwhoirk|rollmod_attack}[QUERY] ]]}} {{critconfirm=[[1d20cs20 +10[BAB] +2[DEX] +5[MOD] +6[SPECIAL] -3[PA] +@{Isoack Kruwhoirk|rollmod_attack}[QUERY] +@{Isoack Kruwhoirk|critconfirm_bonus}[CRIT CONFIRM BONUS] ]]}}{{atkvs=(melee: BAB+DEX vs Touch)}}{{shownotes=[[1]]}}{{notes=}}{{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d6 +2[DEX] +7[MOD] +6[PA] +@{Isoack Kruwhoirk|rollmod_damage}[QUERY]]]}}{{dmg1type=slash}}{{dmg1crit=[[((2d6+2d6)+( +2[DEX] +7[MOD] +6[PA] +@{Isoack Kruwhoirk|rollmod_damage}[QUERY])*2)]]}}{{dmg2name=Sneak Attack}}{{damage=1}} {{dmg2flag=1}} {{dmg2=[[3d6]]}} {{dmg2type=precision}}{{dmg3name=Icy}}{{damage=1}} {{dmg3flag=1}} {{dmg3=[[1d6]]}} {{dmg3type=cold}} {{conditionsflag=[[@{Isoack Kruwhoirk|attack_condition}]]}} {{conditions=@{Isoack Kruwhoirk|conditions_display}}} {{conditionsnote=@{Isoack Kruwhoirk|attack_condition_note}@{Isoack Kruwhoirk|damage_condition_note}}}
1688283660
GiGs
Pro
Sheet Author
API Scripter
Is the problem in this section? {{#dmg1crit}}                         {{#roll}}{{#rollWasCrit() roll}}<span class="symbol" data-i18n-title="critical-damage" title="Critical damage">t</span> <span style="font-size: 1.2em;">{{dmg1crit}}</span>{{/rollWasCrit() roll}}{{/roll}}                         {{^roll}}<span class="symbol" data-i18n-title="critical-damage" title="Critical damage">t</span> {{dmg1crit}}{{/roll}}                     {{/dmg1crit}} It looks like are are only checking if roll1 was a critical there, there's no check for roll2.
I've tried a couple of times but I always end up with an error while rendering the roll template. My lack of understanding of the roll template seems to be in the way. Here is my code. Added lines are preceded by "****". I've added a similar "fake if" as mentioned earlier but my tags might be incorrect. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#dmg1flag}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; div class = "flexdmg vtop" &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; div class = "blacklabel med" style = " background-color: #7c0b0b; width: 123px; height: 30px;" &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; span style = " text-align: center; font-size: 1.2em; line-height: 30px;" data-i18n = "damage" &gt; Damage &lt;/ span &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; img class = "brdright" style = " background-color: #7c0b0b; height: 30px;" src = "<a href="https://s3.amazonaws.com/files.d20.io/images/294499297/V_XBr7CHyk-cJ4YsnRbv2g/thumb.png?16578364235" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/294499297/V_XBr7CHyk-cJ4YsnRbv2g/thumb.png?16578364235</a>" /&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ div &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; span style = " font-size: 1.2em;" &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#rollGreater() dmg1 0}}{{dmg1}}{{/rollGreater() dmg1 0}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#rollLess() dmg1 1}}{{nonlethal}}{{/rollLess() dmg1 1}} &lt;/ span &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#dmg1crit}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#roll}}{{#rollWasCrit() roll}} &lt; span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" &gt; t &lt;/ span &gt; &lt; span style = " font-size: 1.2em;" &gt; {{dmg1crit}} &lt;/ span &gt; {{/rollWasCrit() roll}}{{/roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{^roll}} &lt; span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" &gt; t &lt;/ span &gt; {{dmg1crit}}{{/roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/dmg1crit}} ****&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#^rollWasCrit() roll}} **** &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{dmg2crit}} ****&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#roll}}{{#rollWasCrit() roll2}} &lt; span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" &gt; t &lt;/ span &gt; &lt; span style = " font-size: 1.2em;" &gt; {{dmg2crit}} &lt;/ span &gt; {{/rollWasCrit() roll2}}{{/roll}} ****&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{^roll}} &lt; span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" &gt; t &lt;/ span &gt; {{dmg2crit}}{{/roll}} ****&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/dmg2crit}} ****&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/^rollWasCrit() roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; span class = "notes inl" &gt; &amp;nbsp; {{dmg1type}} &lt;/ span &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ div &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/dmg1flag}} Thanks a lot for your help
Here is an example of the complete call to the roll template if it helps. @{whispertype} &amp;{template:pc} {{smallname=Hammer +1}} {{type=damage}} {{showchar=@{rollshowchar}}} {{charname=@{character_name}}} {{nonlethal=[[1[Nonlethal]]]}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d6 +3[DEX] +7[MOD] +9[PA] +@{rollmod_damage}[QUERY]]]}} {{dmg1type=slash}}{{dmg1crit=[[((2d6+2d6)+( +3[DEX] +7[MOD] +9[PA] +@{rollmod_damage}[QUERY])*2)]]}}{{dmg2name=Sneak Attack}}{{damage=1}} {{dmg2flag=1}} {{dmg2=[[3d6]]}} {{dmg2type=precision}}{{dmg3ame=Icy}}{{damage=1}} {{dmg3flag=1}} {{dmg3=[[1d6]]}} {{dmg3type=cold}} {{conditionsnote= @{damage_condition_note}}}
1688315655

Edited 1688315695
GiGs
Pro
Sheet Author
API Scripter
I don't have time to look right now, but this leaps out at me: {{damage=1}} {{dmg1flag=1}} If they are meant to be read by a rolltemplate, they need to be inline rolls, like this {{damage=[[1]]}} {{dmg1flag=[[1]]}} Rolltemplates interpret everything as text unless its an inline roll, and logic helpers don't work with text. I don't know if your code relies on them being read by the rolltemplate, but thought I should mention it just in case. There are others like that in the roll - I'm just using those 2 as examples).
Finally got it to work, thanks for your pointers, been stuck on that for longer than I care to admit.&nbsp; My solution, and it seems so simple... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#dmg1crit}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#rollWasCrit() roll}} &lt; span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" &gt; t &lt;/ span &gt; &lt; span style = " font-size: 1.2em;" &gt; {{dmg1crit}} &lt;/ span &gt; {{/rollWasCrit() roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#^rollWasCrit() roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#rollWasCrit() roll2}} &lt; span class = "symbol" data-i18n-title = "critical-damage" title = "Critical damage" &gt; t &lt;/ span &gt; &lt; span style = " font-size: 1.2em;" &gt; {{dmg1crit}} &lt;/ span &gt; {{/rollWasCrit() roll2}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/^rollWasCrit() roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/roll}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/dmg1crit}}
1688361613
GiGs
Pro
Sheet Author
API Scripter
TheRollinOne said: Finally got it to work, thanks for your pointers, been stuck on that for longer than I care to admit.&nbsp; I'm glad you got it working. And yes. these frustrating issues can taker aaaages.