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

Failing at roll template helper function: rollGreater()

Okay, I am (apparently) following the wiki guidelines for setting up my own roll template and the rollGreater() helper function drives me nuts. So here's how it currently looks: If the damage value is above a certain value (0 to be excat) I want it to show the extra damage. Otherwise I don't want to show it. Here's my code:       {{#armyattack}}       <div class="sheet-row">          <div class="sheet-col-7-13 sheet-padl sheet-RollTemp-rollname">Overcoming DV</div>          <div class="sheet-col-6-13 sheet-padr sheet-RollTemp-rollresult">{{armyattack}}</div>       </div>   {{#armydamage}}       <div class="sheet-row">          <div class="sheet-col-7-13 sheet-padl sheet-padr sheet-RollTemp-rollname">Extra Damage </div>          <div class="sheet-col-6-13 sheet-padr sheet-RollTemp-rollresult">{{armydamage}}</div>       </div>       {{/armydamage}}       {{#rollGreater() armydamage 0}}       {{#armydamage}}       <div class="sheet-row">          <div class="sheet-col-7-13 sheet-padl sheet-padr sheet-RollTemp-rollname">Extra Damage </div>          <div class="sheet-col-6-13 sheet-padr sheet-RollTemp-rollresult">{{armydamage}}</div>       </div>       {{/armydamage}}       {{/#rollGreater() armydamage 0}}       {{/armyattack}} I've added the first occurrence of the extra damage to prove I am not mental and it actually can show the values. However, the second I add the rollGreater part and reload, my chat log goes crazy and the button will not work any longer. And this the button code: <button type='roll' style="font-family: 'Gloria Hallelujah', cursive; font-weight: bold; font-size: 16px;" name="Attack_@{ArmyName}" value="&{template:odnd} {{combat=1}} {{title=@{ArmyName}}} {{armyDamageTresh=0}} {{armyattack=[[ 1d20 + @{armyTotalACR}[Bonus] ]] }} {{armydamage=[[@{armyTacticsTotalDamage}+@{armyResourcesTotalDamage}+@{armyPowersTotalDamage}+@{armyConditionsTotalDamage}+@{armyBoonsTotalDamage}]]}}"></button> Any ideas?
1545344995
Finderski
Plus
Sheet Author
Compendium Curator
Can you show us what you mean by your "chat log goes crazy" and post the CSS for the roll template?
The chat showed some archived material from like 6 months ago or so, when the current character sheet wasn't in place. When remove the code in question I get to see the current chat logs. However, I think I have solved that. I have changed the code to        {{#armyattack}}       <div class="sheet-row">          <div class="sheet-col-7-13 sheet-padl sheet-RollTemp-rollname">Overcoming DV</div>          <div class="sheet-col-6-13 sheet-padr sheet-RollTemp-rollresult">{{armyattack}}</div>       </div>   {{#armydamage}}       <div class="sheet-row">          <div class="sheet-col-7-13 sheet-padl sheet-padr sheet-RollTemp-rollname">Extra Damage </div>          <div class="sheet-col-6-13 sheet-padr sheet-RollTemp-rollresult">{{armydamage}}</div>       </div>       {{/armydamage}}       {{#rollGreater() armydamage armyDamageTresh}}       <div class="sheet-row">          <div class="sheet-col-7-13 sheet-padl sheet-padr sheet-RollTemp-rollname">Extra Damage </div>          <div class="sheet-col-6-13 sheet-padr sheet-RollTemp-rollresult">{{armydamage}}</div>       </div>       {{/rollGreater() armydamage armyDamageTresh}}       {{/armyattack}} and the chat is okay now. However, rollGreater() still doesn't work. I only see the "extra damage" once despite having  armydamage >0.
1545348388

Edited 1545348405
Finderski
Plus
Sheet Author
Compendium Curator
Don't know why this would matter, but have you tried {{armyDamageTresh=[[1d0]]}} Perhaps it's evaluating the 0 as a string since it's coming in that way rather than being part of the actual roll template?
1545357438
GiGs
Pro
Sheet Author
API Scripter
I think just using  {{armyDamageTresh=[[0]]}} should be fine. Rolltemplates do treat anything not in inlinerolls as text, you need the double brackets to convert it to a number the rolltemplate can interpret.
GiGs said: I think just using  {{armyDamageTresh=[[0]]}} should be fine. Rolltemplates do treat anything not in inlinerolls as text, you need the double brackets to convert it to a number the rolltemplate can interpret. Yes, that was it. Thank you.
1545374419
GiGs
Pro
Sheet Author
API Scripter
You're welcome!