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 accessing character tags

Is it possible for the script to access the list of tags on a character? I have a script that works on the add:graphic event. If the graphic being added is a specific PC or NPC (as opposed to a generic cannon-fodder orc), then I want the token bar attributes (bar1, bar2, and bar3) actually linked to specific character attributes. For cannon-fodder tokens, I do not want the bar attributes linked. That way I can add multiple copes of the cannon fodder tokens without having them all share the character's stats, and thus updating all the tokens that share that character's stats (such as hit points). My script sets the bar values to the appropriate attribute values, but doesn't link them. For certain tokens, I want my script to set the values and also link them. I thought I could add a tag to the PC and named NPC character ("Unique") and base my script off of that, but I don't see any way for the API to access the list of tags. Am I missing something?
1417124084
The Aaron
Roll20 Production Team
API Scripter
You are not missing anything. The API does not have access to the tags. Is is there a reason that adding the tokens (with the bars linked or unlinked correctly) to a character and then dragging the character in doesn't work for you?
1417125370
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
BardMorgan, Tags aren't one of the attributes available to the API. However, as a work around you could put your tag in the GM Notes and check there. This might be a good topic for the Suggestions and Ideas forum.