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

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

September 26 (3 years ago)
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.  :-)

September 26 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

That's a good suggestion!

October 05 (3 years ago)
The Aaron
Roll20 Production Team
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
October 05 (3 years ago)
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. ;-) 

October 05 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

I have sooooooooo many.

October 05 (3 years ago)
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? :-)

October 05 (3 years ago)

Im assuming the tooltip function isnt live yet.

I think it's actually the toggle that's broken.

October 06 (3 years ago)
The Aaron
Roll20 Production Team
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.

October 06 (3 years ago)

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!

October 06 (3 years ago)


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.  

October 06 (3 years ago)


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.

October 06 (3 years ago)
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.

October 11 (3 years ago)

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?



October 11 (3 years ago)

Edited October 11 (3 years ago)
The Aaron
Roll20 Production Team
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.

October 20 (3 years ago)

Edited October 20 (3 years ago)

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}
October 25 (3 years ago)

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.

October 25 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Hmm.  Not yet, but I'll see what I can do. =D

October 25 (3 years ago)

Is it possible to override the size of the tooltip field (150 characters that Roll20 gives)?

October 25 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

There is no limit to the size that can be set to the tooltip by the API.

October 25 (3 years ago)

Very cool - thanks. The 150 limit ....limits what I may want to do with it.

October 26 (3 years ago)
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| 
}} 
October 26 (3 years ago)


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!


October 27 (3 years ago)
The Aaron
Roll20 Production Team
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}]" 
}}
October 27 (3 years ago)

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}]" 
}}




October 27 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

That's a feature I need to implement. There isn't a way to reference the current tool tip. 

October 27 (3 years ago)

Edited October 27 (3 years ago)
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.

October 27 (3 years ago)

Edited October 27 (3 years ago)

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?

October 27 (3 years ago)

Edited October 27 (3 years ago)

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?

October 27 (3 years ago)
The Aaron
Roll20 Production Team
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. 

October 27 (3 years ago)

Yeah I tried ChatSetAttr and the API threw an error that looks like it comes from the character sheet. 

"(node:25) UnhandledPromiseRejectionWarning: ReferenceError: CustomEvent is not defined
    at setActiveCharacterId (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>:22:14)
    at eval (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>:63:9)
    at <anonymous>
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async worker (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>:126:17)
    at async Array.accessSheet (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>: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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (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. 


October 28 (3 years ago)
timmaugh
Pro
API Scripter


keithcurtis said:


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? 

*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"

October 28 (3 years ago)
The Aaron
Roll20 Production Team
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. 

--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? 

*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"




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. 

"(node:25) UnhandledPromiseRejectionWarning: ReferenceError: CustomEvent is not defined
    at setActiveCharacterId (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>:22:14)
    at eval (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>:63:9)
    at <anonymous>
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async worker (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>:126:17)
    at async Array.accessSheet (eval at messageHandler (evalmachine.<anonymous>:713:6), <anonymous>: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 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (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. 





October 29 (3 years ago)

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.

October 29 (3 years ago)
The Aaron
Roll20 Production Team
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. 

October 29 (3 years ago)


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

October 30 (3 years ago)

+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




October 30 (3 years ago)


Ashley S. said:

Hi guys,
I am using token-mod for wild shape as described in this video: https://www.youtube.com/watch?v=p4lpuEnxxHI 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.  Repeat and place in a folder called "Bormin's forms".  So much easier, even though it seems complicated.

Otherwise, you can add attributes on your character sheet and adjust them with Chatsetattr.  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.  Then you can make "Current_STR", use CSA to adjust it, and voila.  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.  She even has a popout chat list of values to input for each creature.  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_.  Maryna's Previous HP of @{Maryna|hp}/ 136 is now _CUR1_/ _MAX1_.  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.  Mods to Strength must be turned off for Wildshapes|11}
--dexterity|?{What is the Wildshape's Dexterity? Maryna = 15.  Mods to Dexterity must be turned off for Wildshapes|15}
--constitution|?{What is the Wildshape's Constitution? Maryna = 14.  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_.  Maryna's Previous HP of @{Maryna|hp}/ 136 is now _CUR1_/ _MAX1_.  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)"
}}
October 31 (3 years ago)

Edited October 31 (3 years ago)

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}]]

October 31 (3 years ago)
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}]]
October 31 (3 years ago)


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_'.

October 31 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Not sure where all those npcds 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 D&D 5th Edition by Roll20 Sheet?

October 31 (3 years ago)

Edited October 31 (3 years ago)

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&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.

October 31 (3 years ago)


keithcurtis said:

Not sure where all those npcds 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 D&D 5th Edition by Roll20 Sheet?

The D&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. 

November 01 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Wow. New to me.

November 01 (3 years ago)

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)?