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.

Bernd S. said: Concerning my everlasting problems with default tokens: this also doesn't work, probably also because they didn't expose all the API?! If I set up a token, let's say size, bars, bar type (=overlapping below compact). Then I use token-mod --set defaulttoken. The bar values are correct, but overlapping below and compact got lost. It's always above and detail - which I hate for some reasons. I would have thought that the option does the same as edit-&gt;remove default token-&gt;use selected in the editor. But obviously not. How do you guys handle that? Since there is still no way in roll20 to set up default tokens (of monsters that are already in game), I always have to adjust them ALL manually. I totally agree - I hate the 'Above' and 'Detail' settings on tokens as well,&nbsp; But I've managed to streamline my process quite a bit.&nbsp; I've got a chat menu for token settings - PC tokens, NPC 'named' tokens, NPC 'mook' tokens, and NPC tokens for when PCs can control them. Each one has all the settings I want (that are available to the API) so it's a pretty easy process, and I have the menu laid out with basic instructions to myself. 1. I always double check the 'Represents' and 'Controlled By' manually first 2. Then click the chat menu macro button for the type of token 3.&nbsp; Reopen the token and adjust the Bar Position and Style 4. Open the character sheet and resave the default token. Now that I've got my chat menu and macros all set up it takes me about 15 seconds to set up a brand new token.&nbsp; But I totally agree that it would be really nice to have the Bar Position and Bar Style exposed to the API!&nbsp; I've had an open suggestion since last August asking for just that. Feel free to upvote it if you agree:&nbsp;&nbsp; <a href="https://app.roll20.net/forum/post/9033645/update-api-to-allow-script-setting-of-bar-position-and-bar-styles" rel="nofollow">https://app.roll20.net/forum/post/9033645/update-api-to-allow-script-setting-of-bar-position-and-bar-styles</a>
Jay R. said: Bernd S. said: keithcurtis said: Manually, at the moment. Same way I handle setting default tokens... :( Concerning my everlasting problems with default tokens: this also doesn't work, probably also because they didn't expose all the API?! If I set up a token, let's say size, bars, bar type (=overlapping below compact). Then I use token-mod --set defaulttoken. The bar values are correct, but overlapping below and compact got lost. It's always above and detail - which I hate for some reasons. I would have thought that the option does the same as edit-&gt;remove default token-&gt;use selected in the editor. But obviously not. How do you guys handle that? Since there is still no way in roll20 to set up default tokens (of monsters that are already in game), I always have to adjust them ALL manually. Yeah, the location and size of the bar isn't exposed to the API. Frustrating. I feel the same way you do. I loathe the above bar, and always set it to bottom overlapping. For default tokens for in-game monsters, not much you can do. Going forward, though, after you run --set defaulttoken, select the token, change its bar settings to what you prefer, shift double-click to get to the character sheet editor (for the monster), and use that token as the default token. Every subsequent instance of the monster you drag onto the VTT map will come in with your preferred bar location/size. Yeah, I know. Usually I use the token editor the VTT Enhancement Suite provides. There you have an additional tab sheet where you can set the default token stuff directly. That's a bit faster. The VTT Suite is a great help to DMs anyway. Use it for a lot of stuff.
Bernd S. said: Yeah, I know. Usually I use the token editor the VTT Enhancement Suite provides. There you have an additional tab sheet where you can set the default token stuff directly. That's a bit faster. The VTT Suite is a great help to DMs anyway. Use it for a lot of stuff. Oh, yeah, I used to use the VTT Enhancement Suite for that reason, but it stopped working with my browser so I had to jettison it. I miss the default token editor and the ability to click through to different layers.
...&nbsp; but it stopped working with my browser so I had to jettison it.&nbsp; Really? It's working fine for me with Chrome and Firefox. But there are often updates necessary because there are so frequent changes in roll20.
I am trying to create a macro to make setting up PC tokens easier.&nbsp; I am trying to set the represents first !token-mod --set represents|@{?{Character Name}|character_id} But I get an error.&nbsp; I am sure my syntax is wrong but I can't seem to figure out what it wrong here
1621543144
The Aaron
Roll20 Production Team
API Scripter
You can set represents with just a part of the character name, try this: !token-mod --set represents|"?{Character Name}" and see if it's a bit more forgiving.&nbsp; You just need to provide a unique portion of the name, see the help for more details, but for "Max the Great Slayer", you could just use "max" or "max the great" if those were sufficient enough to be unique.
I'm hoping someone can point me in the right direction, here. If I try to take a token set with Light Multiplier 2 (LDL), and I go !token-mod --set light_multiplier|1 it works fine. But I can't find the equivalent property for UDL, to allow me to go from Light Multiplier 200% to 100%. Is there one, or is it hidden from the API?
1621603536
The Aaron
Roll20 Production Team
API Scripter
That setting is not yet exposed to the API, sadly.&nbsp; I'm hoping to see it soon though!
Bummer. But thanks for this incredible script!
I'm having a problem with using a macro to set the token's nightvision tint. When I set the tint manually and save, the tint changes and it all works. But this macro does not seem to do anything to that same token !token-mod {{ --set ?{Tint |Red, night_vision_tint#rgb(1.0, 0.0, 0.0) |Green, night_vision_tint#rgb(0.0, 1.0, 0.0) |Blue, night_vision_tint#rgb(0.0, 0.0, 1.0) |White, night_vision_tint#rgb(1.0, 1.0, 1.0) |Black, night_vision_tint#rgb(0.0, 0.0, 0.0) |Transparent, night_vision_tint#transparent |Add Red, night_vision_tint#+rgb(0.1,0.0,0.0) |Add Green, night_vision_tint#+rgb(0.0,0.1,0.0) |Add Blue, night_vision_tint#+rgb(0.0,0.0,1.0)} }} When I run the macro I get this drop down; But it doesn't change the token's nightvision tint. The API hasn't crashed. I'm hoping it is a simple error in syntax.
1621705361
The Aaron
Roll20 Production Team
API Scripter
If you take the ! off the front, what gets sent to chat?
1621721636
timmaugh
Pro
API Scripter
The sandbox does sometimes... quietly... crash. No error. No pink block. Like a cat who has decided you, biped, no longer exist to me... ... it just stops. If *no* API command goes through, a reboot of the sandbox is probably in order.
1621735648
The Aaron
Roll20 Production Team
API Scripter
The , is getting eaten and leading to an invalid out instruction: token-mod {{ --set night_vision_tint#rgb(1.0 }} I'd suggest either substituting the ,s in the color with &amp;#44;: !token-mod {{ --set ?{Tint |Red, night_vision_tint#rgb(1.0&amp;#44; 0.0&amp;#44; 0.0) |Green, night_vision_tint#rgb(0.0&amp;#44; 1.0&amp;#44; 0.0) |Blue, night_vision_tint#rgb(0.0&amp;#44; 0.0&amp;#44; 1.0) |White, night_vision_tint#rgb(1.0&amp;#44; 1.0&amp;#44; 1.0) |Black, night_vision_tint#rgb(0.0&amp;#44; 0.0&amp;#44; 0.0) |Transparent, night_vision_tint#transparent |Add Red, night_vision_tint#+rgb(0.1&amp;#44;0.0&amp;#44;0.0) |Add Green, night_vision_tint#+rgb(0.0&amp;#44;0.1&amp;#44;0.0) |Add Blue, night_vision_tint#+rgb(0.0&amp;#44;0.0&amp;#44;1.0)} }} Or use HTML colors.
1621790459

Edited 1621790488
Even substituting &amp;#44; for commas doesn't work - they get reverted to commas. I used the hex values and ditched the math, giving the players a limited palette - which works great. My final code, if anybody wants to use it; !token-mod {{ --set ?{Tint |Transparent, night_vision_tint#transparent |Red, night_vision_tint##ff0000 |Green, night_vision_tint##00ff00 |Blue, night_vision_tint##0000ff |White, night_vision_tint##ffffff |Orange, night_vision_tint##ff9900 |Yellow, night_vision_tint##ffff00 |Teal, night_vision_tint##00ffff |Purple, night_vision_tint##9900ff |Pink, night_vision_tint##ff00ff |Brown, night_vision_tint##e06666 |Blood, night_vision_tint##980000 } }}
1621813667

Edited 1621813747
Attributs not exposed to API Hi Aaron, one question/thought on the attributes which are still not exposed to the API, like bar style, some UDL settings etc.: I am using the VTT Enhancement Suite in roll20 (their Discord channel: <a href="https://discord.com/channels/495906673446092800/495907770844053514" rel="nofollow">https://discord.com/channels/495906673446092800/495907770844053514</a>) . And since the last update 1.18 there are all attributs available in the token editor VTT provides. See: VTT is a browser plugin, but how do they access these settings if they are not exposed to API? Maybe there is a trick to get to these attributes somehow?
1621814415
The Aaron
Roll20 Production Team
API Scripter
They get to them through the browser, just like humans do. They are in the browser's DOM, which browser extensions have access to.&nbsp; The API runs on a sandbox in the cloud. It does not have access to the game, does not have a browser, or a user interface. It has a bunch of interface objects that are proxies to the actual objects stored in Firebase, a "real-time" database. The API only has access to the properties of those objects which are being proxied, anything else they cannot see or set.&nbsp;
Pity. But thanks!
1621962962

Edited 1621963002
I have a question, if somebody has a moment.&nbsp; It looks to me like when multiple tokens are selected a given command evaluates any inline rolls once for the whole collection.&nbsp; For example, a test command "--set bar1_value|[[1d20]]" seems to roll a seven, then set the bar value of each token to seven, as opposed to rolling 1d20 per token.&nbsp; I've looked into trying to modulate the roll by the token's position, but that seems like a complicated workaround.&nbsp; Is there a way to control this behavior, or can I do something like [[1d20 + tokenID % 20]]?
1621963379
The Aaron
Roll20 Production Team
API Scripter
Not yet. All expressions are evaluated on the client currently. I'd like to add per-token execution, but I'm not sure what the syntax would look like. There might be another way, so I'll summon Tim and see if he's got some ideas...
1621963644

Edited 1621964041
Thanks for the reply.&nbsp; I've been trying odd things like setting a per-token value to the token's x or y position, then using those as seeds into a modulus, but handing variables around like that doesn't seem to work.
1621969454

Edited 1621971680
timmaugh
Pro
API Scripter
*BAMF* GM The Aaron has successfully summoned a Level 1 timmaugh. Everyone on the thread roll Save vs Insanity Hey, Entropy... you can do what you want to do with TokenMod using SelectManager, ZeroFrame, and perhaps other scripts from the Meta Toolbox, as necessary. I did something pretty much identical in this post , and then follow up on it a few posts later, here . The syntax of those posts is a little out-dated, so let me explore it here... Basically, you can use the !forselected handle of SelectManager to trigger a lot of per-token preprocessing using the meta scripts. In fact, since I posted that second post, the !forselected handle got the ability to incorporate a deferral character if you wanted to pull information from the token or defer inline rolls: !forselected(^) token-mod... That caret (or some other customizable series of characters) allows downstream constructions to survive into the iterated calls. Normally, if the meta toolbox detects a construction that requires pre-processing, it would perform that processing first. By incorporating the deferral character like this, you break up the text patterns of these constructions. forselected *removes* that character everywhere it finds it in the downstream command line before sending it to chat. Now, since the new message doesn't actually have a selected token until SelectManager receives the message and restores the selected token, you can't use built-in Roll20 constructions to read things off of the token, but you can use Fetch (another meta-script) with very similar constructions: !forselected(^) token-mod --set bar1|@^(selected.hp[1]) That will, for each selected token, set bar1 to be the hp attribute of the character, with a default of 1 if the attribute cannot be found. Using an inline roll is a matter of using the special ZeroFrame deferral characters. The trick is getting ZeroFrame to engage on the secondary call (the iterated call to token-mod) in order to remove those deferral characters and detect the inline roll. That's where (as in the linked posts, above), I used a Plugger construction that ran nothing: !forselected(^) token-mod --set bar1|[\][\]1d20\]\]{^&amp;eval} null() {^&amp; /eval} Or a mule that I had no need to access: !forselected(^) token-mod --set bar1|[\][\]1d20\]\]{^&amp;mule MyMule} Note that I use the caret to "hide" the Mule structure and the Plugger structure from the associated scripts until the forselected handle removes that character and re-issues the command. Once the structures are detectable, ZeroFrame will also engage to remove the deferral characters around the inline roll. Either of the above examples would roll individually for each selected token. If you already have a meta-construction in the line you are iterating with forselected *AND* you defer it to only be detected when the iterated command (issued from forselected) runs, then you don't need another meta construction just to trigger ZeroFrame to un-escape the inline roll. For example, you can use a Fetch construction within the inline roll: !forselected(^) token-mod --set bar1|[\][\]@^(selected.hp[1])d20kh1 \]\] That utilizes the caret to break up the Fetch construction, and ZeroFrame escape characters to defer an inline roll. The net effect is that each selected token gets to roll a number of d20 equal to their HP, keeping only the highest, which is then written to their bar1.
1621983121

Edited 1621983157
Kick
Pro
Hey everyone! Sorry if I'm reporting a known issue, but I wasn't able to find this mentioned elsewhere. I might just be blind, but I'm reporting it anyway, just in case! So I made a killswitch macro to quickly and easily remove all status markers from a token, set the token's bars to 0, and remove its sight. Except its sight doesn't seem to be removed upon execution of the macro. Here's what it looks like: !token-mod --set statusmarkers|=dead !token-mod --set bar1_current|0 !token-mod --set bar2_current|0 !token-mod --set bar3_current|0 !token-mod --off has_bright_light_vision !token-mod --off has_night_vision !token-mod --off emits_bright_light !token-mod --off showname Interestingly, the token loses its nightvision as expected, and is no longer able to see tokens and areas that aren't illuminated, yet it retains its vision, and so illuminated things are visible to this "dead" token. When I check the token after using this macro, the Vision switch is off, and clicking "save settings" will accordingly update the token and remove its vision. It appears that the command is working as intended, but the token refuses to update somehow?
1621985254
The Aaron
Roll20 Production Team
API Scripter
This is an existing bug in Roll20's implementation of UDL and is beyond the control of the API, unfortunately.&nbsp; This should be fixed before LDL is removed. BTW, it's more efficient to group all these together in one command: !token-mod {{ --set statusmarkers|=dead bar1_current|0 bar2_current|0 bar3_current|0 --off has_bright_light_vision has_night_vision emits_bright_light showname }}
Thank you Aaron! That looks very tidy and easy to edit, I'm going to try formatting more of my macros like that. It'll save me some time during troubleshooting! Might be easier on Roll20 too, since it's all a single command instead of a slew of commands being executed in sequence. Sorry to hear about the bug, but glad to hear it's being worked on! Thank you for informing me!
Entropy said: Thanks for the reply.&nbsp; I've been trying odd things like setting a per-token value to the token's x or y position, then using those as seeds into a modulus, but handing variables around like that doesn't seem to work. You might have a look at VTT Enhancement Suite:&nbsp; <a href="https://discord.com/channels/495906673446092800/495907770844053514" rel="nofollow">https://discord.com/channels/495906673446092800/495907770844053514</a>. &nbsp;This browser plugin is extremely helpful for a DM. And it provides as a context menu (right-click on selected tokens) a 'Bulk Macro Roll'. It executes a macro for each selected tokens separately.
1622038726

Edited 1622040821
Oh my. I am totally lost. I try to figure this UDL stuff out, but I can't get a grip of what is what. I try to set a token to 'Blinded' by&nbsp; !token-mod --off bright_vision This works for my token with also night vision ok. But I have another token without night vision which has a torch. Using the command above changes nothing. Sight stays. But if I open the UI, I see the Vision is off. Now I close the UI and just then the sight disappears. As if only the uI really applys the changes. When the night vision token is near the light emitting one, it sees the light - although Vision is off! I again open the uI to look at th settings and close it. And just then the elf stops seeing the light. It looks like everything concerning emitted light only updates when I open/close the UI. What am I doing wrong? If there's really no way with token-mod to do this, I can't use it anymore for UDL. Legacy Lighting was heaven.
1622045012
The Aaron
Roll20 Production Team
API Scripter
The Aaron said: This is an existing bug in Roll20's implementation of UDL and is beyond the control of the API, unfortunately.&nbsp; This should be fixed before LDL is removed.
1622746628
The Aaron
Roll20 Production Team
API Scripter
Update v0.8.69 -- Support for Token Bar Location, Compact Token Bars,&nbsp; Light Sensitivity Multiplier (UDL), and Night Vision Effect (UDL). Three of these have their own section in the help as they are set with specific new values: Bar Location Bar Location specifes where the bar on a token appears. There are 4 options: &nbsp; above , &nbsp; overlap_top , &nbsp; overlap_bottom , and &nbsp; below . You can also use &nbsp; off , &nbsp; none , or leave the field blank as an alias for &nbsp; above . Any other value is ignored. Available Bar Location Properties: bar_location Setting the bar location to below the token: !token-mod --set bar_location|below Setting the bar location to overlap the top of the token: !token-mod --set bar_location|overlap_top Setting the bar location to overlap the bottom of the token: !token-mod --set bar_location|overlap_bottom Setting the bar location to above the token: !token-mod --set bar_location|above !token-mod --set dim_light_opacity|none !token-mod --set dim_light_opacity|off !token-mod --set dim_light_opacity| Compact Bar Compact Bar specifes how the bar looks. A compact bar is much smaller than the normal presentation and does not have numbers overlaying it. To enable Compact Bar for a token, use&nbsp; compact &nbsp;or&nbsp; on . You can disable Compact Bar using&nbsp; off ,&nbsp; none , or leave the field blank. Any other value is ignored. Available Compact Bar Properties: compact_bar Enable Compact Bar on a token: !token-mod --set compact_bar|compact !token-mod --set compact_bar|on Disable Compact Bar on a token: !token-mod --set compact_bar|off !token-mod --set compact_bar|none !token-mod --set compact_bar| Night Vision Effect Night Vision Effect specifes how the region of night vision around a token looks. There are two effects that can be turned on:&nbsp; dimming &nbsp;and&nbsp; nocturnal . You can disable Night Vision Effects using&nbsp; off ,&nbsp; none , or leave the field blank. Any other value is ignored. Available Night Vision Effect Properties: night_vision_effect Enable the nocturnal Night Vision Effect on a token: !token-mod --set night_vision_effect|nocturnal Enable the dimming Night Vision Effect on a token: !token-mod --set night_vision_effect|dimming Disable any Night Vision Effects on a token: !token-mod --set night_vision_effect|off !token-mod --set night_vision_effect|none !token-mod --set night_vision_effect| Light Sensitivity Multiplier is just a number.&nbsp; It represents a percent that is applied to any light on the page.&nbsp; 100 will mean that light reaches as far as it is configured. 200 will mean it extends twice as far (200%).&nbsp; You can set it with: !token-mod --set light_sensitivity_multiplier|200 You can make relative changes with the +/- prefixes: !token-mod --set light_sensitivity_multiplier|-50 Note that this setting may appear strange if you control multiple tokens with different multipliers. You can get the latest version here:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/TokenMod/TokenMod.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/TokenMod/TokenMod.js</a> Or wait till it shows up in the 1-click next week.&nbsp; Let me know if you run into any issues, or if you have suggestions for good alias names for any of those (or other) properties.
1622747268
The Aaron
Roll20 Production Team
API Scripter
Also of note, setting defaulttoken will now preserve all those settings.
The Aaron said: Update v0.8.69 -- Support for Token Bar Location, Compact Token Bars,&nbsp; Light Sensitivity Multiplier (UDL), and Night Vision Effect (UDL). Three of these have their own section in the help as they are set with specific new values: Bar Location Bar Location specifes where the bar on a token appears. There are 4 options: &nbsp; above , &nbsp; overlap_top , &nbsp; overlap_bottom , and &nbsp; below . You can also use &nbsp; off , &nbsp; none , or leave the field blank as an alias for &nbsp; above . Any other value is ignored. Available Bar Location Properties: bar_location Setting the bar location to below the token: !token-mod --set bar_location|below Setting the bar location to overlap the top of the token: !token-mod --set bar_location|overlap_top Setting the bar location to overlap the bottom of the token: !token-mod --set bar_location|overlap_bottom Setting the bar location to above the token: !token-mod --set bar_location|above !token-mod --set dim_light_opacity|none !token-mod --set dim_light_opacity|off !token-mod --set dim_light_opacity| Compact Bar Compact Bar specifes how the bar looks. A compact bar is much smaller than the normal presentation and does not have numbers overlaying it. To enable Compact Bar for a token, use&nbsp; compact &nbsp;or&nbsp; on . You can disable Compact Bar using&nbsp; off ,&nbsp; none , or leave the field blank. Any other value is ignored. Available Compact Bar Properties: compact_bar Enable Compact Bar on a token: !token-mod --set compact_bar|compact !token-mod --set compact_bar|on Disable Compact Bar on a token: !token-mod --set compact_bar|off !token-mod --set compact_bar|none !token-mod --set compact_bar| Night Vision Effect Night Vision Effect specifes how the region of night vision around a token looks. There are two effects that can be turned on:&nbsp; dimming &nbsp;and&nbsp; nocturnal . You can disable Night Vision Effects using&nbsp; off ,&nbsp; none , or leave the field blank. Any other value is ignored. Available Night Vision Effect Properties: night_vision_effect Enable the nocturnal Night Vision Effect on a token: !token-mod --set night_vision_effect|nocturnal Enable the dimming Night Vision Effect on a token: !token-mod --set night_vision_effect|dimming Disable any Night Vision Effects on a token: !token-mod --set night_vision_effect|off !token-mod --set night_vision_effect|none !token-mod --set night_vision_effect| Light Sensitivity Multiplier is just a number.&nbsp; It represents a percent that is applied to any light on the page.&nbsp; 100 will mean that light reaches as far as it is configured. 200 will mean it extends twice as far (200%).&nbsp; You can set it with: !token-mod --set light_sensitivity_multiplier|200 You can make relative changes with the +/- prefixes: !token-mod --set light_sensitivity_multiplier|-50 Note that this setting may appear strange if you control multiple tokens with different multipliers. You can get the latest version here:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/TokenMod/TokenMod.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/TokenMod/TokenMod.js</a> Or wait till it shows up in the 1-click next week.&nbsp; Let me know if you run into any issues, or if you have suggestions for good alias names for any of those (or other) properties. Wha? Does this mean my Suggestion is about to be closed? Awesome! I just tested out the bar location and style and they're both working. I'd suggest an alias for 'compact_bar' as 'bar_style' as that's what it's called on the Token Settings popup window. !token-mod --set bar_style|compact !token-mod --set bar_style|standard Thanks!
1622752428
The Aaron
Roll20 Production Team
API Scripter
Yup!&nbsp; Those are both great suggestions, I'll see about rolling them in this evening. Also of note, it appears the issue with changing UDL settings not immediately updating the apparent vision has also been fixed.&nbsp; I'm testing a UDL Torch script now, so that should get rolled out in the not too distant future.
Woo! &nbsp;So exciting to finally be able to set and save these new settings via script! :-)
Yay that's exciting! The Aaron said: Yup!&nbsp; Those are both great suggestions, I'll see about rolling them in this evening. Also of note, it appears the issue with changing UDL settings not immediately updating the apparent vision has also been fixed.&nbsp; I'm testing a UDL Torch script now, so that should get rolled out in the not too distant future. Since you're gonna be digging into that soon, would you be able to include a DropTorch function in the new Torch script? That scriptlet was very useful while I was still using LDL =D
1622759216
The Aaron
Roll20 Production Team
API Scripter
Worst case, I can update it for UDL. =D
1622759283
The Aaron
Roll20 Production Team
API Scripter
Honestly, I'm most likely to send out my updated Torch script as is (with Rudimentary UDL support), then start on a Vision script that is more tailored to UDL vision and lighting options.
The Aaron said: Update v0.8.69 -- Support for Token Bar Location, Compact Token Bars,&nbsp; Light Sensitivity Multiplier (UDL), and Night Vision Effect (UDL). Three of these have their own section in the help as they are set with specific new values: Yeah, great! Thx a lot Arron!
The Aaron said: Also of note, setting defaulttoken will now preserve all those settings. Wow, even better!
Hey Aaron, the latest update is a dream come true but the bar location function doesn't seem to be working for me. I'm using the following macro where the last line isn't working, which I copy pasted from your earlier post. !token-mod {{ &nbsp; --on&nbsp; &nbsp; &nbsp; showname &nbsp; &nbsp; showplayers_name &nbsp; &nbsp; showplayers_bar1 &nbsp; --set&nbsp; &nbsp; &nbsp; &nbsp;bar2_value|@{selected|npc_ac}| &nbsp; &nbsp; &nbsp;bar1|[[@{selected|npc_hpformula}]] &nbsp; &nbsp; &nbsp;statusmarkers|-dead &nbsp; &nbsp; &nbsp;bar_location|overlap_top }} I performed the new Roll20 update to the map in question too. Any ideas? Could the default settings of the token be interfering?&nbsp;
1622826761
The Aaron
Roll20 Production Team
API Scripter
What version does TokenMod report when you do: !token-mod --help Also, how did you install TokenMod, 1-click?
Oh weird. when I use --help it it says its running 8.68 even though I restarted API sandbox. Yes, I used click (if that means adding from the Script Library dropdown for the game settings. That was around 2 years ago.
1622858754
timmaugh
Pro
API Scripter
Yep. That's the one-click. If you install from there, you'll always have the latest version -- at least the latest version that has been released to the one-click. Also, the one-click is only updated once a week (on Tuesdays, generally), so in situations like this, you'll have to wait for that update (also called a "merge") before you'll get this new feature. If you need it before then, you can always install the script manually, then return to the one-click version after the merge.
I've been scouring the forums and testing myself, trying to get something that will turn vision off (blindness).&nbsp; I can toggle night_vision on and off, but that doesn't help a whole lot when most of the party is using torches!&nbsp; Am I going mad, or has the command for toggling vision not been found?&nbsp; Just getting into this API stuff and it is awesome!&nbsp;
Dungeon Master said: I've been scouring the forums and testing myself, trying to get something that will turn vision off (blindness).&nbsp; I can toggle night_vision on and off, but that doesn't help a whole lot when most of the party is using torches!&nbsp; Am I going mad, or has the command for toggling vision not been found?&nbsp; Just getting into this API stuff and it is awesome!&nbsp; Hi @Dungeon Master Aaron showed me a great way for this earlier. Simply set the limited field of vision to on and the radius to 0. the the player is blind but can still see his/hers own token. works like a charme for me :)
Xeno said: Dungeon Master said: I've been scouring the forums and testing myself, trying to get something that will turn vision off (blindness).&nbsp; I can toggle night_vision on and off, but that doesn't help a whole lot when most of the party is using torches!&nbsp; Am I going mad, or has the command for toggling vision not been found?&nbsp; Just getting into this API stuff and it is awesome!&nbsp; Hi @Dungeon Master Aaron showed me a great way for this earlier. Simply set the limited field of vision to on and the radius to 0. the the player is blind but can still see his/hers own token. works like a charme for me :) @Xeno, Thanks, that pointed me in the right direction!&nbsp; Got it working now, super excited to blind my players!!!
Xeno said: Dungeon Master said: I've been scouring the forums and testing myself, trying to get something that will turn vision off (blindness).&nbsp; I can toggle night_vision on and off, but that doesn't help a whole lot when most of the party is using torches!&nbsp; Am I going mad, or has the command for toggling vision not been found?&nbsp; Just getting into this API stuff and it is awesome!&nbsp; Hi @Dungeon Master Aaron showed me a great way for this earlier. Simply set the limited field of vision to on and the radius to 0. the the player is blind but can still see his/hers own token. works like a charme for me :) For me it works if I even just turn vision off. I can see the token still. Convenient: I don't have to distinguish between normal and night vision. My only problem is that the vision is not updated correctly when I do this by token-mod. Aaron mentioned earlier that this is one of the current problems with UDL.
1623067771
The Aaron
Roll20 Production Team
API Scripter
That should be fixed now, as of last weeks update. If it isn't, post me your command so I can verify and pass it up to the devs.&nbsp;
I am trying to display a class feature from a character sheet in a token bubble.&nbsp; The class feature&nbsp;is a repeating attribute which can't be linked to a token bubble, so my work around was to create an ability on the character's sheet which calls the class feature&nbsp;and then shows the value of the feature&nbsp;in the token bubble. %{Gromgar Three-Scars|repeating_classfeature_-lgkxvjxvyxnubmbhux5_action} !token-mod --set bar3_value|=@{Gromgar Three-Scars|repeating_classfeature_-lgkxvjxvyxnubmbhux5_uses} This works.&nbsp; The problem is the value displayed in the bubble is the class ability value prior to being auto decremented by the sheet upon use. eg. lay on hands value 30/30, character uses 5, bubble still shows 30 not 25 like it should. I think this is due to the api command executing too quickly, and drawing the value before the sheet auto decrements.&nbsp; If my assumption is correct, is there a way to delay token mod reading the value so it displays correctly?
1623103511
The Aaron
Roll20 Production Team
API Scripter
You are mostly correct.&nbsp; The issue is that @{ } references are expanded in the client code before the API even sees them.&nbsp; If you were to take the ! off the front of the command, you'd see something like token-mod --set bar3_value|=30 in the chat.&nbsp; There's not an easy way to get around this.&nbsp; If you know that the call to the class feature will always decrement by a known value, you can add that value into the call: %{Gromgar Three-Scars|repeating_classfeature_-lgkxvjxvyxnubmbhux5_action} !token-mod --set bar3_value|=[[@{Gromgar Three-Scars|repeating_classfeature_-lgkxvjxvyxnubmbhux5_uses}-3]] That would cause the same value to be set to both. Actually, probably Tim has an answer to this with his ZeroFramework stuff. Lets see if we can summon him...