There are some new changes to the API out today, the most important of which is the way that linked token bars + attributes are handled. From now on, if a token's bar is modified that is linked to an attribute, you will first hear the attribute events, then the graphic/token events in the API. In addition, if you set the value of attribute or the value of a bar in the API, and the bar/attribute is linked to anything, the API will automatically handle updating the linked property for you. Both of the values will be the same, but that way you can just work with the bar1_value property for a token without needing to worry about whether or not that bar is linked to an underlying attribute. So, to recap:
Attribute events will always precede bar events for linked bars.
But if you are working with the bar values on a token, you can now safely listen to and modify only the bar values and the API will handle updating the linked attributes for you.
Hopefully that makes things a little easier to deal with. In addition, there have been several new properties added to objects, including:
represents for the Graphic object, which is the ID of any linked Character (read-only)
controlledby for the Graphic, Text, Path, Handout, and Character objects, which is now read+write, and is a comma-delimited list of the Player IDs which can control those objects
inplayerjournals for the Character and Handouts objects, which controls which Players can see those objects in their Journal tab, also now read+write
The documentation on the Wiki has been updated to reflect these changes. Please note that you need to reload your game if you're already in-game as well to make sure that you're using a game state compatible with the new changes. Also note that if you were reading any read-only attributes before that are now read+write (e.g. "_inplayerjournals" is now "inplayerjournals"), you need to update any event listeners and get calls to remove the underscore. (Note: As a rule of thumb, you can actually leave out the underscore even for read-only objects in get() calls and it will correctly return the value, so that might be best to do going forward as I change things up.) A Quick Note on Read-Only Properties Right now I'm basically taking a very conservative approach to opening up the ability to write to properties which require special handling. The eventual goal is that nearly every property will be read+write (except for ones like the "_id" and the "_characterid"), but I want to make sure that a) they are clearly documented and b) there are at least some safeguards in place to make sure that if you put an invalid value in there you don't ruin your whole Campaign. So bear with us while we get those rolled out.