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

[Script] Token Action Maker 2.0 - Now Supports D&D Fifth Edition (5e & 5.5e) Beacon

1789971547

Edited 1791938661
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Now in One Click Install. Token Action Maker 2.0 is a full rewrite of the original Token Action Maker — but it now covers the Beacon-based D&D Fifth Edition (5e & 5.5e) sheet as well as the sheets it's always supported, and auto-detects which one it's looking at instead of needing to be told. This is an update to Token Action Maker. If you are using One Click to install scripts, you will not have to install anything new. What it does Select one or more tokens, run !ta , and it reads each token's character sheet and builds its token action macros — attacks, features/traits, spells, checks, saves, initiative — so you don't have to build them by hand. Every generated button is native to the sheet: once it's built, it works with the API turned off, same as before. Supported sheets D&D 5e by Roll20 (Beacon / D&D 2024) — new in 2.0 D&D 5e (Classic / OGL) Pathfinder 2e (Official) Commands !ta — creates the full default set of token actions for the selected token(s). I detect which sheet, and creates appropriate PC/NPC actions. !ta [categories] — limit to specific categories: attacks, traits, bonusactions, reactions, spells, checks, saves, init (plus legendary/mythic on Beacon and legacy 5e; offensive/reactive/interaction on PF2) !ta name — use the character's name instead of its ID in generated macros, so they survive a Character Vault move !ta sort — same as !ta , but groups and alphabetizes NPC actions/attacks so related ones cluster together on the token action bar !ta delete — removes token actions (anything renamed with a trailing period, e.g. "Longsword.", is protected and skipped) !ta deleteall — removes all token actions, with a confirmation step first !ta help — whispers a short usage page, plus buttons for each sheet's own category list and notes If you've got old macros saved with the legacy commands ( !deleteta , !deleteallta , !sortta ) or the pf2 keyword, those all still work exactly as before. What's new if you used the original Token Action Maker Beacon (D&D 2024) is supported for the first time. Sheet type is auto-detected per token — no more typing pf2 , and one run now handles a mixed-sheet game correctly. (Sorry, no Demiplane coverage. There is no API connection to Demiplane sheets. !ta sort  more reliably groups NPC actions so that they will list in categories when token actions are sorted alphbetically.. Check/Save/Init dropdown options now show each one's live +/- modifier next to the name. PF2 initiative lets you choose which skill to use, instead of being locked to Perception. (Thanks, Gauss!) Generated action names keep the sheet's original casing — no more forced Title Case. delete / deleteall only ever touch actual token actions now, never other hand-made abilities. Chat output is fully restyled — cleaner boxes, styled buttons and links. Beacon runs take noticeably longer than 5e/PF2 (it's a slower, asynchronous sheet). You'll get a timestamped progress update in chat as each character finishes, and progress is also logged to the API console, so a slow run doesn't look stuck. THIS IS NO LONGER TRUE! !ta help is a short common page plus per-sheet buttons now, instead of one single wall of text. One behavior change to flag: PC trait/feature buttons are off by default now ( !ta traits to include them) — the original always included them. Manual Install (temporary—this will be in One Click soon, if no issues arise.) Open the code on GitHub Gist Click "Raw" at the top of the code, then select all (Ctrl/Cmd+A) and copy (Ctrl/Cmd+C). In your Roll20 game, go to Game Settings → API Scripts. Click New Script, name it (e.g. "Token Action Maker"), and paste in the copied code. Click Save Script. Check the API console for a clean startup message with no errors. Feedback This is a ground-up rewrite of the sheet-handling underneath, so if something behaves differently than you expect on your setup, let me know here or by PM. This script was originally previewed on my Patreon page.
1789971588
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Reserved
1790024349

Edited 1790024367
Hi Keith,  Did a bit of a test earlier by generating the actions for a 2024 beholder, it creates the actions but when you click on them in the bar (one of the rays) it prints a not supported error to chat.
1790032043
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Alastair! That's a great find. Apparently, either the VTT or the sheet does not like the colon in the name of the button. It runs fine directly from the sheet but not the button. That's exactly the sort of case I was hoping for folks to find. Easily fixed. The code has been updated if you would like to see if that works for you. Select the Beholder and delete the problem actions with  !ta delete  followed by !ta  to generate new ones.
1790034270
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I have run tests with the most commonly typed uncommon characters. The following characters give issues in Token Action Button names, and should not be used (regardless of this script): : ( } | Thanks again. TAM will replace those if they occur in an ability name.
Is Token Action Maker 2.0 a new MOD or an update to the existing Token Action Maker ? IOW, do I need to replace it in my current MOD load-out or will the current version be updated once it's released?
1790092842

Edited 1790093612
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It will be updated once it's released. You won't have to do anything. Originally, I had a different script called Token Action Builder, that was specifcially for Beacon, since the underlying structure is so vastly different, but I realized that having two scripts that do the same thing was confusing. I didn't want folks in dual sheet games to have to install two different scripts with two different command structures. So I forged them into One Script To Rule Them All. If you have any existing macros, you should not have to touch them, and they should work while selecting any combination of tokens from different sheets. The only differences you will see are: Slightly different wording on some button names, to reconcile eccentricities between sheets Beacon-based characters will receive a time stamp in chat, because they take long enough to process that a user may be concerned that something has crashed.
Outstanding! I can handle doing nothing. :) keithcurtis said: It will be updated once it's released. You won't have to do anything.
When I ran it on my Curse of Strahd (Copy of Ghoul), it generated .Check, .Init, .Save which appear to work from the Character Macros page.  But it didn't convert Bite or Claws.  Also, is it supposed to update the token action bar?  They still point to the legacy (broken) macros
BlueCedarWolf said: When I ran it on my Curse of Strahd (Copy of Ghoul), it generated .Check, .Init, .Save which appear to work from the Character Macros page.  But it didn't convert Bite or Claws.  Also, is it supposed to update the token action bar?  They still point to the legacy (broken) macros Actually, I needed to reselect my token.  Now the Bite and Claw macros on the bar work.  Thanks for doing this!
1790210701
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
BlueCedarWolf said: BlueCedarWolf said: When I ran it on my Curse of Strahd (Copy of Ghoul), it generated .Check, .Init, .Save which appear to work from the Character Macros page.  But it didn't convert Bite or Claws.  Also, is it supposed to update the token action bar?  They still point to the legacy (broken) macros Actually, I needed to reselect my token.  Now the Bite and Claw macros on the bar work.  Thanks for doing this! Whew! Excellent. :)
1790272200
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Big News! Apparently, the dev team released an update to how attributes on the 2024 Beacon sheet are accessed. A time trial on a game with 80 character went from 6 minutes, 54 seconds to  8.4 seconds. 8.4 seconds! That's nearly a 5000% speed boost! There is no discernible difference in speed between sheets anymore. I am a Happy Coder.
1790272745

Edited 1790272882
AmadeusVF
Pro
API Scripter
keithcurtis said: Big News! Apparently, the dev team released an update to how attributes on the 2024 Beacon sheet are accessed. A time trial on a game with 80 character went from 6 minutes, 54 seconds to  8.4 seconds. 8.4 seconds! That's nearly a 5000% speed boost! There is no discernible difference in speed between sheets anymore. I am a Happy Coder. Wow, this explains a lot thank you for the information! I was testing a few features on my scripts, and everything seemed to be working incredibly fast. I was actually concerned and kept wondering if I had changed something and what was it. 
1790291272

Edited 1790292445
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Incidental discovery on Beacon sheet! If a player clicks their spell display to only show prepared spells and runs  !ta spells , the resulting macro will only show prepared spells. This would be a good macro for wizards, clerics, druids, etc. to have on hand to run after a long rest. The legacy sheet has no such logic, so the next update will contain the keyword pspells which will create an ability called Prepared-Spells.
It would seem more useful to rename the existing macros with a prepended period, then toggle off the "Show on token action".  Then create the updated macro with the original name.
Also, would it be difficult to add a command flag to operate directly on the character sheet?  As it is, I'm going to need to (in my Curse of Strahd campaign) open every map, select every token, then run !ta.  Since the macros are attached to the character sheet, being to run it globally on all NPC sheets would be ideal and save a lot of time.  I didn't see in the help that the script is idempotent, I assume it is?
BlueCedarWolf said: Also, would it be difficult to add a command flag to operate directly on the character sheet?  As it is, I'm going to need to (in my Curse of Strahd campaign) open every map, select every token, then run !ta.  Since the macros are attached to the character sheet, being to run it globally on all NPC sheets would be ideal and save a lot of time.  I didn't see in the help that the script is idempotent, I assume it is? Also, there are some creatures that are included in the campaign that aren't actually on any map.  I would be dragging those tokens onto the map most probably due to random encounters and won't know if they are actually converted, checking and running will cause a game delay.  Not end of the world, just annoying.
1790303228
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
BlueCedarWolf said: Also, would it be difficult to add a command flag to operate directly on the character sheet?  As it is, I'm going to need to (in my Curse of Strahd campaign) open every map, select every token, then run !ta.  Since the macros are attached to the character sheet, being to run it globally on all NPC sheets would be ideal and save a lot of time.  I didn't see in the help that the script is idempotent, I assume it is? Hi BlueCedarWolf! Token Actions are named token actions because they show when you select a token that represents a character. They are actually resident on character sheets. If you go to the token page of your CoS game, select all, and run !ta, you are pretty much done. Every token in the game representing those sheets will automatically display that sheet's token actions. It should take about 10-15 seconds to run. Note that if you are playing the CoS game purchased from the Marketplace, this has already been done for you. It ships with token actions on every sheet.
1790303323
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
BlueCedarWolf said: It would seem more useful to rename the existing macros with a prepended period, then toggle off the "Show on token action".  Then create the updated macro with the original name. I'm not sure what you mean here. Could you elaborate a little, and explain what makes this more useful?
1790303848
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
BlueCedarWolf said: BlueCedarWolf said: Also, would it be difficult to add a command flag to operate directly on the character sheet?  As it is, I'm going to need to (in my Curse of Strahd campaign) open every map, select every token, then run !ta.  Since the macros are attached to the character sheet, being to run it globally on all NPC sheets would be ideal and save a lot of time.  I didn't see in the help that the script is idempotent, I assume it is? Also, there are some creatures that are included in the campaign that aren't actually on any map.  I would be dragging those tokens onto the map most probably due to random encounters and won't know if they are actually converted, checking and running will cause a game delay.  Not end of the world, just annoying. If you are running a Roll20-produced game, and it is D&D or an older pre-Demiplane PF2, it already ships with Token Actions on every sheet. Also, All Roll20-produced adventures ship with a Token Page, which has an assigned token for every character sheet in the game, regardless of if they appear on a map. Many third party products follow this practice. You can select all, type !ta in chat and you are done. For third-party adventures that do not include a token page, yes, you will need to drag the creature to the desktop, and run !ta. This is unavoidable, and still takes a tiny, tiny, tiny fraction of the time it would take to do this by hand. Fresh creatures dragged in from the Compendium do not have Token Actions on them, of course, which is one of the reasons this script was written. Once created, while it is still selected, type !ta into chat. You should have token actions in about a tenth of a second.
Hi Keith. Any timeline on when this will be available on 1-click? Just curious...
1791487061
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Pak! I just sent a pull request a couple of days ago. It should be in by the next merge. These happen once a week or so, but not on a schedule.
Thanks so much Keith! I appreciate your efforts in expanding this scripts scope into 2024 sheets!!!
Excellent work!
1791938633

Edited 1791940626
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This was supposed to have been merged today, but something went awry. I will post as soon as I can clear up the mystery.
I'm assuming this wasn't supposed to happen.
Frimus Games said: I'm assuming this wasn't supposed to happen. I am getting the same error!
1792028360
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Well, poop. I have investigated and this is my fault. I left the beta code up for two weeks hoping this wouldn't happen, but the code was outdated and bad. I will petition for an early re-merge. In the meantime, you can get the latest code for a manual install here .
I've updated to the latest manual install as you suggested, and it has fixed the error. Thanks! I like the improvements you made, especially to the naming of the buttons. There is one minor bug I found when using it with a vampire character: It removes the first bracket in abilities with a reminder in brackets, such as the vampire's "Children of the Night (1/Day)" action and its "Bite (2 Actions)" legendary action. Thanks again for the update
1792036484
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks! I'll note that for the next version, but I have triple-checked my correction, and don't want to risk breaking anything until after a working version is installed.
I found another bug, even more obscure than the last one: The bonuses listed in the dropdowns for checks and saves are incorrect for legacy 5e NPC character sheets because of the slightly odd way those character sheets work. Legacy 5e character sheets for NPCs leave the bonus attributes empty for any ability or save that the character is not proficient in, and then they substitute the appropriate ability score modifier instead if the specific bonus is empty when rolling a check or save. The bonuses you added in the dropdowns are showing as +0 for most checks and saves, likely because their specific bonus attributes are empty, but they should be defaulting to the corresponding ability score modifier in cases where the specific bonus attribute is empty for legacy 5e NPC character sheets. I really like seeing the bonuses in the dropdowns, so I hope you can eventually address this little bug for all us legacy 5e GMs. Thanks!
1792039347
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks! To be clear, that's for NPC statblocks?
Yes, only the NPC checks and saves work that quirky way. PC sheets have all the skill checks and saves explicitly stored in attributes, so they are working correctly.
1792079841
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This should be fixed. You can resume One-Click operation. Huge thanks to the Dev Team for pushing through this correction!
1792095730
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
And my apologies to whoever was inconvenienced by this.
Thanks for workign on it so quickly, Keith.
First thanks for this it has been so useful over the years! Issue uncovered D&D 5E (Classic) sheet. Latest release, 2.0.2 , reports “sheet not recognised”. Happens with both new and older characters. Switching to 0.3.9 makes !ta work again for old sheets, but not for new ones until you reload the script. 
1793031492
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Silva . said: First thanks for this it has been so useful over the years! Issue uncovered D&D 5E (Classic) sheet. Latest release, 2.0.2 , reports “sheet not recognised”. Happens with both new and older characters. Switching to 0.3.9 makes !ta work again for old sheets, but not for new ones until you reload the script.  Hi Silva! Are you on sandbox 1.5? That's now a requirement, since it has to deal with Beacon sheets. If you are on Sandbox 1.5, Could you DM me a temporary GM invite? I'd like to investigate, since I am not seeing this issue on my test setupa.