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

[Script Token Action Maker] Previously working token action buttons are now throwing error messages into chat

First, I've been successfully using the Token Action Maker  script for months; it's a real time and screen real estate saver when running combat encounters! I use the D&D 5e by Roll20 (2014) character sheet, and these are non-jumpgate games. During last night's session, when I tried using the token action buttons for an NPC that I had set up a long time ago, the action did not work but instead threw the following errors into the chat: I had created this NPC in another game and transmogrified it to the game in which we were playing about two weeks ago.  I ran into this issue a few weeks ago with a different NPC and fixed it by deleting then recreating the token actions. Now that it's happened again, I pulled up the game where I'd created this set of NPCs and found that they all had the same problem with their previously created token actions. All of these token actions did function correctly when I created them weeks ago. While writing this, I decided to go back and see if I could learn any more specifics about this problem and learned that all of the NPCs where this happens are the variations of the kobold NPC: Kobold (MM1), Kobold Dragonshield (MMoM), Kobold Scale Sorcerer (MMoM), Kobold Trapsmith (ToB), Kobold Skirmisher (MME1) and Winged Kobold (MM1). The error occurs with all token actions except the ones for ability checks, which work normally.
1725325011
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Rick! This issue extends back before I took stewardship of the script, and there is a built-in solution. The transmogrifier assigns a new character ID to any imported character. By default, TAM assigns character by id, rather than by name. This is done so that changing your character name from "Bob the Nebbish" to "Bob the Awesome" does not break your token actions. These two scenarios are, of course, incompatible. So, TAM gives you an optional way to assign actions in the buttons: !ta name  will create all token ability buttons and identify them by name, rather than character_id. This will generate token actions that will survive being moved from game to game, at the downside of breaking if you change the name.  If you want to keep the ID option, you can also quickly fix any imported token by running !deleteta , followed by !ta , or whatever command options you prefer to use for characters. Remember to protect any manually created token actions from deletion by putting a period at the end of the name!
1725325108
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Oh, and the reason that ability checks still function is that those are created by a hideously complicated formula at runtime, since Roll20 does not provide an easy way to call them from the sheet via a sheet action.
1725383785

Edited 1725384573
Hi Keith! Yep, and there it is right there in your documentation, too. <sigh> I was afraid that TAM using the character ID might be the case. For me, using !ta name  won't work in many cases because I use TokenNameNumber  for more powerful NPC/Monsters to whom I allow individual initiative rolls. I often design encounters in my "library" game if I don't plan on using them right away, and I keep NPC/Monsters that I'm not currently using in that library game to keep down the clutter in my live game. I'll need to adjust my practices to allow for the character ID issue. (And create a better organization system for all my customized NPC/Monsters; it looks like I'll be joining the throng that's demanding the ability to create Custom Compendiums !) Also, how hard would it be to create a way to designate that a token action whisper the results to the GM? Sometimes an NPC will have things listed under their Abilities, Reactions or other sections that I don't want visible to the players. Currently, I manually add "/w gm" or "?{whisper|no,|yes,/w gm} " to the start of the token action's definition.
1725399788
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Rick A. said: For me, using !ta name  won't work in many cases because I use TokenNameNumber  for more powerful NPC/Monsters to whom I allow individual initiative rolls. That shouldn't be an issue. Token Actions appear when you select a token, but they reference the character name, not the token name. Also, how hard would it be to create a way to designate that a token action whisper the results to the GM? Sometimes an NPC will have things listed under their  Abilities, Reactions  or other sections that I don't want visible to the players. Currently, I manually add "/w gm" or "?{whisper|no,|yes,/w gm} " to the start of the token action's definition. The visibility of the token action is controlled by the whisper settings of the character. If you want them whispered, make sure the character's output is set to whisper.
That shouldn't be an issue. Token Actions appear when you select a token, but they reference the character name, not the token name. Great! I was thinking token name for some reason. Character name make more sense. The visibility of the token action is controlled by the whisper settings of the character. If you want them whispered, make sure the character's output is set to whisper. I was thinking more about building the whisper into the token action like I manually do now. For instance having the output of a token acgion for an attacks go to the chat, but clicking on a token action for an ability to be whispered. Very often, I don't even open the NPC character at all if I've got token actions defined for it. It was just a thought. Now that I know about using the !ta name option I can make things work for me.
I’ll just throw a plug out for my  D&D 5E Statblock Macromule  as an alternative/backup if individual character token actions get messed up for any reason. Since you have a Pro subscription it makes the setup super easy with the included script. You could create the Statmule character and Collections macros and just uncheck the ‘Show as Token Action’ until it’s needed.  You’ll also get access to the EncounterMule, which could be useful for displaying all of your NPC’s and PC’s important stats as a group for combat situations. 
1725408825
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jarren's solution is a very polished one, especially for folks without Mod access. I used to use Universal Chat Menus for this sort of thing, but found that the chat got too busy for my brain to handle. And of course, reiterating, that any TAM issues that arise from Transmogrification can usually be resolved by regenerating them.
Thanks for mentioning the Stablock Macromule, jarren. I've seen it mentioned in the forum threads and considered it, but the chat area in our games tends to scroll and get cluttered pretty fast when we are doing a combat, especially with players always throwing full spell descriptions into it (Looking at my Bard  and Arcane Archer/Warlock players specifically).