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

Toggle Show as Token Action

1696982932
Essen
Pro
Marketplace Creator
I've seen a recentish post ( here ) about toggling Show as Token Action with a script, and I was curious if anyone has refined how to do it to specific abilities based on the name?
1696983954
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
HI Essen! Can you give an example of what you are trying to accomplish?
1696985477

Edited 1696985522
Essen
Pro
Marketplace Creator
Well, if you’ve seen my other post, you’ve seen that I’m trying to make a modular weapon that does everything with one button. instead of reading the weapon head from an attribute, I have laid them out into individual ability buttons. I want to change the macro that sets the head attribute to instead toggling off or on the weapon head token actions, which would prevent the roll queries from popping up when that head isn’t in use. So it would set one istokenaction to true based on the ability name, and set the two others to false, also based on the name. So I would need to be able to manually select the abilities and their value for istokenaction.
1697033164
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm pretty sure it could be done with a custom script written just for that purpose, but I'm not aware of anything that does that off the shelf. Toggling token actions is something that falls in the area between token-mod (which sets token attributes) and ChatSetAttr (which sets character sheet attributes). You'd need something like "JournalMod".
1697033916
timmaugh
Pro
API Scripter
You might be interested in this ShowButtons script I wrote a while back.
1697059448
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Wow, that one snuck past me!
1697062308
Essen
Pro
Marketplace Creator
I am interested in that! Thanks.