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

Is there a trick to triggering action buttons from roll templates?

In a roll template, we can insert macros to trigger a roll button on a character sheet: <div style="display:none">     <button type="roll" name="roll_initiative" value="&{template:default}  {{initroll=[[1d10 &{tracker}]]}}"> </div> <rolltemplate class="sheet-rolltemplate-test">     [Roll Initiative](~selected|initiative) < /rolltemplate> However, I can't seem to find a way to trigger an action button on a character sheet, which would allow me to do sheetworker stuff with the roll. Any tricks or suggestions to make this work?
1667697488

Edited 1667697570
Oosh
Sheet Author
API Scripter
The syntax is the same as abilities, the same as what you have above for a button, or %{character|action_button_name} to call it directly. Calling an action button does consume the entire chat input though, so you can't nest it in a roll template - the action button will trigger, but the rest of the chat message will be lost. You can use Custom Roll Parsing and get rid of the roll button completely to keep all of your logic in Javascript instead of chat parser text. You can then call your functions directly instead of going via chat.
Thanks! Not sure why calling to an action button on a character sheet from a button on a roll template didn't seem to be working for me before, I just tried it again and it is indeed working as expected.