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

Marking a Token on isShaken using ChatSetAttr

1589139513

Edited 1589140862
I'm using to attribute monitoring script from  this thread  so that when the Savage Worlds Tabbed sheet attribute 'isShaken' = 'on', the token has a red marker, and when isShaken = 0 the red marker goes away. I was trying to integrate this with ChatSetAttr so that Shaken status could be set by a macro (the shaken field on the sheet can't be dragged out like a roll). But the attribute change doesn't seem to register and mark the token when it is set that way, only when actually clicked on the character sheet. Do I need to change something to make this work? !setattr --name @{selected|character_name} --isShaken|on
1589145062
The Aaron
Roll20 Production Team
API Scripter
When the API changes (most) things, it does not cause an Event to occur. Events are what trigger behavior in the various scripts. ChatSetAttr allows you to register a function to be called when it makes changes.  You can add this to the linked script to get that to work: ChatSetAttr.registerObserver("change",toggle);
Thank you!