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

Button in rolltemplate for Custom Roll Parsing

1696783512
Jiboux
Pro
Sheet Author
Compendium Curator
Hello all, I have up to now not developped anything regarding rolltemplate, chat menus, or macros, so I am still a bit struggling understanding the syntax... My ultimate goal is to transfer from API to the sheetworker a feature that on change of the rank of a certain ability sends a chat proposing to the player to record the expense of LP (Earthdawn equivalent of XP) For now, I am tinkering with the example given on the Wiki where there is an actual roll, triggered by an action button, and trying simply to add a "Reroll" button <a href="https://wiki.roll20.net/Button#Roll_Parsing" rel="nofollow">https://wiki.roll20.net/Button#Roll_Parsing</a> &lt;button type="action" name="act_test"&gt;Click me&lt;/button&gt; &lt;rolltemplate class="sheet-rolltemplate-test"&gt; &lt;div class="sheet-template-container"&gt; &lt;h1&gt;{{name}}&lt;/h1&gt; &lt;div class="sheet-results"&gt; &lt;h4&gt;Result = {{roll1}}&lt;/h4&gt; &lt;h4&gt;Custom Result = {{computed::roll1}}&lt;/h4&gt; &lt;h4&gt;Reroll [Click Here](~test)&lt;/h4&gt; &lt;!-- This is the Section I added hoping to trigger back act_test--&gt; &lt;/div&gt; &lt;/div&gt; &lt;/rolltemplate&gt; &lt;script type="text/worker"&gt; on('clicked:test', (info) =&gt; { startRoll("&amp;{template:test} {{name=Test}} {{roll1=[[1d20]]}} ", (results) =&gt; { const total = results.results.roll1.result const computed = total % 4; finishRoll( results.rollId, { roll1: computed, } ); }); }); &lt;/script&gt; But I keep getting the following. What do I have wrong with the button syntax ?
1696796441

Edited 1696796560
GiGs
Pro
Sheet Author
API Scripter
The picture you tried to post isn't showing up.&nbsp; Your syntax looks correct to me. What is happening? Also look here, at the Custom Roll Parsing section: <a href="https://cybersphere.me/roll20-sheet-author-master-list/" rel="nofollow">https://cybersphere.me/roll20-sheet-author-master-list/</a> There are more articles coming throughout this month - see if it helps.
1696796627
Jiboux
Pro
Sheet Author
Compendium Curator
Thanks, I was editing my message to give an update because I was making some slow progress with reading some posts, and some try and error... I may start a new post with my new auestions, but I will read what you sent first,
1696796874
Jiboux
Pro
Sheet Author
Compendium Curator
OK, I have sufficiently progressed compared to where I was when I started this thread so that I'll start a new thread that will be I think with more detailed questions.