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.

1650122023
@Ferry, I assume you are looking for something more than letting the players see the HP bar of tokens? 'Cuz that's easy to set up, requires no API (it's what I do).
This may have been mentioned already but I find it hard to parse this thread. I just started using api/token-mod and I've noticed that after setting the default token vision settings it does not work right. My token still have night vision just fine if they had it set and it "appears" to maintain all the setting when dropping new tokens but the token can not see any other light source until I manually turn their vision off and then on, or change/update any other setting and then it starts working perfectly.   Saving all the other setting is better than nothing I suppose, but that's a strange bug.   I've also tried just toggling vision on and off using a macro as well but it doesn't seem to work. I have to manually open the sheet, turn off vision, then turn it back on again to fix it.   I feel like maybe I'm just missing something since I can't seem to find any other references to this issue  on a quick search and it seems like something people would talk about more than the ultra specific and niche problems I keep seeing otherwise. So am I doing something stupid here? For step by step, all I'm doing is dragging a token onto the map (A map that contains some dark areas and a couple of light sources), setting up it's lighting manually (I've tried setting it via script as well and get the same problem), then running the defaulttoken command via token mod. Delete the token and drag a new on onto the map of the same character. The new token will be able to see dark areas via its dark vision but its vision will completely occluded where there is supposed to be a light source from the map. Opening the token setting screen and adjusting any setting or turning the vision option off and on again fixes it and it will work perfectly from then on.
1650131636
Michael R. said: This may have been mentioned already but I find it hard to parse this thread. I just started using api/token-mod and I've noticed that after setting the default token vision settings it does not work right. My token still have night vision just fine if they had it set and it "appears" to maintain all the setting when dropping new tokens but the token can not see any other light source until I manually turn their vision off and then on, or change/update any other setting and then it starts working perfectly.   Saving all the other setting is better than nothing I suppose, but that's a strange bug.   I've also tried just toggling vision on and off using a macro as well but it doesn't seem to work. I have to manually open the sheet, turn off vision, then turn it back on again to fix it.   I feel like maybe I'm just missing something since I can't seem to find any other references to this issue  on a quick search and it seems like something people would talk about more than the ultra specific and niche problems I keep seeing otherwise. So am I doing something stupid here? For step by step, all I'm doing is dragging a token onto the map (A map that contains some dark areas and a couple of light sources), setting up it's lighting manually (I've tried setting it via script as well and get the same problem), then running the defaulttoken command via token mod. Delete the token and drag a new on onto the map of the same character. The new token will be able to see dark areas via its dark vision but its vision will completely occluded where there is supposed to be a light source from the map. Opening the token setting screen and adjusting any setting or turning the vision option off and on again fixes it and it will work perfectly from then on. I’ve experienced a UDL bug where a player did not see anything on the screen until their token was physically moved. It’s been a while since I’ve seen it, but I wonder if this is the same thing - when this happens have you tried just moving the token? There are also some other ‘set as default’ bugs that have been around, so this may be one of those  
1650132202
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
IIRC, there is a bug that still causes this when a token does not have 360° of light, say with a bullseye lantern, or in a game where facing and field of view is critical.
1650144548

Edited 1650148864
Thank you for the responses. So this isn't normal, that's unfortunate, I had hoped I screwed some minor up. I have moved the token around, the night vision follows it around and it can see everywhere except where there is a light source. The character token does not emit light of any kind, the light sources placed on the map are 360°. Well to be fair I assume the dark vision is actually emitting light behind the scenes just only visible to the token that has the darkvision, but I'm not sure of course and in either case it would be equivalent to 360°. I'll edit in some pictures in a bit here to illustrate as I might be doing a poor job of explaining the issue. So first is the view after rejoining as a player with a token that has been set up to have dark vision that is green in color. There light sources in the rooms to the upper right, and lower left and right. this is working fine. At this point the token is selcted and --set defaulttoken is run in GM mode. Here is an image after placing a new token from the character list by dragging it onto the battle field, it retains its night vision in green and that works fine, except where it would overlap what should be lit by a light source, those spots are completely dark now. And finally after going to GM mode, doubel clicking the token, turning off its vision and then turning it back on without touching anything else, then going back to player mode just to make it more visible, the vision works flawlessly again. I've tried many variations and ordering, and this problem is present without going to player mode(that just makes it easier to see I think), I've set the default token with macros and chat commands, I've set and unset different settings with macros and commands, and it seems the only thing that fixes it is simply turning it off and on again. which is still better than nothing, at least the setting are saved but it is very odd and I don't understand it as it seems like behavior that other are not experiencing.
1650150243
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Remove all tinting from light and vision. It's a very quirky feature and should never be used where it can overlap with other effects. See if that clears it up. Use "Nocturnal" instead. It obeys 5e darkvision rules and is much less apt to cause problems.
Thank you the suggestion, unfortunately that did not seem to change the issue at all. I tried both "noturnal" and"none" with no change, as well as removing the tinting again (though I believed I had done that before adding tinting to see the night vision vs normal lighting better) and that had no effect as well. 
I have found a solution, I thikn. turning on "Explore mode" for page setting seems to have fixed it.   Didn't really feel like enabling that 100% of the time, but so be it. It's not a huge issue though perhaps should be reported to the bug tracker. not sure. I'm not very familiar with git so don't feel comfortable doing that. Thank you again for offering solutions, even if they weren't specifically what I needed this time around, the forums are remarkably helpful here.
1650203241
There is a bug where a token with nightvision (even without tint or coloured light sources) will see bright light sources as black when dragged to the page or copied to the page or even if using a script like Tokenmod to change vision. Sometimes, also, the token will not see anything. Simply opening the token settings and saving them will fix the vision so they see bright light normally. This is what I have to do when I put tokens on a page. Every. Single. Time. The devs are aware of it but no fix yet. I haven't tried the Explorer mode setting workaround. 
1650217939
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Doug E. said: There is a bug where a token with nightvision (even without tint or coloured light sources) will see bright light sources as black when dragged to the page or copied to the page or even if using a script like Tokenmod to change vision. Sometimes, also, the token will not see anything. Simply opening the token settings and saving them will fix the vision so they see bright light normally. This is what I have to do when I put tokens on a page. Every. Single. Time. The devs are aware of it but no fix yet. I haven't tried the Explorer mode setting workaround.  This is the only real UDL bug I occasionally have to deal with. Unfortunately, the occurrence and the fix you recommend don't consistently work for me.
1650247633

Edited 1650286024
Hello again Someone mentionned an issue he had with a token-mod usage, and a similar issue i had got fix in another script, so i thought you might find it usefull to look at maybe, <a href="https://app.roll20.net/forum/post/10778856/script-bug-duplicate-a-character-and-token-not-really-setting-bar-link/?pageforid=10779021#post-10779021" rel="nofollow">https://app.roll20.net/forum/post/10778856/script-bug-duplicate-a-character-and-token-not-really-setting-bar-link/?pageforid=10779021#post-10779021</a> Have a good day everyone
1650249318
The Aaron
Forum Champion
API Scripter
Hmm. Do you have an example of a TokenMod command with the issue?
1650284993
i'm not using it like this but as , but as&nbsp; DM Eddie &nbsp;wrote, i assume a&nbsp; !token-mod --set bar1|[[3d6+8]] bar1_link|hp would do that but i'm sending a whisper to him so he could paste his macro directly
1650290074
The Aaron
Forum Champion
API Scripter
Operations are applied in order, swapping the setting of bar1 and the linking of bar1 should make that behave more sanely.&nbsp;
1650297817
The Aaron said: Operations are applied in order, swapping the setting of bar1 and the linking of bar1 should make that behave more sanely.&nbsp; After being alerted to a possible fix I came in here and read your last comment and it gave me an epiphany as to what I was actually doing wrong with my own similar issue.&nbsp; I was having the represents entry after all the token changes, so it was unlinking the bar and causing MHD to override the hp rolls.&nbsp; It never occurred to me that the represents needed to go first till I infact went back to your tokenmod handout and it very clearly shows the example that way, I guess I'm just a dufus and missed it.&nbsp; Now my wildshape macro works perfectly and I don't need to constantly turn off MHD midsession when the druid wildshapes.&nbsp;&nbsp;
1650304071
nice to hear you fixed you problem :) The Aaron said: Operations are applied in order, swapping the setting of bar1 and the linking of bar1 should make that behave more sanely.&nbsp; oh okay ! thanks for the info
1650309738
The Aaron
Forum Champion
API Scripter
Sweet! &nbsp;Glad you got it working. I probably should point that out better in the help. I think it mentions that changes are in order, but doesn't point out the importance of order. In particular, since some changes need to propagate, like controlled by, you have to know where to make the changes. You could even do things like setting multiple represents and default tokens in one command.&nbsp;
1650415499
My experience is you need to turn off vision and turn it back on and that seems to always fix the light=dark issue keithcurtis said: Doug E. said: There is a bug where a token with nightvision (even without tint or coloured light sources) will see bright light sources as black when dragged to the page or copied to the page or even if using a script like Tokenmod to change vision. Sometimes, also, the token will not see anything. Simply opening the token settings and saving them will fix the vision so they see bright light normally. This is what I have to do when I put tokens on a page. Every. Single. Time. The devs are aware of it but no fix yet. I haven't tried the Explorer mode setting workaround.&nbsp; This is the only real UDL bug I occasionally have to deal with. Unfortunately, the occurrence and the fix you recommend don't consistently work for me.
1650462626
So about 5 years ago TheAaron posted this TokenMod as a way to add light to a token: !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 can't currently get it to work. Have things changed so that it needs to be different?
1650463831
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Chris M. said: So about 5 years ago TheAaron posted this TokenMod as a way to add light to a token: !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 can't currently get it to work. Have things changed so that it needs to be different? That was likely written for the Legacy Lighting system. Are you using that or the current system?
1650464257
The current system. I am sure that it is it.
1650469859
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Here's a new macro that works with a&nbsp; Chat Menu . And I haven't tested them, but here are some query style macros .
1650477567
Thank you! Those work great. Anyway to limit the bullseye lantern to a directional beam? It says the angle is 90 but it seems to be a full circle. Not a huge deal just wondering if it is a known issue
1650479269
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Known issue. Directional light does not update unless you open the token and close it manually to force an update. :(
1650479463
keithcurtis said: Known issue. Directional light does not update unless you open the token and close it manually to force an update. :( GOT IT!
1650663351
Ok, here's a question.&nbsp; I'm getting ready to play a Moon Druid with a friend guest DMing in my campaign.&nbsp; I am setting up a rollable table for my tokens.&nbsp; I know I can use token mod to change the token size, but does anyone have any idea if there is a way I can also have the token change size based on the creature I wild shape into?&nbsp; Is there any way to extract/split the name or read the weight field to pull out the size?&nbsp; Like have a table element Air Elemental:2 &nbsp;(2 being 2x the size since Air Elementals are large size) or Rat:.5 &nbsp;(since rats are tiny)? I know I could code each one with a selection, but I wanted to make it a one click thing, select the wildshape and have it know what size the token should change to.
1650663545
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There is a Wild Shape script in the repo that does all this and more. I haven't worked much with it, but it looks fairly robust.
1650667983

Edited 1650668099
I'll check that out and see.&nbsp; But I am trying this command !token-mod --set currentside|?{Which Side?|1} at the moment to change sides and it fails to do anything most the time.&nbsp; Once in a while it works, but not normally.&nbsp; Does the rollable table have to be named a certain way to make this work???&nbsp; (See gif below for example, it works once but not a 2nd time)
1650668158
The graphics have to be from your library. Marketplace graphics are not available to the API. Darryn said: I'll check that out and see.&nbsp; But I am trying this command at the moment to change sides and it fails to do anything most the time.&nbsp; Once in a while it works, but not normally.&nbsp; Does the rollable table have to be named a certain way to make this work???&nbsp; (See gif below for example, it works once but not a 2nd time)
1650671136
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It's also good practice when trying to track down an error to disable extensions like VTTES. It's just one less thing that can be a factor.
1650672240
It was that I was using graphics not in my library...&nbsp; First time I've tried doing this, so didn't even think about that, even though I knew it :)
1651262299
Andy
Pro
Hi all, firstly this script is an absolute game-changer. Secondly, and I apologise if this has already been answered, but is there a way to turn lighting on if a condition marker is present on a token? I'm trying to create an automated aura for Faerie Fire based on which creatures fail their save. Again, sorry if it's already been asked/solved and also sorry if my question doesn't make any sense :)
1651266245
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The script Combat Master can do this. It has the ability to associate conditions and macros with token markers.
1651322434

Edited 1651323125
Andy said: Hi all, firstly this script is an absolute game-changer. Secondly, and I apologise if this has already been answered, but is there a way to turn lighting on if a condition marker is present on a token? I'm trying to create an automated aura for Faerie Fire based on which creatures fail their save. Again, sorry if it's already been asked/solved and also sorry if my question doesn't make any sense :) keithcurtis said: The script Combat Master can do this. It has the ability to associate conditions and macros with token markers. What Keith said is true, but like Tokenmod, Combat Master is one of the power scripts here on Roll 20.&nbsp; it may take some time to get used to - there is a learning curve.&nbsp; The most often problem people have is a simple one to fix: Make Sure Your Player Ribbon is on the Same Page you are!&nbsp; It will only work on the page that has the player ribbon on it.&nbsp; You wouldn't believe how many people have had that issue - and poor Victor sounds like a broken record repeating the same answer over and over again ... lmao.&nbsp; The other has to do with getting token-mod to recognize what you are intending to do, which must be done with substitutions - you can't call the api from within the api and reference "Self" or "Token adding Marker" so easily.&nbsp; That takes some getting used to.&nbsp; Once you do tho - oh ... so sweet! On a serious note though, the 4 Must Have APIs for any game I've done on Roll 20 are: Tokenmod - everything that covers tokens ChatSetAttr - everything that covers character sheets Group-Init - Roll, sort, next! Combat Master - Conditions, conditions, conditions .... (Merged two of Robin's old scripts too: StatusInfo and Combat Tracker, even has some of Concentration and Death Tracker, iirc) I, personally, enjoy these also: Welcome Package (So I don't have to give out Character Sheets) Group-Check (because ... Fireball ... is a lot of saves) Message of the Day (Because both players and myself want to get into the action, not recap last session; and I like to hide stuff in the GM section I need to remember later - like what that potion was they found in the temple, or what the friendly NPC barkeep was named in that tavern three cities ago who was actually an informant for the region's thieves guild.) Kirsty's Calendar script - which is awesome but needs some retouching (getting a bit dated, and needs the Ravenloft Calendar added, and moon phases fixed - which is necessary in Ravenloft where your PCs may come down with a temporary case of Lycanthropy) It's a Trap ... oh the shenanigans .... Teleport ... Multilevel Dungeon?&nbsp; Vvvvvvrrrrp!&nbsp; Up the steps you go! Some that I don't use, personally, but are considered powerscripts here on roll20 are (in additions to the 4 I mentioned first): Roll20 AM - controls your audio on que Powercards - Useful to provide if/ than conditions to display different things (Simple examples could be a normal attack's damage, versus a miss, a nat 1, or a nat 20).&nbsp; Chat output is really nice and fully customizable. I know that's a tl;dr - but since you had the question, figured I'd help you out.&nbsp; It took me a while to find all those scripts and learn how to use them, and need to thank the community; especially The Aaron, Victor, Jacob, Robin K, Bast, Steven L, Keith, and others in the community for getting me there.&nbsp; Never did learn javascript to be able to write my own API's, but :shrug: whatcha gonna do?&nbsp; lol
1651596485
Hi, Can token-mod have access or control on the global attacks checkboxes ? I created a bless box in global attacks and global saves, and i'd like to toggle them on or off when blessed. FTM, i'm using a mix between char set attr and token mod,&nbsp; having setAttr check the box, and token-mod add a statusmarker, but that requires 2 macros (one is Bless-on, the other is Bless-off). I can toggle with one command for the status marker, but i need 2 different macros to toggle on and off the checkbox. Could Token mod do it all in one toggle, or setattr ? Thx for your help
1651600361
Denis said: Can token-mod have access or control on the global attacks checkboxes ? I created a bless box in global attacks and global saves, and i'd like to toggle them on or off when blessed. FTM, i'm using a mix between char set attr and token mod,&nbsp; having setAttr check the box, and token-mod add a statusmarker, but that requires 2 macros (one is Bless-on, the other is Bless-off). I can toggle with one command for the status marker, but i need 2 different macros to toggle on and off the checkbox. Could Token mod do it all in one toggle, or setattr ? TokenMod affects tokens , and it sounds like you want to affect a character sheet , so it won't be possible in the way you want. It may &nbsp;be possible to create a single toggle macro, but that would depend on which game you are playing, which character sheet you are using, and what the specific attributes are. (I can't remember if ChatSetAttr has a 'toggle' function offhand right now.)&nbsp; It's also helpful to post the entire macro you are currently using. :)&nbsp; You may also want to look into using a Chat Menu if you're not already.
1651602543
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You can toggle most checkboxes that resolve to 1=true, 0=false by using the math formula: 1 - old value = new value if old value is 0 1-0 = 1 if old value is 1 1-1=0 I know that ChatSetAttr can look up values and perform math on them as part of the command, so this should be possible.
1651652317
I'm using 5e ogl and here are my macros so far. !token-mod --set statusmarkers|!Béni::4017226 !setattr --sel --silent --repeating_savemod_$0_global_save_active_flag|1 !setattr --sel --silent --repeating_tohitmod_$0_global_attack_active_flag|1 !setattr --sel --silent --repeating_savemod_$0_global_save_active_flag|0 !setattr --sel --silent --repeating_tohitmod_$0_global_attack_active_flag|0 !token-mod --set statusmarkers|!Béni::4017226 Chat menu is an option, but i'd like to not go there.
1651677560
Denis said: I'm using 5e ogl and here are my macros so far. !token-mod --set statusmarkers|!Béni::4017226 !setattr --sel --silent --repeating_savemod_$0_global_save_active_flag|1 !setattr --sel --silent --repeating_tohitmod_$0_global_attack_active_flag|1 !setattr --sel --silent --repeating_savemod_$0_global_save_active_flag|0 !setattr --sel --silent --repeating_tohitmod_$0_global_attack_active_flag|0 !token-mod --set statusmarkers|!Béni::4017226 Chat menu is an option, but i'd like to not go there. This should work to toggle the status marker and attributes at the same time. I don't think you can put it on a single line (because TokenMod won't parse the ChatSetAttr command as far as I can tell.&nbsp; Also, since your status marker doesn't have a space in the name you shouldn't need the ID with it. And lastly both of your ChatSetAttr commands can be combined onto a single line. !token-mod --set statusmarkers|!Béni !setattr --sel --silent --global_save_mod_flag|[[1-@{selected|global_save_mod_flag}]] --global_attack_mod_flag|[[1-@{selected|global_attack_mod_flag}]]
1651690215
I actually corrected it a little bit so it checks the box instead of making the global attack boxes appear or disappear. So it looks like this. !token-mod --set statusmarkers|!blue !setattr --sel --silent --repeating_savemod_$0_global_save_active_flag|[[1-@{selected|repeating_savemod_$0_global_save_active_flag}]] --repeating_tohitmod_$0_global_attack_active_flag|[[1-@{selected|repeating_tohitmod_$0_global_attack_active_flag}]]
Jarren said: Denis said: Can token-mod have access or control on the global attacks checkboxes ? I created a bless box in global attacks and global saves, and i'd like to toggle them on or off when blessed. FTM, i'm using a mix between char set attr and token mod,&nbsp; having setAttr check the box, and token-mod add a statusmarker, but that requires 2 macros (one is Bless-on, the other is Bless-off). I can toggle with one command for the status marker, but i need 2 different macros to toggle on and off the checkbox. Could Token mod do it all in one toggle, or setattr ? TokenMod affects tokens , and it sounds like you want to affect a character sheet , so it won't be possible in the way you want. It may &nbsp;be possible to create a single toggle macro, but that would depend on which game you are playing, which character sheet you are using, and what the specific attributes are. (I can't remember if ChatSetAttr has a 'toggle' function offhand right now.)&nbsp; It's also helpful to post the entire macro you are currently using. :)&nbsp; You may also want to look into using a Chat Menu if you're not already. Denis said: I actually corrected it a little bit so it checks the box instead of making the global attack boxes appear or disappear. So it looks like this. !token-mod --set statusmarkers|!blue !setattr --sel --silent --repeating_savemod_$0_global_save_active_flag|[[1-@{selected|repeating_savemod_$0_global_save_active_flag}]] --repeating_tohitmod_$0_global_attack_active_flag|[[1-@{selected|repeating_tohitmod_$0_global_attack_active_flag}]] iirc, I had an issue which order I put Tokenmod and ChatSetAttr in within the same Macro, one would not work after the other unless I did a blank line between them (and I hate when blank lines show up in chat ...).&nbsp; Simple fix was to reverse the order, everything went smoothly.&nbsp; Never knew why it worked that way, but the work-around was easy, so I didn't really care in the end ...
1652194916
I'm just diving headfirst into all of this. It's definitely a lot to take in with how much I've thrown myself into. I'm sure I'll figure it out eventually. But if any of you want to help me quicker. I used Casltle Class's script and can easily see how to change up the variables. But I don't know how to add something new. I use the Radar API for the bat form, but I want his vision to be gone. So how would I go about incorporating&nbsp; limit_field_of_vision_total|0 into the Bat section? !token-mod {{ &nbsp; --set &nbsp; &nbsp; ?{Choose Form|Cat,currentside#1 represents#@{Juniper Cat|character_id} width#[[1*70]] height#[[1*70]] &nbsp; &nbsp; &nbsp; |Giant Turtle,currentside#2 represents#@{Juniper Giant Turtle|character_id} width#[[2*70]] height#[[2*70]] &nbsp; &nbsp; &nbsp; |Dire Wolf,currentside#3 represents#@{Juniper Dire Wolf|character_id} width#[[2*70]] height#[[2*70]] &nbsp; &nbsp; &nbsp; |Bat,currentside#4 represents#@{Juniper Vampire Bat|character_id} width#[[70]] height#[[70]] &nbsp; &nbsp; &nbsp; |Juniper,currentside#5 represents#@{Juniper Elmwood|character_id} width#[[70]] height#[[70]] &nbsp; &nbsp; } &nbsp; &nbsp; bar1_link|speed bar2_link|ac &nbsp; &nbsp; bar3_link|hp &nbsp; &nbsp; name|"Juniper Elmwood" }}
1652198100
<a href="https://app.roll20.net/forum/post/4225825/script-update-tokenmod-an-interface-to-adjusting-properties-of-a-token-from-a-macro-or-the-chat-area/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/4225825/script-update-tokenmod-an-interface-to-adjusting-properties-of-a-token-from-a-macro-or-the-chat-area/?pagenum=1</a> Also you can improve the macro a bit by using 'scale' instead of both 'width' and 'height': scale &nbsp;is a pseudo field which adjusts both&nbsp; width &nbsp;and&nbsp; height &nbsp;with the same operation. &nbsp; &nbsp; &nbsp; |Bat,currentside#4 represents#@{Juniper Vampire Bat|character_id} scale#[[70]] limit_field_of_vision_total#0 You could also use 'units' or 'grid' for the sizing instead of pixels: &nbsp; &nbsp; &nbsp; |Bat,currentside#4 represents#@{Juniper Vampire Bat|character_id} scale#1u limit_field_of_vision_total#0
1652236599
So, I'm not sure if anything like this has been addressed on any of the pages here.&nbsp; I'm trying to create a wizard who can cast fireshield.&nbsp; I've created three tokens: 1-normal, 2- red flame ring and 3- blue flame ring.&nbsp; I have the code to set size and light for each side of the rollable token. !token-mod {{ --set &nbsp; currentside|1 width|1g height|1g &nbsp; emits_bright_light|off &nbsp; bright_light_distance|10 &nbsp; emits_low_light|off &nbsp; low_light_distance|10 }} !token-mod {{ --set &nbsp; currentside|2 width|2g height|2g &nbsp; emits_bright_light|on &nbsp; bright_light_distance|10 &nbsp; emits_low_light|on &nbsp; low_light_distance|10 }} !token-mod {{ --set &nbsp; currentside|3 width|2g height|2g &nbsp; emits_bright_light|on &nbsp; bright_light_distance|10 &nbsp; emits_low_light|on &nbsp; low_light_distance|10 }} Question: This method has three separate macros each with a button for the character to use.&nbsp; Is there a way to include a query so that all three of the above could be included in a single macro that asks the player which side to set and then runs the&nbsp; --set commands for that side?
1652239353
The Aaron
Forum Champion
API Scripter
Yes, you can put the parts that vary in a Roll Query. It's handy to know that you can use # in place of | for them? !token-mod --set ?{Type|Normal,currentside#1 scale#1g|Red Flame Ring,currentside#2 scale#2g|...} Etc. Note: scale will set height and width to the same value.&nbsp;
1652241905
Also you can improve the macro a bit by using 'scale' instead of both 'width' and 'height': Thank you so much! Feel like I'm getting the hang of it
1652263393
The Aaron said: Yes, you can put the parts that vary in a Roll Query. It's handy to know that you can use # in place of | for them? !token-mod --set ?{Type|Normal,currentside#1 scale#1g|Red Flame Ring,currentside#2 scale#2g|...} Etc. Note: scale will set height and width to the same value.&nbsp; Thank you! This is amazing!
1653100154

Edited 1653100969
Bug Report: When using the script to --flip has_bright_light_vision , tokens are still able to see light sources. I believe this may be because of a variable on the token for "has low light vision" that isn't immediately obvious. Only reason I think this is because when using the VTTES Token Editor, I can reproduce the same result when turning off "Has Bright Light Vision" but leaving on "Has Low Light Vision".&nbsp; Perhaps the script needs to be updated to account for this? Edit: Screen recording:&nbsp; <a href="https://www.loom.com/share/0e02b39b36134fc2a4de17df35358057" rel="nofollow">https://www.loom.com/share/0e02b39b36134fc2a4de17df35358057</a> Edit 2: Forgot to post script version. Script Version: Latest (0.8.74)
1653188924

Edited 1653188956
The Aaron
Forum Champion
API Scripter
This isn't actually a bug, it's a design choice. The Roll20 UI has a single checkbox for has sight, but the API has access to both bright and lowlight sight. I chose to expose those as separate settings. You can use the following: --flip has_bright_light_vision has_low_light_vision To achieve the result you're looking for.&nbsp;
1653459306

Edited 1653459666
Thank you for your response! I tried that, but it doesn't work. Changing&nbsp; has_low_light_vision doesn't change the result of the action. Also tried with this code, to be sure: !token-mod {{ --set has_bright_light_vision|false --set has_low_light_vision|false }} The result is the same as if low light vision hadn't been modified. Edit: Also, I checked the Help: TokenMod in the VTT, and it doesn't mention a variable called&nbsp; has_low_light_vision anywhere. Checked with CTRL + F to be sure. Edit 2: Also also, checked the Script, TokenMod.js, on the GitHub, and&nbsp; has_low_light_vision isn't included in the script. Edit 3: Again, just wanted to say thank you for the support! I fear I might be coming across as ungrateful or rude.