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

API Script to add a fourth token bubble/bar?

I am a helpless babe when it comes to API so apologies in advance if this is a foolish question, but I am trying to find solutions to really needing a fourth bar for combat on my tokens. It's a homebrew system that uses Red for Armor Class - which can change mid-combat, Green - Hit Points, and Blue - Action Points, but I need a fourth one to represent effectively magical power or mana. I've been sort of faking it with using the numbered token markers to count action points but it can get hard to deal with when tokens accumulate buffs and debuffs during a normal combat.  Is there anything yee Gods of API can think of that I can use to fix my issue? If one or more of the bars wasn't changed relatively frequently during combat I'd change my system to only need 3 but I really, really need four. 
1636517789
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Doing a sort of pseudo additional bubble/bar is technically possible via an API script, but has several hurdles before it would be doable.
Hurdles for me or for an API writer? One of these I am willing to commit to but wouldn't ask someone else to write fancy scripting sorcery for me.
1636541581
Andrew R.
Pro
Sheet Author
May I suggest using the new Tooltip feature of tokens, supported by the TokenMod script? I’m using it in my 13th Age Glorantha campaign for AC, MD, & PD leaving the bubbles & bars for HP, temporary HP, & Recovery as standard. 
1636546306

Edited 1636546611
David M.
Pro
API Scripter
If you went the tooltip route, I wrote a simple script that can tie the tooltip text to one or more character attributes. The tooltip will change automatically when the attribute changes. Of course, for your specific case you probably are looking for easy access/modification of the attribute, so a token-mod macro that sets the value and updates the tooltip as Andrew suggested might be a better approach. But, figured I'd share just in case.  See this forum post . Note that it will only work on the production server, as the Dev server does not currently support the new tooltip token property. 
The use of the tooltip function has seemed to work out well. It's not the most elegant solution but considering the options its enough. Thank you all!