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 .
×
Advertisement Create a free account

[Script Update] TokenMod -- An interface to adjusting properties of a token from a macro or the chat area.

1603414337
New problem! I haven't been able to find a way to go from an aura set with this to removing it altogether, if I set aura1_radius#0 and have a small token, an aura will still be displayed on 1 square. Any ideas?
1603415084
The Aaron
Forum Champion
API Scripter
Try: !token-mod --set aura1_radius#
1603416593
Yup, that works perfectly, somehow I didn't try the simplest solution haha.. Thank you again!
1603416911
The Aaron
Forum Champion
API Scripter
No problem! =D
1603653352
Juan
Pro
Bernd S. said: The Aaron said: Oh?  Can you post your macro, I'd like to take a look at that. Sure. It's just for starters, several options have to be added, but the most important are there. My main intention is to be able to blind people because that's always fun and there are so many possibilities: Darkness, Cloudkill, Fog Cloud, Sleet Storm, .... Unfortunately in the new system it is necessary to have two see/blind options for normal/darkvision characters.  !token-mod {{ --set ?{Vision    |Torch, emits_bright#yes                 bright_light_distance#20                emits_low#yes                low_light_distance#20    |Darkvision, night_vision#yes                night_vision_distance#60                night_vision_tint##6aa84f    |See Normal, has_limit_field_of_vision#yes                 limit_field_of_vision_total#360    |Blinded Normal, has_limit_field_of_vision#yes                 limit_field_of_vision_total#0    |See Darkvision, has_limit_field_of_night_vision#yes                limit_field_of_night_vision_total#360                limit_field_of_vision_total#360    |Blinded Darkvision, has_limit_field_of_night_vision#yes                limit_field_of_night_vision_total#0                limit_field_of_vision_total#0} }} If you omit ' limit_field_of_vision_total#0 ' part in 'Blinded Darkvision' you have this strange effect, that light sources are black (black light :-) ) but you see in the dark. As if light blinds you. Thank you for this example, and thanks to everyone else providing input on this.  In case it helps anyone, below is what I ended up with. Some notes: Switching between some modes will look bad at first, but if you double-click the token, make no changes, and "Save Changes", it fixes itself.  I assume this is a current UDL bug that may go away eventually, but the workaround isn't so bad if you don't change lighting often. When setting has_directional_bright_light to no, I also had to set the directional_bright_light_total to 360 or else it would be in a weird state.  This may be a bug, and if it gets fixed then this macro could remove those 360 sets. My "Darkvision 120" is a poor-man's Devil's Sight, as I couldn't find a good way to do it properly.  If someone has solved this for UDL, please share. !token-mod {{ --set ?{Vision |Blind, bright_vision#no night_vision#no |Normal (5dim), bright_vision#yes emits_bright#yes emits_low#yes bright_distance#0 low_distance#5 has_directional_bright_light#no directional_bright_light_total#360 |Candle, bright_vision#yes emits_bright#yes emits_low#yes bright_distance#5 low_distance#5 has_directional_bright_light#no directional_bright_light_total#360 |Lamp, bright_vision#yes emits_bright#yes emits_low#yes bright_distance#15 low_distance#30 has_directional_bright_light#no directional_bright_light_total#360 |Torch/Light Cantrip, bright_vision#yes emits_bright#yes emits_low#yes bright_distance#20 low_distance#20 has_directional_bright_light#no directional_bright_light_total#360 |Hooded Lantern, bright_vision#yes emits_bright#yes emits_low#yes bright_distance#30 low_distance#30 has_directional_bright_light#no directional_bright_light_total#360 |Bullseye Lantern, bright_vision#yes emits_bright#yes emits_low#yes bright_distance#60 low_distance#60 has_directional_bright_light#yes directional_bright_light_center#90 directional_bright_light_total#60 |Darkvision 60, night_vision#yes night_distance#60 |Darkvision 90, night_vision#yes night_distance#90 |Darkvision 120, night_vision#yes night_distance#120 |Darkvision off, night_vision#no} }}
1604226039

Edited 1604226867
Hi! I have a few questions about if TokenMod and find this thread and the help file a little overwhelming. I am hoping some TokenMod gurus can help clarify some things: Can TokenMod be applied to several tokens at once? I have set up my player tokens to use Bar3 as XP (5e Roll20 character sheet). I am trying to write a macro to increment XP by a set amount and was looking to use TokenMod to achieve this similar to incrementing hit points, but I'd like to apply it to all five players at once. Can TokenMod pull info from a token's character sheet as a variable, i.e. can I grab the number of hit dice from a selected token for the healer feat (1d6+4+target character hit dice) At the moment I am using a regular macro for this. This requires selecting the healer, then the target, but doesn't apply the healing to bar1, I have to do that manually. I'm looking to automate this process with TokenMod. &{template:npcaction} {{name=Healer Kit}} {{rname=Healer Feat}} {{description=@{selected|token_name} heals @{target|Guy|token_name} for [[1d6 + 4 + @{target|Guy|hit_dice|max}]]}} Is there a place where I can find finished TokenMod macros for different purposes? i.e. I've seen and made use of the Vision one recently published, and I've seen the healing potion one as well, but have a hard time finding these in one place. Thanks for any help!
1604230774
GiGs
Pro
Sheet Author
API Scripter
Taking your last question: the reason there aren't many finished tokenmod macros, is because there are around 800 character sheets people might be using, and the requirements for each are different. TokenMod macros have to be build per campaign, and GMs might have different needs even when they are playing the same system. There are a decent few scripts like this, which can be used with many different sheets and campaigns, but that means they need to be tailored for each campaign. For your first two questions, you seem to want to manipulate character sheet attributes, not tokens. For that you should look at the ChatSetAttrs script.
1604245324
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Actually if the values are in token bubbles, you don't need ChatSetAtt. Can TokenMod be applied to several tokens at once? I have set up my player tokens to use Bar3 as XP (5e Roll20 character sheet). I am trying to write a macro to increment XP by a set amount and was looking to use TokenMod to achieve this similar to incrementing hit points, but I'd like to apply it to all five players at once. Yes. This macro will do it: !token-mod --set bar3_value|+?{XP award?|0} Can TokenMod pull info from a token's character sheet as a variable,  i.e. can I grab the number of hit dice from a selected token for the healer feat (1d6+4+target character hit dice) At the moment I am using a regular macro for this. This requires selecting the healer, then the target, but doesn't apply the healing to bar1, I have to do that manually. I'm looking to automate this process with TokenMod This should be doable, but it's a bit trickier. I have to go do some real life stuff now, but I'll see what I can come up with later.
1604255315

Edited 1604255709
" Can TokenMod be applied to several tokens at once? " Usually yes, definitively. The only thing which doesn't work as you would expect for several selected tokens is, if you try to put random hp values to several tokens. If you try a thing like !token-mod --set bar3_value|[[npc_hpformula]] with several tokens selected, it won't work. It takes the hpformula of the "first" token and uses that for all tokens. But apart from that it should always work for all selected tokens. I use this for setting statusmarkers to all selected tokens or sight or whatsoever. " Can TokenMod pull info from a token's character sheet as a variable " Yes. Everything which is an attribute in the character sheet can be used here. Maybe I got wrong what you want to do here, but you can always use @{selected| ...} and @{target|...}. The later will cause a cross to appear to let you select the target. As an example what I use is for the Bless spell: !token-mod {{   --set     statusmarkers|!angel-outfit   --ids     @{target|First Blessed|token_id}     @{target|Second Blessed|token_id}     @{target|Third Blessed|token_id} }} !token-mod {{   --set     statusmarkers|stopwatch   --ids     @{selected|token_id} }} That sets statusmarker 'angel-outfit' to the target tokens and 'stopwatch' (to indicate concentrating on a spell) on the selected token.
1604267922
Thanks for the response guys! The XP suggestion works fantastic! @keithcurtis that would be awesome if you can take a look. The script above also looks interesting. Is there a quick way to remove conditions (status markers)?
1604278014
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Absolutely. I would suggest reading through the documentation for token-mod. (It's a handout, once you install it in a game. There are lots of examples, including a whole section on handling token markers. Still haven't had time to look at the Healing one yet. IIRC, the API has issues with re-using some types of {target} calls.
1604321640
I use a litle trick to remove all statusmarkers: !token-mod --set statusmarkers|=red|-red
keithcurtis said: Absolutely. I would suggest reading through the documentation for token-mod. (It's a handout, once you install it in a game. There are lots of examples, including a whole section on handling token markers. Still haven't had time to look at the Healing one yet. IIRC, the API has issues with re-using some types of {target} calls. I'm very curious to see what you can do with the Healing example. I would like to use Tokenmod both to heal a character and to decrement a resource on the character sheet (potion). I currently have a macro that uses Tokenmod for healing and ChatSetAttr for the resource, but it works only intermittently (the second part with ChatSetAttr silently fails a fair bit).
1604438591
It's not possible to change anything on a sheet. You can only change the token. BUT there might be a workaround for your potion example. If you have this as a resource, it is an attribute on the sheet. If you link this attribute to a bar on the token, you can change the value on the token bar. The linking to the attribute should change the value of the attribute on the sheet.
Bernd S. said: It's not possible to change anything on a sheet. You can only change the token. BUT there might be a workaround for your potion example. If you have this as a resource, it is an attribute on the sheet. If you link this attribute to a bar on the token, you can change the value on the token bar. The linking to the attribute should change the value of the attribute on the sheet. That's what I thought. The workaround would be more trouble than it's worth for me. I've modified my macros to track only the potion being consumed (and the effect on the HP bar). I'll handle inventory management for my players myself via a separate macro.
1604822413
I didn't find it in the thread, but is it a known bug that tokenmod doesn't work with `/talktomyself` active? I created a simple macro to apply status markers to a selected token: `!token-mod --set statusmarkers|+bleeding-eye` If talk to myself is active, nothing happens. If I turn it off, the marker is applied. Any suggestions?
1604822977
keithcurtis said: Absolutely. I would suggest reading through the documentation for token-mod. (It's a handout, once you install it in a game. There are lots of examples, including a whole section on handling token markers. Still haven't had time to look at the Healing one yet. IIRC, the API has issues with re-using some types of {target} calls. That's alright mate, you've been helpful enough. That's the issue I was experiencing, that was not pulling the hit_dice in the formula, looked like it wanted to select another token, and then did nothing.
1604824557
GiGs
Pro
Sheet Author
API Scripter
Scott M. said: I didn't find it in the thread, but is it a known bug that tokenmod doesn't work with `/talktomyself` active? It's not a bug, it's a feature. Seriously. /talktomyself suppresses text from being sent from your client - only you can see it. It doesnt get sent to communal chat. But for scripts like TokenMod to work, that text has to be sent to communal chat, so the API can intercept it and read it.
1604848289
Hi, don't know if it has been asked already, but couldn't find an answer: i'd like to make a macro where my player are able to click on it and automatically one of their bar is reduced by X (the have abilities witch costs Mana Points) i'd like to have a macro button for an ability, and when pushed they use the abilty and lose X MP, but without the need to select or target their own character. is it possibile ? 
1604851537

Edited 1604851705
The Aaron
Forum Champion
API Scripter
Probably it's better to use ChatSetAttr for that.  You could do it with TokenMod using the character id: !token-mod --set bar3_value|-@{mana_cost}! --ids @{character_id} That would find all tokens representing the character abs change them. You could further restrict it to just the current page, or active page, but that wouldn't change anything if there isn't a token on the page for it. 
1605092724
The Aaron said: Probably it's better to use ChatSetAttr for that.  You could do it with TokenMod using the character id: !token-mod --set bar3_value|-@{mana_cost}! --ids @{character_id} That would find all tokens representing the character abs change them. You could further restrict it to just the current page, or active page, but that wouldn't change anything if there isn't a token on the page for it.  Cool thank you so much! i tried chatsettattr but settled for ammo instead, and works great! i have another question regarding TokenMod what i'm trying to do is pretty simple, but really hard for me :D  i have this macro for my player attacks: (it's in their character sheet, so to use it they just click on it and target the token they want to hit without selecting their character) /em breathes, and attacks **@{target|token_name}** &{template:default} {{name=Attacks with DEX}} {{Weapon:= ?{Choose your weapon| @{noun1_name}, @{noun1_name} Causing [[[[[[@{noun1}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun2_name}, @{noun2_name} Causing [[[[[[@{noun2}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun3_name}, @{noun3_name} Causing [[[[[[@{noun3}]] + @{Bonus_DEX} - @{target|BAR2}]]}]] Damages}} I'd like to add inside this macro the possibility to automatically apply the damage to the bar1 of the target token, Part 2: i'd like also to add the possibility to roll their "hit dice" if they do less then x they miss, between x and y they do half damage. between y and z normal hit, and W Critic (x2) i don't know if i'm asking too much with part 2 but i'd be happy enought to be able to use part 1 :D is it possible? thank you very much in advance! Ps: i'm using a custom sheet
1605101487

Edited 1605101525
The Aaron
Forum Champion
API Scripter
The best I can come up with is: /em breathes, and attacks **@{target|token_name}** &{template:default} {{name=Attacks with DEX}} {{Weapon:= ?{Choose your weapon| @{noun1_name}, @{noun1_name} Causing [[[[[[@{noun1}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun2_name}, @{noun2_name} Causing [[[[[[@{noun2}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun3_name}, @{noun3_name} Causing [[[[[[@{noun3}]] + @{Bonus_DEX} - @{target|BAR2}]]}]] Damages}} {{ = [Apply Damage](!token-mod --set bar1_value|-?{Damage Amount}! --ids @{target|token_id})}}? There isn't a way to take the roll for damage and stuff it into a TokenMod command as API commands must be on a separate line, and the $[[0]] trick doesn't work across lines.  Making it optional is hard also, short of an API button. If this is all part of a custom sheet and system, but is very regular and predictable, a custom API script could handle it by processing the roll template. 
1605114167
THIS is PERFECT! i tried and loved it, yeah my player will have to click 2 more times, but is great and does what i needed! thank yo, thank you thank you. also i don't have the capability for a custom API, so this will have to do :D  The Aaron said: The best I can come up with is: /em breathes, and attacks **@{target|token_name}** &{template:default} {{name=Attacks with DEX}} {{Weapon:= ?{Choose your weapon| @{noun1_name}, @{noun1_name} Causing [[[[[[@{noun1}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun2_name}, @{noun2_name} Causing [[[[[[@{noun2}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun3_name}, @{noun3_name} Causing [[[[[[@{noun3}]] + @{Bonus_DEX} - @{target|BAR2}]]}]] Damages}} {{ = [Apply Damage](!token-mod --set bar1_value|-?{Damage Amount}! --ids @{target|token_id})}}? There isn't a way to take the roll for damage and stuff it into a TokenMod command as API commands must be on a separate line, and the $[[0]] trick doesn't work across lines.  Making it optional is hard also, short of an API button. If this is all part of a custom sheet and system, but is very regular and predictable, a custom API script could handle it by processing the roll template. 
1605134601
Ok, I've been banging on this for too long now.  Time to ask the smart kids in the room.  I'm trying to create a toggle macro for Legacy Lighting.  (I'm not ready to pull the trigger on UDL just yet.)   I want it to toggle a 30 foot aura, but to also to toggle the light_dimradius between 15 and 0.  Using the !15 almost works, but it toggles between 15 and <null>, which doesn't quite do the same thing as 0 for the dim light setting.  Is there a way to set a toggle between two non-null values?  (Specifically 15 and 0)? Here's my macro.  For this particular situation the light radius won't change, just the dim. !token-mod --set aura1_radius|!30 light_dimradius|!15 --flip light_otherplayers Thanks!
1605136539
The Aaron
Forum Champion
API Scripter
There isn't, but I like that idea.
1605137142
Fair enough.  Thanks for the quick reply.   On and Off buttons it is!  
Hey Aaron, awesome work on all this stuff.  Love it. I looked around this thread and couldn't find the commands for "night vision effect" and "dimming" as a setting.  Can that be toggled through Token_Mod?
1605159508
The Aaron
Forum Champion
API Scripter
Those settings haven't been exposed to the API yet, but when they are I will add them. 
1605172029
The Aaron said: The best I can come up with is: /em breathes, and attacks **@{target|token_name}** &{template:default} {{name=Attacks with DEX}} {{Weapon:= ?{Choose your weapon| @{noun1_name}, @{noun1_name} Causing [[[[[[@{noun1}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun2_name}, @{noun2_name} Causing [[[[[[@{noun2}]] + @{Bonus_DEX} - @{target|BAR2}]]| @{noun3_name}, @{noun3_name} Causing [[[[[[@{noun3}]] + @{Bonus_DEX} - @{target|BAR2}]]}]] Damages}} {{ = [Apply Damage](!token-mod --set bar1_value|-?{Damage Amount}! --ids @{target|token_id})}}? There isn't a way to take the roll for damage and stuff it into a TokenMod command as API commands must be on a separate line, and the $[[0]] trick doesn't work across lines.  Making it optional is hard also, short of an API button. If this is all part of a custom sheet and system, but is very regular and predictable, a custom API script could handle it by processing the roll template.  The macros works great for the attacks, but i tried today to insert it in something like this: /em opens his book ?{Choose an ability| (Movement) Fast wind, and uses ** Fast Wind Lvl 1** "Right on schedule" Player ner me move +1 for [[d4 + @{Bonus_Int}]] **turn** !ammo @{Teferi|character_id} AP -40 Action Points| (Heal) Revitalize Lvl 1 D4, and uses ** Revitalize Lvl 1** on **@{target|token_name}** "*Sorry i'm late*" and he **recovers** [[d4 + @{Bonus_Intelligenza}]] **HP**. [Apply Healing](!token-mod --set bar1_value|-?{healed Amount! --ids @{target|token_id}) "*trust me. You'll thank me later!*" !ammo @{Teferi|character_id} AP -40 Action Points} But it doesn't work, i must have missed something i don't understand what (maybe is not possible to do it)! what i would like is: they chose the abilty to use, and the one in BOLD have the API button, but only those.  PS: is it possible to target multiple targets ? like to heal 3 players? sorry and thanks again, i really love to be able to do these thing alone without bothering you, but for the life of me, when things get beyond a macros roll i can't understand where to begin 
1605185659
The Aaron
Forum Champion
API Scripter
You're missing a } in this abs you probably want a + instead of a - for healing: bar1_value|-?{healed Amount! Like this: bar1_value|+?{healed Amount}! For multiples, you can specify multiple IDs and it will apply to all of them. If you're using @{target} for that, you'll need to add a label do you can distinguish them. 
1605186698

Edited 1605189164
Hi all, can't seem to get my head around how to run a macro depending on the dropdown. I want to have an altogether aura macro ?{Choose Aura |Live aura, |Private aura, |No aura, } I have each of the 3 options working separately but want to add them into a dropdown together without having to use nesting macros come up in the chat. Want it all from a dropdown. Can someone advise please.  Edit: Fixed it now but in case others were struggling. I incorporated it all into one macro below !token-mod {{  --set  aura1_radius|?{Aura Radius} ?{Choose Colour |Grey, aura1_color#666666 |Red, aura1_color#ff0000 |Orange, aura1_color#ff9900 |Yellow, aura1_color#ffff00 |Grass Green,aura1_color#6aa84f |Light Pink, aura1_color#a64d79 |Pastel Purple, aura1_color#8e7cc3 |Black, aura1_color#000000 |White, aura1_color#ffffff} ?{Show Aura |YES, --on showplayers_aura1 |NO, --off showplayers_aura1} }}
1605186903
thanks! i tried like this: /em opens his book ?{Choose an ability| (Movement) Fast wind, and uses ** Fast Wind Lvl 1** "Right on schedule" Player near me can move +1 for [[d4 + @{Bonus_Int}]] **turn** !ammo @{Teferi|character_id} AP -40 Action Points| (Heal) Revitalize Lvl 1 D4, and uses ** Revitalize Lvl 1** on **@{target|token_name}** "*Sorry i'm late*" and he **recovers** [[d4 + @{Bonus_Int}]] **HP**. [Apply Healing](!token-mod --set bar1_value|+?{healed Amount}! --ids @{target|token_id}) "*trust me. You'll thank me later!*" !ammo @{Teferi|character_id} AP -40 Action Points} if i only change that the drop down looks like this though: For multiple you mean like:    @{target|target1|token_id}, @{target|target2|token_id} or something of the like ? The Aaron said: You're missing a } in this abs you probably want a + instead of a - for healing: bar1_value|-?{healed Amount! Like this: bar1_value|+?{healed Amount}! For multiples, you can specify multiple IDs and it will apply to all of them. If you're using @{target} for that, you'll need to add a label do you can distinguish them. 
1605189934
The Aaron
Forum Champion
API Scripter
Ah, I didn't notice you had it in a Roll Query, try changing this: [Apply Healing](!token-mod --set bar1_value|+?{healed Amount}! --ids @{target|token_id}) to this: [Apply Healing](!token-mod --set bar1_value # +?{healed Amount}! --ids @{target|token_id}) the | in the API command is breaking the ?{ } prematurely.  Replacing it with # will let it continue.
The Aaron said: Those settings haven't been exposed to the API yet, but when they are I will add them.  As always, I appreciate it.  Shame though, as I think it's one of the better features of UDL and it'd be nice to set it on the fly opposed to manually updating each token. Keep being awesome!
1605211061

Edited 1605211135
Question: I am trying to save a token with a line "!token-mod --set defaulttoken", but when I run the line, it saves token, but it changes the token bar location to above, and token style to standard. is this normal behavior of the API? if not, what am I doing wrong?      
1605211408
The Aaron
Forum Champion
API Scripter
Those settings are not exposed to the API and further, the Roll20 function that stores the defaulttoken resets those fields to the default.  Unfortunately, there's no way around this right now.
1605212636
The Aaron said: Those settings are not exposed to the API and further, the Roll20 function that stores the defaulttoken resets those fields to the default.  Unfortunately, there's no way around this right now. Ah I see, but thanks anyway for the clarification and the awesome API! 
1605284967
Cool thank you! i'm getting closer!  didn't know about the #! now the first part works, but then this happens: /em opens his book ?{Choose an ability| (Movement) Fast wind, and uses ** Fast Wind Lvl 1** "Right on schedule" Player near me can move +1 for [[d4 + @{Bonus_Int}]] **turn** !ammo @{Teferi|character_id} AP -40 Action Points| (Heal) Revitalize Lvl 1 D4, and uses ** Revitalize Lvl 1** on **@{target|token_name}** "*Sorry i'm late*" and he **recovers** [[d4 + @{Bonus_Int}]] **HP**. [Apply Healing](!token-mod --set bar1_value#+?{healed Amount}! --ids @{target|token_id}) "*trust me. You'll thank me later!*" !ammo @{Teferi|character_id} AP -40 Action Points}   The Aaron said: Ah, I didn't notice you had it in a Roll Query, try changing this: [Apply Healing](!token-mod --set bar1_value|+?{healed Amount}! --ids @{target|token_id}) to this: [Apply Healing](!token-mod --set bar1_value # +?{healed Amount}! --ids @{target|token_id}) the | in the API command is breaking the ?{ } prematurely.  Replacing it with # will let it continue.
1605288331
The Aaron
Forum Champion
API Scripter
Hmm.. that's starting to get into Macro Escape Code Hell.  You might be able to get it working by swapping out various of the { and } for [ and ] if you want to try, but you might be approaching the "more trouble than it's worth" point.  I think this is where most people would recommend moving to Chat Menus instead of Roll Queries.
1605296182
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Obligatory  Chat Menu  link...
1605296399
The Aaron
Forum Champion
API Scripter
Thanks, was gonna ask you to drop that in here. =D
1605344677
The Aaron said: Hmm.. that's starting to get into Macro Escape Code Hell.  You might be able to get it working by swapping out various of the { and } for [ and ] if you want to try, but you might be approaching the "more trouble than it's worth" point.  I think this is where most people would recommend moving to Chat Menus instead of Roll Queries. I think you're right! not worth it, but thanks for helping me out anyway! chat menus is a world that i didn't explore yet, but definitely going to! seemed way to complex but might give it a try!
1605347792
me again... i'm trying to set up conditions with token mod, something like this, and it works great. /em uses Fast wind &{template:default} {{name=Tagged: Blessed}} {{description= You bless up to three creatures of your choice within range. Whenever a target makes an attack roll or a saving throw before the spell ends, the target can roll a d4 and add the number rolled to the attack roll or saving throw. At Higher Levels. When you cast this spell using a spell slot of 2nd level or higher, you can target one additional creature for each slot level above 1st. }} !token-mod --ids @{target|1|token_id} @{target|2|token_id} @{target|3|token_id} --set statusmarkers|blue:+1::5 what i'm wondering is, can i add a direction to token mod, so that when turn pass the condition is reduced and then disappear? exemple:  !token-mod --ids @{target|1|token_id} @{target|2|token_id} @{target|3|token_id} --set statusmarkers|blue:+[[d4+3]]::5 (and add a -1 so that every turn it goes from, lets say 5 to 4 then to 3 then to 2 then to 1 and then it expires?
1605376656
The Aaron
Forum Champion
API Scripter
No, TokenMod doesn't have a way of doing that.  There are other API scripts that are designed to track statuses and counters and automatically remove them.  I've not used any of them, so I'm not sure which one to recommend, but maybe someone else in the community has some recommendations.
1605393182

Edited 1605393383
Joe
Pro
I’ve had pretty good luck with Aaron’s OnMyTurn script combined with TokenMod decrementing a token status. I had some issues getting it to work at first, and my current workaround is to use the “ids“ to affect every token for that character on the page, but then don’t set that up for a monster with multiple tokens because it will trigger on every token’s turn, affecting all tokens each time!  That was a big oops on a recurring zombie map with a few dozen zombies. :-P •  Lin k to forum post with code •  Triggers token’s character’s Ability named “OnMyTurn” (if any) at start of turn This was Aaron’s suggestion in our old message thread; I was trying to automatically remove the status icon I use for “have used your reaction”: /w gm OnMyTurn test !token-mod --set statusmarkers|-interdiction --ids @{selected|character_id}
1605393550
Joe
Pro
Although I think to get it to work I had to use “ @{character_id}" instead and add --current-page.  I believe when the turn order advances it doesn’t actually select the next token, even when the TurnMarker script centers you on that token (maybe that could be a TurnMarker option?).
1605402507
The Aaron
Forum Champion
API Scripter
That's a good point, Joe.  OnMyTurn should be replacing the @{selected|...} with details about the token with the current turn, so doing something like: !token-mod --set statusmarkers|?blue:-1 --ids @{selected|token_id} in the OnMyTurn ability should decrement blue until it's zero and remove it, but only on the current Token.
Do you know what I have wrong in my script? I drag on a compendium monster pick a token image I like. Assign it to the relevant NPC in the journal then run the below macro. I sometimes have to run it twice to get the max health to appear in the token circle. Once the macro is done, I set the otken as default token manually but now when I drag on the tokens despite being named Giant 1 2 3 4 etc... they are updating their health altogether. any ideas? !token-mod {{  --set  bar1_link|npc_speed bar2_link|npc_ac bar3_link|hp  bar3_reset| name|"@{selected|character_name} '%%NUMBERED%%' " --on  showname  showplayers_bar3 !token-mod --set bar3_reset| !sortta }}
1605623834

Edited 1605624153
The Aaron
Forum Champion
API Scripter
Instead of setting the bar3_link to hp, you should set bar3 to @{selected|hp}: !token-mod {{ --set bar1_link|npc_speed bar2_link|npc_ac bar3|@{selected|hp} name|"@{selected|character_name} '%%NUMBERED%%' " --on showname showplayers_bar3 }} setting bar3 is like setting bar3_current and bar3_max to the same value, so no reset is required. You also have some API commands at the bottom which would be discarded.  You'd need to put them after the }} on the following line if you want them run.