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

Roll Template problem

I'm having a stab at a roll template in my custom sheet by copying the WOD example  here  and swapping in my sheet's elements, but it's not working exactly right.   Everything is as it should be except that the {{result=1}}  at the bottom shouldn't be there - instead it should simply be a 1 (or whatever the result) before the word 'Successes'. Here's the html: <button type="roll" value=" &{template:wod} {{name=@{character_name}}} {{roll_name=Resources}} {{result=[[([[{[[@{res}+?{Bonus dice (Equipment/Teamwork/Misc)|0}]],1}kh1]])d6>6]]}} " name="roll_resCheck"></button> <rolltemplate class="sheet-rolltemplate-wod">     <table>         <tr><th>{{name}} rolls{{#roll_name}} {{roll_name}}{{/roll_name}}</th></tr>         <tr>             <td class="result">{{result}} Successes</td>                 </tr>     </table> </rolltemplate> Can anyone see where I've gone wrong?
1599153251
Kavini
Roll20 Production Team
Marketplace Creator
Sheet Author
Compendium Curator
Just a guess, but I anticipate it's because your roll button has the value broken into several lines and that is being parsed as two separate rolls. Try putting the value all on one line.
Yep, that's it! I'm such a noob I didn't even know line breaks could affect html Thank you so much!!
1599186744
GiGs
Pro
Sheet Author
API Scripter
Linebreaks usually dont affect html, but in this case, your linebreaks are inside the button value quotes. A button value is basically a macro: its the text sent to chat, and roll20 macros do support linebreaks, so it keeps them.