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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] TokenAction creator v0.3.0 for the 5th Edition Shaped sheet v2.1.5+

1456438718

Edited 1456593718
EDIT: &nbsp;Added features through version 0.3.3 to this initial post! This script will automatically create ability macros that can be selected as a token actions from the Abilities & Attributes tab of the character journal. &nbsp;The following token actions can be created: Attacks Actions DELETE Initiative Lair Actions Legendary Actions Reactions Resources Saves Skills Spells Traits Syntax: !ta --option1, option2, ... Where the options can be any combination of attacks, actions, initiative, lair, legendary, reactions, resources, saves, spells, or traits. &nbsp;For example if I wanted to setup an NPC with token actions for initiative, saves, actions and reactions, I would use the following command: !ta --initiative, saves, actions, reactions There is one configuration option in the script (line 5): var showAsTokenAction = true; Setting true will automatically enable any newly created token actions. Setting false leaves newly created token actions disabled. NOTE: The saves and skills macro created currently whispers save command buttons to the character where the appropriate save can be clicked. &nbsp;The whisper is to help eliminate some of the potential spam of having multiple people save at the same time. &nbsp;If someone is able to provide a clean and functional query macro, I would be happy to use it. IMPORTANT: &nbsp;The DELETE&nbsp;option must be executed in all capitals as a small safeguard because it will remove ALL Abilities on the Attributes & Abilities tab of the selected token. Syntax example: !ta --DELETE Script: &nbsp; <a href="https://raw.githubusercontent.com/beeke01/TokenAct" rel="nofollow">https://raw.githubusercontent.com/beeke01/TokenAct</a>... Thank you to The Aaron and Kryx for their assistance and feedback! &nbsp;Thank you Filip Č for adding skills to the script! &nbsp;Thank you Saevar L. "Liquid-Sonic" for the suggestion to add resources to the script!
Crashes if I try to use this on a Green Hag :/
1456445413

Edited 1456446077
I added a new sheet, used the compendium to populate the NPC sheet with the Green Hag and couldn't reproduce any error. &nbsp;I ran the following command to get everything: !ta --attacks, actions, initiative, lair, legendary, reactions, saves, spells, traits Can you please provide a bit more description on what command you actually ran? &nbsp;Are there errors in the console?
Version 0.3.1: Added the DELETE option. This option must be executed in all capitals as a small safeguard because it will remove ALL Abilities on the Attributes & Abilities tab of the selected token. Syntax example: !ta --DELETE
1456509649
Kryx
Pro
Sheet Author
API Scripter
I keep running out of time to review this, but I'll look it over tomorrow if not tonight. Sorry on the delay - I've been trying to get more features on the sheet before it goes public.
Thank you Filip Č for this useful addition to the script! Version 0.3.2: Added the skills option. Like saves this will whisper the character a number of skill buttons that can then be clicked on from the chat window.
Kevin said: I added a new sheet, used the compendium to populate the NPC sheet with the Green Hag and couldn't reproduce any error. &nbsp;I ran the following command to get everything: !ta --attacks, actions, initiative, lair, legendary, reactions, saves, spells, traits Can you please provide a bit more description on what command you actually ran? &nbsp;Are there errors in the console? Sorry about the horribly short descript. Wasnt intended, was just a long day and I fell asleep. Ignore what I said, I made an error thinking just doing !ta alone would fill in everything. &nbsp;It spatan api error and I assumed it was the script instead of me.
Saevar L. "Liquid-Sonic" said: Sorry about the horribly short descript. Wasnt intended, was just a long day and I fell asleep. Ignore what I said, I made an error thinking just doing !ta alone would fill in everything. &nbsp;It spatan api error and I assumed it was the script instead of me. No worries at all. &nbsp;Test it out and let me know if there are any related features people would like to see added to the script.
This is sweet. Love it!
Thorsten B. said: This is sweet. Love it! Thank you, glad you like it. &nbsp;If there is any feature that you feel is missing, please let me know.
I'll let you know what my players think once they see it in action this Sunday :). For players, it'd be nice if this could create buttons for their attacks. Spells work on PC, so someone can run this, have it populate, then remove the spells again manually they don't want to see. That's pretty sweet. Traits also work on PC.
Players should be able to run this command as well. &nbsp;Doing a "!ta --attacks" will populate anything in the attacks section of the PC sheet. &nbsp;Generally speaking for PCs I run the following command: !ta --initiative, saves, skills, attacks, spells On 2.1.6 traits are applicable to PCs as well.
I am a blind person. I didn't see that --attacks was already in there. It's right there at the top! Excellent.&nbsp;
This is amazing! Thank you for this!
Do the button parsing for spells take into account prepared spells? Or will it parse them all?
1456569275
Kryx
Pro
Sheet Author
API Scripter
Prepared can change on the fly so I'd be inclined to say this shouldn't take that into account.
Agreed. Buttons can be toggled on/off as visible in the character under "Abilities". From what I've seen with my players, they have staple spells they have always prepared and cast frequently, spells that are usually prepared but situational, and spells that are prepared only if they feel they might need them (or where they leave room to take a 10-minute rest to prepare them during the day).&nbsp; The first group are a candidate for token actions. The rest are probably better cast from the spell book. By unchecking "show as token action" on the less-frequently used spells, their screen isn't cluttered. I like the way the tool works as-is. Populate everything, let the player choose which actions to keep. And there is a variable so it'd work the other way around, as opt-in rather than opt-out. Plenty of options for every preference.
Currently this takes all spells, regardless of them being prepared, and I am inclined to keep the spell option that way. &nbsp;However, maybe it does make sense to add another case where it looks at this flag and enables the macro if it is prepared and disables the macro if it is not prepared. &nbsp;Let me think on this one a bit...
Thorsten B. said: Agreed. Buttons can be toggled on/off as visible in the character under "Abilities". From what I've seen with my players, they have staple spells they have always prepared and cast frequently, spells that are usually prepared but situational, and spells that are prepared only if they feel they might need them (or where they leave room to take a 10-minute rest to prepare them during the day).&nbsp; The first group are a candidate for token actions. The rest are probably better cast from the spell book. By unchecking "show as token action" on the less-frequently used spells, their screen isn't cluttered. I like the way the tool works as-is. Populate everything, let the player choose which actions to keep. And there is a variable so it'd work the other way around, as opt-in rather than opt-out. Plenty of options for every preference. Kevin said: Currently this takes all spells, regardless of them being prepared, and I am inclined to keep the spell option that way. &nbsp;However, maybe it does make sense to add another case where it looks at this flag and enables the macro if it is prepared and disables the macro if it is not prepared. &nbsp;Let me think on this one a bit... You're right, sorry, I didnt think of this as a method! Ignore me :) Honestly, this is a better way of doing this so dont worry about it.
Could resources be a button? Maybe ;&lt;
Saevar L. "Liquid-Sonic" said: Could resources be a button? Maybe ;&lt; Sure can, will look to add this!
Version 0.3.3: Added the resources option. &nbsp;(Thanks Saevar!)
Kaelev said: This is amazing! Thank you for this! Really glad you like it, please let me know if you or your players would like to see anything added.
So with regards to prepared spells, I created a "prepared" option. &nbsp;In order for this to make sense, it essentially runs the "spells" option creating all macros, then enables only the ones that are prepared. I have committed the version to the branch, but I am not certain that I will keep this option. &nbsp;So I would appreciate people testing with this option and letting me know if it is something that people find useful. &nbsp;If not, I can always back out the change. Syntax: !ta --prepared
This is sweet!, but I did notice with the saves and skills, the output in the roll template all the words (buttons?) are bunched together with no spaces or any kind of formatting.
Don't you block some css styles?
I'm not fiddling with CSS and I see the same thing with Saves. It used to work, which means a recent update to Shaped must have caused it. Tested with Shaped 2.1.10.
1456663651
Kryx
Pro
Sheet Author
API Scripter
The css in 2.1.9 adjusted those buttons to be words, ya. Hmmm.. how to handle this... Either they need to remain buttons or this script needs to use commas...
There was a change to the css for buttons in the sheet. &nbsp;I am not exceptionally familiar with the css side and how these work. &nbsp;In the mean time I can at least add a comma and a space between them.
1456669106

Edited 1456669174
Version 0.3.4: Made a change to the save and skill macros to factor in the roll template css changes in 2.1.9+ of the Shaped Sheet. &nbsp;Any previously created macros will need to be recreated by rerunning the command with relevant options. Note: &nbsp;I am still looking for feedback on the --prepared option, so would appreciate comments/concerns/opinions on the usefulness of this.
1456680455

Edited 1456680750
Kryx said: The css in 2.1.9 adjusted those buttons to be words, ya. Hmmm.. how to handle this... Either they need to remain buttons or this script needs to use commas... From a human factors perspective, they should be buttons. However, they should also be consistent with the sheet's clickable bits. Also, see below... Kevin said: Version 0.3.4: Made a change to the save and skill macros to factor in the roll template css changes in 2.1.9+ of the Shaped Sheet. &nbsp;Any previously created macros will need to be recreated by rerunning the command with relevant options. Note: &nbsp;I am still looking for feedback on the --prepared option, so would appreciate comments/concerns/opinions on the usefulness of this. Much better, but one possible issue with people with small screens is the text size. If the text size could be made a bit bigger that would be better, with a wee bit more space between choices. Could group the output in lines with three buttons or comma separated text (although if someone expands the width of the chat it would probably look weird). Edit: leaving that last line in but not so sure about it. :\ As for the --prepared option, I like it. As a GM I would use it rather than using --spells for populating token actions for my NPCs in a combat encounter because I would not need the other spells he may have. Options are good, IMHO. But I also like the option players have to uncheck the box in the Abilities section. This is useful for when they change their list of prepared spells from their spellbook. Another cool thing is they can check the boxes to put them in their macro bar - and colourize them.
1456680595

Edited 1456680687
Kryx
Pro
Sheet Author
API Scripter
Doug E. said: From a human factors perspective, they should be buttons. However, they should also be consistent with the sheet's clickable bits. Also, see below... They shouldn't necessarily visually appear as buttons. Buttons should appear as buttons if you want to draw people's attention to them. Otherwise they appear as plain (potentially colored) words. You can see this all over the web. You can also see this on&nbsp; Material Design specifications about buttons . Feel free to checkout the chat macros built into the sheet in 2.1.11 and provide feedback on that thread about buttons vs colored text. Kevin will soon reference my sheet which has included saves and ability checks built in. The text there is bigger.
I will be updating this to use Kryx's built in macros, is there a preference of using the button macros or the queries? &nbsp; The buttons have no limitations, but I worry that they will be potentially annoying to use as multiple people make rolls, the chat will be scrolling faster than some may be able to click. &nbsp;The queries however are limited as described in Kryx's thread and they are also a bit clunkier from a usability perspective. Anyone have strong preferences?
Can you add an "all" option or have it be the default if no options are specified?
It is possible, but at the same time it is also quite simple to make a macro that has all options there, allowing you or your players multiple options that are commonly used for their specific characters. I did consider this initially, but I didn't necessarily want people running the command hoping to get syntax and it surprisingly creating everything.&nbsp;&nbsp;
1456728760
Kryx
Pro
Sheet Author
API Scripter
I would suggest supporting both variants. You can name them slightly different. Saving throws and saving throws query for example
I have created a new thread here: &nbsp; <a href="https://app.roll20.net/forum/post/3044595/script-t" rel="nofollow">https://app.roll20.net/forum/post/3044595/script-t</a>... Can a mod please close this thread?