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

Buttons in ScriptCards that call token-mod

I'm trying to set up a Script Card that will allow my player to click a button of their chosen wild shape. Each button would then call token-mod to set the image and the bar3 values for the temp hp. The call to token-mod works,&nbsp; !token-mod --ids @{selected|token_id} --set bar3_value|9 bar3_max|9 imgsrc|<a href="https://files.d20.io/images/487699892/bFmr171ysWH_xOAuVeUTbg/original.webp?1779290228" rel="nofollow">https://files.d20.io/images/487699892/bFmr171ysWH_xOAuVeUTbg/original.webp?1779290228</a> The scriptcard call provides the button but the button doesn't do anything.&nbsp; !scriptcard {{ --#title|Wild Shape --#titleCardBackground|#002200 --#oddRowBackground|#a5e6b6 --#sourceToken|@{selected|token_id} --#leftsub|Druid Level: [*S:c-base_level] --#emoteState|invisible --=temp-hp|3 * [*S:c-base_level] --+|HP:[*S:c-hp] --+|Temp HP:[$temp-hp.Total] --+|[button]Spider::!token-mod \-\-ids [*S:c-token_id] \-\-set bar3_value|[$temp-hp] bar3_max|[$temp-hp] imgsrc|<a href="https://files.d20.io/images/487699892/bFmr171ysWH_xOAuVeUTbg/original.webp?1779290228[/button]" rel="nofollow">https://files.d20.io/images/487699892/bFmr171ysWH_xOAuVeUTbg/original.webp?1779290228[/button]</a> }} Is it possible to do this? Or, is there a better way? I can get ScriptCards to run the token-mod script using the inline version but would like to present the player with a button menu to select from. Any help is appreciated.
1779308571
Andrew R.
Pro
Sheet Author
You can do it, but you use ScriptCards' Call API Script (--@) statement, not the '!' prefix. Read the wiki page for details, but your script line might read: --+|[button]Spider::@token-mod _ids [*S:c-token_id] _set bar3_value|[$temp-hp] bar3_max|[$temp-hp] imgsrc|<a href="https://files.d20.io/images/487699892/bFmr171ysWH_xOAuVeUTbg/original.webp?1779290228[/button]" rel="nofollow">https://files.d20.io/images/487699892/bFmr171ysWH_xOAuVeUTbg/original.webp?1779290228[/button]</a>
I found my solution by using the reentrant portion.&nbsp;