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 .
×

[Custom CharacterSheet] Templating roll

Hi. (Sorry for my bad english, i'm french :-). I'm a developer. For one of my game, i need to create a roll template for my charactersheet. So, i've look about "roll template" on the wiki, but after a few hours of works, it don't work... The code : <button class="sheet-text-button" title="test" type="roll" name="roll_STR-Check" value="&{template:customtest} {{name=JET}} {{jet=[[1d10]]}}"> FOR</button> <rolltemplate class="sheet-rolltemplate-customtest"> <table> <tr> <th>{{name}}</th> </tr> <tr> <td>{{roll}}</td> </tr> {{#rollLess() roll 5}} <tr> <td>Aucunes Blessures</td> </tr> {{/#rollLess() roll}} {{#rollBetween() roll 5 7}} <tr> <td>Légère Blessure</td> </tr> {{/#rollBetween() roll}} {{#rollBetween() roll 8 9}} <tr> <td>Blessure importante</td> </tr> {{/#rollBetween() roll}} {{#rollGreater() roll 9}} <tr> <td>Légère Blessure</td> </tr> {{/#rollGreater() roll}} </table> </rolltemplate> Objective : When the player click on the button, roll 1d10 and show a message depend of the result of the roll. But actually, when i click on the button, nothing happens and i don't know why. (The css is the same of the css wiki). I the same time, it's possible to customize the "success" textbox when you roll like : 3d6>3 ? Thank you for your help.
New version of the code : (more simple) <rolltemplate class="sheet-rolltemplate-damage"> <table> <tr> <th>DAMAGE</th> </tr> <tr> <td>{{roll}}</td> </tr> <tr> {{#rollLess() roll 5}} <td>No damage</td> {{/rollLess() roll}} </tr> </table> </rolltemplate> On the chat (or macro), i test that : &{template:damage} {{roll=[[1d10]]}} And... Nothing happens. More, the chat is bugged and i need to "clear chat history" and refresh the page. I really don't understand, apparently the command #rollLess() seems not to work but i don't know why. Thanks for your help.
1538411092
Finderski
Pro
Sheet Author
Compendium Curator
Your problem is this: {{jet=[[1d10]]}} You either need to change jet to roll, or in the roll template replace roll with jet (except for the rollers type stuff).
Thanks to you. I've already seen this mistake but it still don't work. Look my second message, the problem is solve but still don't work. Thanks again.
1538413273
Jakob
Sheet Author
API Scripter
This is your problem (one of them, anyway): {{#rollLess() roll 5}} <td>No damage</td> {{/rollLess() roll}} Your closing conditional is not equal to the opening one, you should have {{/rollLess() roll 5}}
Indeed. It perfectly works. Thanks a lot.