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

Dice result helper function don't work

1678965768

Edited 1679005718
Hello, I have make a rolltemplate and the helpers functions don't work in this template but work in an other. Anyone have ideas why ? < rolltemplate class = "sheet-rolltemplate-degats" >     < table >         {{ #perso }}             < td class= "name" >< b > {{ perso }} </ b ></ td ></ tr >             < tr >< td class= "famname" >< b > {{ familier }} </ b ></ td ></ tr >             < tr >< td >< hr / ></ td ></ tr >         {{ /perso }}             < tr >< th > {{ name }} </ th ></ tr >         {{ #RollDegats }}             < tr >                 < td class= "tcat" > Dégats : {{ RollDegats }} </ td >             </ tr >         {{ /RollDegats }}         {{ #Roll }}             < tr >                 < td class= "tcat" > Effet : {{ effet }} </ td >             </ tr >             < tr >                 < td class= "tcat" > Chance : {{ pourcentage }} % </ td >             </ tr >             < tr >                 < td class= "tcat" > Jet : {{ Roll }} </ td >             </ tr >             < br >             < tr >             {{ #rollGreater () Roll pourcentage }}                 < td class= "diceresult" style= "color:red; font-size: large;" > Non ! </ td >             {{ /rollGreater () Roll pourcentage }}             {{ #rollLess () Roll pourcentage }}                 < td class= "diceresult" style= "color:green; font-size: large;" > Oui </ td >             {{ /rollLess () Roll pourcentage }}             </ tr >         {{ /Roll }}         {{ #RollTour }}             < tr >                 < td class= "tcat" > Nb tour : {{ RollTour }} </ td >             </ tr >         {{ /RollTour }}     </ table > </ rolltemplate > The result
1678977411
David
Sheet Author
Post the value of the roll button
1678978515

Edited 1678978548
David said: Post the value of the roll button < button   type = "roll" style = " margin-left:0px;line-height:10px;height:20px;margin-bottom:2px;" title = "Combat corps à corps" name = "roll_Melee" value = "&{template:degats} {{perso=@{Name } }} {{name=@{ArmeNom } }} {{RollDegats=[[@{ArmeDegNv}d10+@{ArmeDegModNv}]]}} {{Roll=[[1d100]]}} {{effet=@{Effet } }} {{pourcentage=@{Pourcentage } }} {{RollTour=[[1d@{NbTour}]]}}" ></ button >
1678999619

Edited 1679000083
GiGs
Pro
Sheet Author
API Scripter
Helper functions can only read inline rolls. You have {{pourcentage=@{Pourcentage } }} I'm not sure why you have a html entity there - I would expect that to fail anyway. But you'd need to enclose it in a set of inline roll brackets [[ ]] to be recognised by your helper functions. This is what I'd expect to see there: {{pourcentage=[[@{Pourcentage}]] }}
1679003088

Edited 1679003108
Thanks GiGs, it works. I have html entity there because Roll20 fail the roll if I have three brackets. It works with html entities, so I use that.
1679005642
GiGs
Pro
Sheet Author
API Scripter
Try putting a space between then, also the inline roll brackets insert ] between the } brackets.
GiGs said: Try putting a space between then, also the inline roll brackets insert ] between the } brackets. I will try this.