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.

1632616801
Joe
Pro
That worked great, thanks!  That tip about selecting a token and pressing Z, then right-clicking might be a good addition to the help handout in the imgsrc section.  :-)
1632634943
The Aaron
Forum Champion
API Scripter
That's a good suggestion!
1633461889
The Aaron
Forum Champion
API Scripter
Update v0.8.72 -- Added support for Tooltips with the tooltip and show_tooltip properties: !token-mod --set tooltip|"Hey, you can see this on hover!" --on show_tooltip
1633462065
Joe
Pro
Thanks for keeping on top of the latest updates, even if I don’t have any particular use in mind for this new feature. ;-) 
1633465051
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I have sooooooooo many.
1633466244
Joe
Pro
keithcurtis said: I have sooooooooo many. LOL. That’s great!  Can you link to another thread where you have already listed some or all of those, to not clutter this one by me asking for them directly? :-)
1633477794
Im assuming the tooltip function isnt live yet.
1633478009
I think it's actually the toggle that's broken.
1633479466
The Aaron
Forum Champion
API Scripter
There is a bug with the toggle right now to where the UI doesn't match what is in the object, so if you've used the UI, you might have to hit it a few times to make it work correctly, particularly if you are using --flip.
1633535257
Joe said: keithcurtis said: I have sooooooooo many. LOL. That’s great!  Can you link to another thread where you have already listed some or all of those, to not clutter this one by me asking for them directly? :-) I asked the same question here  - I've already seen a couple responses with some great ideas!
1633548684
keithcurtis said: I have sooooooooo many. I do too.  I hope they add a new toggle for showing to GM, but not Player.  I can see adding it to a map-info process or automating quirky statements when a particular NPC is damaged or fails a saving throw.  There are probably a hundred ways to take advantage of this tooltip field.  
1633554432
The Aaron said: Update v0.8.72 -- Added support for Tooltips with the tooltip and show_tooltip properties: !token-mod --set tooltip|"Hey, you can see this on hover!" --on show_tooltip Marvellous! But it's not online, isn't it? My API is set on 'Latest' and it's just v0.08.71.
1633562105
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Scripts get pulled on Tuesday mornings and are generally available by Wednesday morning. You can always install manually if you wish, but you will lose auto updates.
1633966963
GM
Pro
This macro is no longer working: (2 player tokens named Kalah and Gethsemane) !token-mod --set currentside|2 --ids @{Kalah|character_id} @{Gethsemane|character_id} These tokens are from rollable tables and simply update the 2 tokens to show their combat stance vs. their player portraits - helpful during combat to reflect their facing.  It was working without me having to select each token manually. Is there any NEW way I could accomplish this to update all of my PLAYERS tokens when they get into combat?
1633967502

Edited 1633967536
The Aaron
Forum Champion
API Scripter
That should work.  Check that your API is still running.  Also, it will only work if the images are in a user library and not in the Marketplace.  Also, it's based on the Character Names, not the Token Names, so be sure those haven't been changed.
1634718305

Edited 1634731779
Hey there, the forum posts about token mod are insane. I am sure about there´s an answer to my question, but i cant find it :( I used token_mod for the legacy dynamic lightning setup for my players in this way: !token-mod --set ?{Vision|Torch, light_radius#40 light_dimradius#20 light_hassight#yes light_angle#360 light_otherplayers#yes|Hooded Lantern, light_radius#60 light_dimradius#30 light_hassight#yes light_angle#360 light_otherplayers#yes|Bullseye Lantern, light_radius#120 light_dimradius#60 light_angle#60 light_hassight#yes light_otherplayers#yes|Lamp, light_radius#30 light_dimradius#15 light_hassight#yes light_angle#360 light_otherplayers#yes|Candle, light_radius#5 light_dimradius#=0 light_hassight#yes light_angle#360 light_otherplayers#yes|Darkvision, light_radius#60 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Darkvision (90'), light_radius#90 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Warlock Devil's Sight, light_radius#120 light_dimradius#=120 light_hassight#yes light_angle#360 light_otherplayers#no|No light source(Dusk), light_radius#120 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Fog, light_radius#200 light_dimradius#=5 light_hassight#yes light_angle#360 light_otherplayers#no|No light source, light_radius#5 light_dimradius#=-5 light_hassight#yes light_angle#360 light_otherplayers#no|Blinded, light_hassight#no light_angle#360 light_otherplayers#no} I tried a lot to adjust it with the UDL, but i cant handle it. Any Ideas, links or solutions to an existing post would be helpful aswell. Thank you so much Greetings Edit says: I found something i worked with - Thanks to keithcurtis :) Players can set Vision: On, Off, Blindfighting, Darkvision 60/90/120/300/Off, Devils Sight 120 !token-mod --set ?{Vision|On, has_bright_light_vision#on has_night_vision#on light_angle#360|Off, has_bright_light_vision#off has_night_vision#off light_angle#360|Blindfighting, has_bright_light_vision#on has_night_vision#on night_vision_distance#10 light_angle#360|Darkvision 60, has_bright_light_vision#on has_night_vision#on night_vision_distance#60 light_angle#360 night_vision_effect#nocturnal|Darkvision 90, has_bright_light_vision#on has_night_vision#on night_vision_distance#90 light_angle#360 night_vision_effect#nocturnal|Darkvision 120, has_bright_light_vision#on has_night_vision#on night_vision_distance#120 light_angle#360 night_vision_effect#nocturnal|Darkvision 300, has_bright_light_vision#on has_night_vision#on night_vision_distance#300 light_angle#360 night_vision_effect#nocturnal|Darkvision Off, has_bright_light_vision#on has_night_vision#off night_vision_distance#0 light_angle#360|Devils Sight 120, has_bright_light_vision#on has_night_vision#on night_vision_distance#120 light_angle#360 night_vision_effect#nocturnal} Players can set Light Source: On, Off,Spot, Candle, Lamp, Torch, Hooded Lantern, Bullseye Lantern, Light Cantrip, Dancing Lights, Daylight Spell, Faerie Fire, Gem of Brightness, Crown of 4+/1-3 Stars, Sunblade 10/10,15/15, 20/20, 25/25, 30/30 !token-mod --set ?{Light|On, emits_bright_light#on emits_low_light#on light_angle#360|Off, emits_bright_light#off emits_low_light#off light_angle#360|Spot 5ft, emits_bright_light#on bright_light_distance#5 low_light_distance#0 light_angle#360|Candle, emits_bright_light#on emits_low_light#on bright_light_distance#2 low_light_distance#5 light_angle#360|Lamp, emits_bright_light#on emits_low_light#on bright_light_distance#15 low_light_distance#15 light_angle#360|Torch, emits_bright_light#on emits_low_light#on bright_light_distance#20 low_light_distance#20 light_angle#360|Hooded Lantern, emits_bright_light#on emits_low_light#on bright_light_distance#30 low_light_distance#30 light_angle#360|Bullseye Lantern, emits_bright_light#on emits_low_light#on bright_light_distance#60 low_light_distance#60 light_angle#90|Light Cantrip, emits_bright_light#on emits_low_light#on bright_light_distance#20 low_light_distance#20 light_angle#360|Dancing Lights, emits_bright_light#off emits_low_light#on bright_light_distance#0 low_light_distance#10 light_angle#360|Daylight Spell, emits_bright_light#on emits_low_light#on bright_light_distance#60 low_light_distance#60 light_angle#360|Faerie Fire, emits_bright_light#off emits_low_light#on bright_light_distance#0 low_light_distance#10 light_angle#360|Gem of Brightness, emits_bright_light#on emits_low_light#on bright_light_distance#30 low_light_distance#30 light_angle#360|Crown of 4+ Stars, emits_bright_light#on emits_low_light#on bright_light_distance#30 low_light_distance#30 light_angle#360|Crown of 1-3 Stars, emits_bright_light#off emits_low_light#on bright_light_distance#0 low_light_distance#30 light_angle#360|Sunblade 10/10, emits_bright_light#on emits_low_light#on bright_light_distance#10 low_light_distance#10 light_angle#360|Sunblade (1st)15/15, emits_bright_light#on emits_low_light#on bright_light_distance#15 low_light_distance#15 light_angle#360|Sunblade 20/20, emits_bright_light#on emits_low_light#on bright_light_distance#20 low_light_distance#20 light_angle#360|Sunblade 25/25, emits_bright_light#on emits_low_light#on bright_light_distance#25 low_light_distance#25 light_angle#360|Sunblade 30/30, emits_bright_light#on emits_low_light#on bright_light_distance#30 low_light_distance#30 light_angle#360}
1635124236
A great script! I am making much use of it for my Gurps game. However, is there any way to append additional text in tooltip? !token-mod --set tooltip|"Test" just overwrites it.
1635129563
The Aaron
Forum Champion
API Scripter
Hmm.  Not yet, but I'll see what I can do. =D
1635171744
Is it possible to override the size of the tooltip field (150 characters that Roll20 gives)?
1635175883
The Aaron
Forum Champion
API Scripter
There is no limit to the size that can be set to the tooltip by the API.
1635181247
Very cool - thanks. The 150 limit ....limits what I may want to do with it.
1635223972
Andrew R.
Pro
Sheet Author
I've just updated my Mook_Setup macro for 13th Age to use the tooltip feature.  !token-mod {{ --set tooltip|"AC @{selected|npc_AC} PD @{selected|npc_PD} MD @{selected|npc_MD}" --on showname showplayers_name showplayers_bar1 showplayers_bar2 showplayers_bar3 show_tooltip --set aura1_radius| aura2_radius| --off showplayers_aura1 showplayers_aura2 --set statusmarkers|=dead|-dead --set bar1_link| bar2_link| bar3_link|npc_HP represents| }}
1635278896
tooltip|"AC @{selected|npc_AC} PD @{selected|npc_PD} MD @{selected|npc_MD} Hey, nice idea to show such stuff like AC as a tooltip, Would be great then if tooltip had an option 'visible to GM'. Like many other token features. But great idea!
1635295933
The Aaron
Forum Champion
API Scripter
I've put things like that in the Token's name at times: !token-mod {{ --on showname --off showplayers_name --set name|"@{selected|character_name} [AC:@{selected|npc_AC}]" }}
1635351903
was playing trying to ue this with Tooltip.  --set toolto|"@{selected|character_tooltip} prone" But the  selected|character_tooltip is not the correct format, what should this be to add to the current tooltip?  The Aaron said: I've put things like that in the Token's name at times: !token-mod {{ --on showname --off showplayers_name --set name|"@{selected|character_name} [AC:@{selected|npc_AC}]" }}
1635352097
The Aaron
Forum Champion
API Scripter
That's a feature I need to implement. There isn't a way to reference the current tool tip. 
1635352144

Edited 1635352434
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Bob DM S. said: was playing trying to ue this with Tooltip.  --set toolto|"@{selected|character_tooltip} prone" But the  selected|character_tooltip is not the correct format, what should this be to add to the current tooltip?  The Aaron said: I've put things like that in the Token's name at times: !token-mod {{ --on showname --off showplayers_name --set name|"@{selected|character_name} [AC:@{selected|npc_AC}]" }} Try @{selected|tooltip} Nope. Sorry for the misdirect.
1635367623

Edited 1635367689
I have what may be an odd question: So I'm in a Mutants & Masterminds game where each injury reduces your toughness by 1 for further toughness checks.  I've assigned a token's bar 1 value to the attribute injuries. When I manually type a number there and press enter, the sheet injuries stat changes as well as the toughness. But if I use !token-mod --set bar1_value|+1, the injuries change but the toughness does not. I assume this is related to the some APIs not triggering sheet workers bug.  Is there a way to simulate an enter press after setting the bar1 value on the token?
1635367867

Edited 1635367925
I'm not sure of a direct  answer to your question, but I think you could also achieve the desired outcome with a ChatSetAttr call to the appropriate attribute. (You might also be able to do *just* the ChatSetAttr call and have it modify on the token as well. Or you can try using AlterBars, which should work, too.) I assume you've also verified that the bar1_link property is correct? And that it doesn't break when you do the --set bar1_value|+1 command?
1635368872
The Aaron
Forum Champion
API Scripter
Second what Colin is saying. For attributes, there's a setWithWorker() function that triggers worker events. I've not tired it with tokens, but I'd bet it wouldn't work, if it's even callable on token objects. ChatSetAttr certainly have the capability to trigger worker updates, which would get propagated to the bars. 
1635369818
Yeah I tried ChatSetAttr and the API threw an error that looks like it comes from the character sheet.&nbsp; "(node:25) UnhandledPromiseRejectionWarning: ReferenceError: CustomEvent is not defined &nbsp; &nbsp; at setActiveCharacterId (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:22:14) &nbsp; &nbsp; at eval (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:63:9) &nbsp; &nbsp; at &lt;anonymous&gt; &nbsp; &nbsp; at processTicksAndRejections (internal/process/task_queues.js:97:5) &nbsp; &nbsp; at async worker (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:126:17) &nbsp; &nbsp; at async Array.accessSheet (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:578:32)" "(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see <a href="https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode" rel="nofollow">https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode</a>). (rejection id: 2)" "(node:25) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code." So I was basically trying to see if I could do an end run around it and poke the bear to get going.&nbsp;
1635429542
timmaugh
Pro
API Scripter
keithcurtis said: Bob DM S. said: was playing trying to ue this with Tooltip.&nbsp; --set toolto|"@{selected|character_tooltip} prone" But the&nbsp; selected|character_tooltip is not the correct format, what should this be to add to the current tooltip?&nbsp; *SNIP* Try @{selected|tooltip} Nope. Sorry for the misdirect. You can get it with a Fetch construction: @(selected.tooltip) And then use it within the quotes as you normally would: "@(selected.tooltip) prone"
1635432657
The Aaron
Forum Champion
API Scripter
Be sure to install the Fetch script from the 1-click installs, you may need to do some shuffling to get it in place, meta scripts need to be as close to first in the sandbox as possible. timmaugh said: keithcurtis said: Bob DM S. said: was playing trying to ue this with Tooltip.&nbsp; --set toolto|"@{selected|character_tooltip} prone" But the&nbsp; selected|character_tooltip is not the correct format, what should this be to add to the current tooltip?&nbsp; *SNIP* Try @{selected|tooltip} Nope. Sorry for the misdirect. You can get it with a Fetch construction: @(selected.tooltip) And then use it within the quotes as you normally would: "@(selected.tooltip) prone"
1635434235
You have now reached the limit of my programming knowledge. Erik M. said: Yeah I tried ChatSetAttr and the API threw an error that looks like it comes from the character sheet.&nbsp; "(node:25) UnhandledPromiseRejectionWarning: ReferenceError: CustomEvent is not defined &nbsp; &nbsp; at setActiveCharacterId (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:22:14) &nbsp; &nbsp; at eval (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:63:9) &nbsp; &nbsp; at &lt;anonymous&gt; &nbsp; &nbsp; at processTicksAndRejections (internal/process/task_queues.js:97:5) &nbsp; &nbsp; at async worker (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:126:17) &nbsp; &nbsp; at async Array.accessSheet (eval at messageHandler (evalmachine.&lt;anonymous&gt;:713:6), &lt;anonymous&gt;:578:32)" "(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see <a href="https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode" rel="nofollow">https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode</a>). (rejection id: 2)" "(node:25) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code." So I was basically trying to see if I could do an end run around it and poke the bear to get going.&nbsp;
1635490851
Is it possible to use Token-Mod to edit drawings? I really want to be able to set some macros for moveable blocks that block light, but can't figure a way to do it. Putting a token on the light layer doesn't block light, and I can't see a way for token-mod to manipulate drawings.
1635515784
The Aaron
Forum Champion
API Scripter
TokenMod only works on Graphic objects. If all you need is movement options by ID, I can probably write you something as a one-off pretty easily.&nbsp;
1635522834
Davyd said: Is it possible to use Token-Mod to edit drawings? I really want to be able to set some macros for moveable blocks that block light, but can't figure a way to do it. Putting a token on the light layer doesn't block light, and I can't see a way for token-mod to manipulate drawings. This would be fantastic for very large creatures, the Golem or Giant beast blocking vision as it lumbers toward the victims party
+1 al e. said: Davyd said: Is it possible to use Token-Mod to edit drawings? I really want to be able to set some macros for moveable blocks that block light, but can't figure a way to do it. Putting a token on the light layer doesn't block light, and I can't see a way for token-mod to manipulate drawings. This would be fantastic for very large creatures, the Golem or Giant beast blocking vision as it lumbers toward the victims party
Ashley S. said: Hi guys, I am using token-mod for wild shape as described in this video: <a href="https://www.youtube.com/watch?v=p4lpuEnxxHI" rel="nofollow">https://www.youtube.com/watch?v=p4lpuEnxxHI</a> Currently, when shifting it displays each creatures hp from their sheets but I am trying to make it roll hp each time I shift instead. The macro I am currently using is: /w gm Bormin Duskpike wills himself to transform! !token-mod {{ --set ?{Choose Form|Brown Bear,currentside#1 represents#@{ Brown Bear |character_id} width#[[2*70]] height#[[2*70]] |Giant Wolf Spider,currentside#2 represents#@{Giant Wolf Spider|character_id} width#[[70]] height#[[70]] |Dire Wolf,currentside#3 represents#@{Dire Wolf|character_id} width#[[2*70]] height#[[2*70]] |Giant Octopus,currentside#4 represents#@{Giant Octopus|character_id} width#[[2*70]] height#[[2*70]] |Bormin Duskpike,currentside#5 represents#@{Bormin Dustpike|character_id} width#[[70]] height#[[70]] } bar1_link|hp bar2_link|ac bar3_link|speed name|"Bormin Duskpike" showname|yes }} I found out about using bar1[[4d10+12]] (or whatever the equation for the creature in question is) but I am not sure how I would go about implementing it in this macro for each individual form. The idea is to roll HP for all my forms excluding my player character. Any help is appreciated. I did something long and complex like this, but honestly, it's just easier to duplicate a copy of the Base Creature, Adjust the name to something like "Bormin - Octopus", reset the token to the "Bormin - Octopus" character sheet (it will default to the original Octopus), and change Int, Wis, and Cha to Bormin's values, then give access to Bormin.&nbsp; Repeat and place in a folder called "Bormin's forms".&nbsp; So much easier, even though it seems complicated. Otherwise, you can add attributes on your character sheet and adjust them with Chatsetattr.&nbsp; Just remember to make one of the attributes "Original_STR" and so on, so you can revert to your original form from the values set there.&nbsp; Then you can make "Current_STR", use CSA to adjust it, and voila.&nbsp; But its a lot of programming at the macro/ API use level on one of the two powerscripts, so it will take a lot of trial and error. But trust me, this method gets very involved, and even this is simplified for a character in one of my games playing a level 19 druid.&nbsp; She even has a popout chat list of values to input for each creature.&nbsp; It's just easier to drop in another token, honestly. Revert to Human: !token-mod {{ --ids @{Maryna|character_id} --set scale|1g --current-page --report player|"Maryna's size changed to 1 grid square(s)" }} !setattr {{ --name Maryna --normal_hp|136 --hp|@{Maryna|normal_hp}|136 --strength|11 --dexterity|15 --constitution|14 --current_shape|Variant Human --fb-header Wildshape Form Changed from @{Maryna|current_shape} --fb-content Changed Current Shape to _CUR5_.&nbsp; Maryna's Previous HP of @{Maryna|hp}/ 136 is now _CUR1_/ _MAX1_.&nbsp; Maryna's Strength score is now _CUR2_ (normally 11 base), Dexterity score is now _CUR3_ (normally 15 base), and Constitution score is now _CUR4_ (normally 14 base). }} Change to Animal: !setattr {{ --name Maryna --normal_hp|@{Maryna|hp} --hp|?{What is the Wildshape's average HP? Maryna = 136 at Lvl 19|136}|?{What is the Wildshape's average HP? Maryna = 136 at Lvl 19|136} --strength|?{What is the Wildshape's Strength? Maryna = 11.&nbsp; Mods to Strength must be turned off for Wildshapes|11} --dexterity|?{What is the Wildshape's Dexterity? Maryna = 15.&nbsp; Mods to Dexterity must be turned off for Wildshapes|15} --constitution|?{What is the Wildshape's Constitution? Maryna = 14.&nbsp; Mods to Constitution must be turned off for Wildshapes|14} --current_shape|?{Current Shape?|Variant Human|Giant Shark|Giant Eagle|Giant Elk|Mastiff|Weasel|War Horse|Elephant|Air Elemental|Earth Elemental|Fire Elemental|Water Elemental|Saber Tooth Tiger|Plesiosaurus|Triceratops} --fb-header Wildshape Form Changed from @{Maryna|current_shape} --fb-content Changed Current Shape to _CUR5_.&nbsp; Maryna's Previous HP of @{Maryna|hp}/ 136 is now _CUR1_/ _MAX1_.&nbsp; Maryna's Strength score is now _CUR2_ (normally 11 base), Dexterity score is now _CUR3_ (normally 15 base), and Constitution score is now _CUR4_ (normally 14 base). }} !token-mod {{ --ids @{Maryna|character_id} --set scale|?{What Size is the Creature?|Normal Human Form,1|T-iny,0.25|S-mall,0.5|M-edium,1|L-arge,2|H-uge,3|G-argantuan,4}g --current-page --report player|"Maryna's size changed to ?{What Size is the Creature?|Normal Human Form,1|T-iny,0.25|S-mall,0.5|M-edium,1|L-arge,2|H-uge,3|G-argantuan,4} grid square(s)" }}
1635664544

Edited 1635664581
I found out about using bar1[[4d10+12]] (or whatever the equation for the creature in question is) but I am not sure how I would go about implementing it in this macro for each individual form. The idea is to roll HP for all my forms excluding my player character. Any help is appreciated. Hi Ashley, I think I saw in one of your games that you also use the VTT Enhancement Suite. There is a possibility to roll hp very easily: But you can do it also with token-mod: !token-mod --set bar1|[[@{selected|npcd_hpformula}]]
1635665088
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Without something like VTTES or the API script SelectManager, That Token-mod macro will apply the same roll result to all selected tokens. I think there's a typo there, too. Shouldn't it be: !token-mod --set bar1|[[@{selected|npc_hpformula}]]
1635675246
keithcurtis said: Without something like VTTES or the API script SelectManager, That Token-mod macro will apply the same roll result to all selected tokens. I think there's a typo there, too. Shouldn't it be: !token-mod --set bar1|[[@{selected|npc_hpformula}]] Yeah, that's always the problem that it's the same for all selected tokens. But since Ashley wanted to use it for his Wild Shape macro, that would do. There should always be only the druid selected (aka: was to lazy to write the name of the character instead of 'selected' :-) ). Therefore the VTT Enhancement solution is better because it works for all selected tokens. But to include it in his macro he has to use the token-mod way of course. The naming of attributes in roll20 is usually a miracle to me. For the sheet I used there is a weird mixture of attributes with prefixes 'npcd_' and 'npc_'. The hpformula for me with 'npcd_'.
1635697038
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Not sure where all those npcd s are coming from. I don't see them on any of my NPC sheets. Could it be something VTTES is adding? If so, I'd be cautious about using it. OTOH, you said "for the sheet [you] used". Are you using something other than the current&nbsp;D&amp;D 5th Edition by Roll20 Sheet?
1635716038

Edited 1635716633
Maybe they are from older roll20 versions? My games are usually not new, but often a year old. I don't think, VTTE is adding attributes. But that's no problem. My macro works (for my sheets). Everybody should look up how the attributes are named. I am using always the D&amp;D 5E sheet by roll20. Not the shaped or other one. With "sheets I am using" I meant my suspect that the attributes are changing with roll20 versions. And that this might be different with other sheets.
1635716947
keithcurtis said: Not sure where all those npcd s are coming from. I don't see them on any of my NPC sheets. Could it be something VTTES is adding? If so, I'd be cautious about using it. OTOH, you said "for the sheet [you] used". Are you using something other than the current&nbsp;D&amp;D 5th Edition by Roll20 Sheet? The D&amp;D 5E by Roll20 sheet previously used both npc_ and npcd_ attributes. The npcd_ attributes were used for what was displayed while the character sheet was opened, and the sheet workers would update the npc_ values upon closing the sheet. I believe they are deprecated or hidden from the attributes and abilities page now.&nbsp;
1635726899
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Wow. New to me.
1635785471
This is a heck of a thread, is there any capabilities with token mod, or any other script to have conditionals. for example: if health(bar 3) is below a threshold(constant) add a dice(Roll)?