Update v0.5 -- Added delta changes to all reasonable number fields. You can now specify +3 or -2 instead of just a number, even on status numbers: !token-mod --set statusmarkers|blue:-1 bar1_value|+3 This can be used on any field that is one of: Number, Number or Blank, Degrees, Text, Status Status fields will be bound between 0 or 9, other fields will not be bound. Also added the ability to set the represents for a token. You need only specify the character_id, probably with @{<character name>|character_id}: !token-mod --set represents|@{Bob|character_id} Note that this will clear out any links that bars have currently... So I've also added setting links for the bars, using the fields bar1_link, bar2_link, bar3_link. You need to specify the name of an attribute on the character the token represents. If you're specifying these in the same command as represents, be sure they are after: !token-mod --set represents|@{Bob|character_id} bar1_link|npc_HP bar2_link|npc_ac bar3_link|npc_temp_HP One final caution: There seems to be a bug with updating a token bar via the API when it is tied to an attribute, such that other tokens that are tied to the same attribute do not get updated. Be sure to leave a comment if you experience that, particularly if you can narrow down the case. sturtus said: Hi Aaron. I have a request for your script if you are willing. I'd like the ability to assign linked attributes to a token that represents a character. Input: !token-mod --set bar1_link|npc_AC --set bar2_link|npc_HP Logic: If the token "represents" a character (if not spit an error), Find the ID of the attribute object linked to the name in the command Set the bar1_link to that ID Set the values of the bar according to the ID Worth it? This id done, and looks pretty much like you suggested. You'll want to do a represents|@{SomeChar|character_id} before you set those links, or just set the represents manually (but why would you want to do that!). Kevin said: Aaron, I didn't see a way, but can you set token representation? The use case is that with this macro I could very easily create a set of macros that will automatically setup tokens the way I want in essentially 1 click. For example for NPC that are using token numbering script: !token-mod --set represents|"?{name?}" name|"?{name?} %%NUMBERED%%" bar3_value|@{selected|npc_hp} bar3_max|@{selected|npc_hp} bar2_value|@{selected|npc_ac} --on showname
You could do something similar with PC as I have basically used this to also replace your !torch script (reducing the number of scripts), so it would simply be similar to above then a second press to set vision on the token. I also assume there is no way in the API to set the default token of a character journal is there, because that would realistically be the last piece that I personally do when setting up tokens. As it is now I can do all of that except setting representation, so either way it is an awesome script as usual. This is done now, for the most part. I didn't chose to do the name syntax, but I might add that later. For the moment, you'll need to specify it with the @{<character name>|character_id} syntax. !token-mod --set represents|@{Some Char Name|character_id} name|"?{name?} %%NUMBERED%%" bar3_link|npc_hp bar2_link|npc_ac --on showname or if you're making a mook: !token-mod --set represents|@{Some Char Name|character_id} name|"?{name?} %%NUMBERED%%" bar3|@{Some Char Name|npc_hp|max} bar2_link|npc_ac --on showname Let me know if you have any questions!