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

Is is possible to rename token action macros based on selected token?

5e OGL sheet. I have the "easy" token action macros set up to do NPC actions for the selected token, eg: %{selected|repeating_npcaction_$0_npc_action} %{selected|repeating_npcaction_$1_npc_action} But the action buttons shown onscreen simply have the plain macro names I gave them, like "Attack 1".  It would be neat if, when a token was selected, the API could rename the token action buttons to reflect the name of the attack.  So the generic "Attack 1" button would change to "Claw" and "Attack 2" would change to "Bite", or whatever.  That would help me recall what each one was before I clicked it, make my DM turns and combat go a tiny bit faster, and it would be cool overall. Possible?
You could do this by moving these macros to the Character Abilities section for each NPC. Then you would rename them there. If  this is possible through the API, it would be extremely resource intensive I imagine because you would be switching selected tokens quite frequently.
After posting this, I saw this thread on a script that creates token actions (but apparently the script might be out-of-date).&nbsp;&nbsp; <a href="https://app.roll20.net/forum/post/6644328/5e-ogl-script-for-token-actions" rel="nofollow">https://app.roll20.net/forum/post/6644328/5e-ogl-script-for-token-actions</a> Somewhere in all of this is probably a middle ground that might work.&nbsp; &nbsp;I can imagine global macros that act on the selected token to invoke saves and ability checks.&nbsp; And then similarly for attacks, if at the time of the attack it could prompt me by showing the name of the attack for the selected NPC (even if the button name didn't change ... perhaps in a confirmation pop-up of some kind it showed the attack name ... or perhaps one button for attack, and the pop-up lists the valid attacks from currently selected token?). The idea here is that then: 1. No need to create token actions embedded in each individual token 2. The "global" macros display - at some point - some context about the selected token to give some idea what the attack/action is. I'll need more time and javascript experience to play around and see if I could make it work, but I'm starting to think all the parts are there.