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

Designing template problem rollBetween()

So I'm creating a few templates to my sheet and with it I like to add information if certain data is given to the template. <button type="roll" name="roll_StaminaRoll" class="sheet-d10-dice" value="&{template:attribute} {{description=Stamina}} {{healthNum=@{health}}} {{successDiff=[[?{Number successes needed|1}]]}} {{result=[[(@{staminaTotal} + @{health})d10>6 ]]}}">     Stamina </button> So my button sends in which health the sheet has at the moment but in the template even if the template gets that healthNum is in my test -2 it still doesn't trigger. I I have tried both rollLess and rollBetween and it refuses to work. Any ideas? <rolltemplate class="sheet-rolltemplate-attribute"> <div class="sheet-rolltemplate-chatbackground"> <div class="sheet-rolltemplate-chatheadline"> {{charactername}} rolling {{description}} {{healthNum}} </div> {{#rollBetween() healthNum -99 -1}} <div class="sheet-rolltemplate-message">Health penalty: {{healthNum}}</div> {{/rollBetween() healthNum -99 -1}} {{#rollBetween() successDiff 0 0}} <div class="sheet-rolltemplate-message">{{result}} Successes</div> {{/rollBetween() successDiff 0 0}}                 {{#rollGreater() successDiff 0}} <div class="sheet-rolltemplate-message">{{result}} Successes of {{successDiff}}</div> {{/rollGreater() successDiff 0}} {{#rollLess() result successDiff}} <img src="MissFail.png" class="sheet-rolltemplate-chatimage" /> {{/rollLess() result successDiff}} {{#rollBetween() result successDiff successDiff}} <img src="Success.png" class="sheet-rolltemplate-chatimage" /> {{/rollBetween() result successDiff successDiff}} </div> </rolltemplate>
1612549324
GiGs
Pro
Sheet Author
API Scripter
Rolltemplate logic only works with values that it can detect as a number, and that means you have to wrap it in inline roll brackets, like so: {{healthNum=[[@{health}]]}}
1612549429
Andreas J.
Forum Champion
Sheet Author
Translator
Have you tried to remove the linebreaks from the roll macro? I'm not sure it's a good idea to have them like that. <button type="roll" name="roll_StaminaRoll" class="sheet-d10-dice" value="&{template:attribute} {{description=Stamina}} {{healthNum=@{health}}}{{successDiff=[[?{Number successes needed|1}]]}}{{result=[[(@{staminaTotal} + @{health})d10>6 ]]}}">Stamina</button>
My error was that I didn't have the [[ ]] around the parameter as GiGs showed. The reason I had line breaks in my code was only so it would be easier to show it here on the forum. Thanks for the help :)