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.

I've hit an odd issue, and was hoping someone might be able to help troubleshooting. I'm a player in a big "Living world" style game, all using one Roll20 game / table. On my oldest 4 characters, I can change a bars value via tokenmod, and it'll propagate to the linked attributes on their character sheet just fine. On the newest two characters, changing the bars values via tokenmod _doesn't_ propagate the values to  the linked attributes on   their character sheet. But the bars are definitely linked to the correct values on all of the characters, because when you change the bar values by hand, the character sheet will automatically update for all of them.  The macro's are exactly the same, literal copy & paste jobs, and are otherwise working, since they update the bar values correctly. The GM's are pretty sure the tokens & character sheets should have the same permissions, be set up the same, etc.  One of them has promised to go through & compare an old (working) & new (not working) characters set up, but I was wondering if anyone here had come across it, and could give pointers on what to look out for?
GM's checked the working characters & non-working ones, they're all set up exactly the same.  :-(
1695680483
The Aaron
Roll20 Production Team
API Scripter
To really diagnose that, you need to be a GM in the game. Do you want to have your GM's PM me an invite and promote me to GM, so I can investigate?
Cool, thanks!  :-) I've raised it with them, they'll discuss it at the next GM meeting, so might take a while.
1695724455
timmaugh
Pro
API Scripter
It takes a long time to say anything in Old GMish.
And anything worth saying takes a long time to say.
I have a query that may have been solved already. I am wanting to use the Token Mod API to auto Number for certain types of creatures and I don't know what the exact coding would be to implement ADDING the %%NUMBERED%% to the end of the base npc_name as part of the --set command for !token_mod. Any ideas on how to help with that?
1696639432
Andrew R.
Pro
Sheet Author
Here's the Token Mod macro I use for my 13th Age monster tokens: !token-mod {{     --set         name|"@{selected|character_name} %%NUMBERED%%"         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| }}
Hello. Is there a command that lets you set the angle for light emitted from a token? Like for a lantern. I tried " light_angle|30" but it does not seem to do anything.
1697248975
The Aaron
Roll20 Production Team
API Scripter
light_angle is for Legacy Dynamic Lighting, for Updated Dynamic Lighting, it's: !token-mod --set directional_bright_light_center|30 directional_dim_light_center|30
1697574625

Edited 1697578585
Richard @ Damery
Pro
API Scripter
Is there any problem with running TokenMod through sendChat() from an API? I'm sure this has been working absolutely fine until the last month or so. In August, I could send the following via sendChat() and it would work absolutely fine, changing the image of a token. !token-mod&nbsp; --ignore-selected &nbsp;--ids -Ngyyexy8HRksV92_vGY &nbsp;--set&nbsp; imgsrc|<a href="https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785</a>&nbsp; width|70&nbsp; height|70 Today, it is totally ignored and does nothing when sent via a correctly formatted sendChat() call - I know the sendChat() is correctly formatted as calls to my RPGMaster APIs (such as !magic --pickorput @{selected|token_id}|@{Rm23-Coffer|searcher}|@{Rm23-Coffer|searcher|max}|long) work absolutely fine. If I send the same command from chat, or from an API Button, it works fine. This would be very difficult for me if this fails to work - RoundMaster effects that use TokenMod will not work, and my drag &amp; drop locks and traps will fail. Perhaps there is something that I am doing wrong, or some change notification I've missed? --- Update --- Update --- I've been playing around with the call to !token-mod, and I've found that if it is sent via sendChat( ), it must have the --api-as specified &nbsp;.&nbsp; This seems to be a change?
1697589905

Edited 1697589968
timmaugh
Pro
API Scripter
I doubt whether something changed about TokenMod... the last pull date was 3 months ago. Another thing to consider would be what other scripts you have, and whether they affect the message object before it gets to TokenMod. For instance, SelectManager can be configured to restore the playerid and "who" properties of a message (filling in the last person who sent a message in the game) before the recipient script actually gets the message. Could that have been bridging the gap to have TokenMod NOT recognize you were sending a call from a script (replacing the playerid property of "api" with an actual player id, for instance)? And, if so, are you now trying in a game where SelectManager is not installed or is no longer configured? That's just one script that could have a bearing on this. You'd have to answer whether you were in a new game, or in a game where you had made some structural tweaks to a script of your own, or in a game where you had installed/uninstalled scripts, or changed their configuration. Just a thought.
1697589977
The Aaron
Roll20 Production Team
API Scripter
That hasn't changed in a long time.&nbsp; Is this a new game?&nbsp; If you have turned on Players Can IDs in the past, that would also allow it to work without --api-as.&nbsp; By default, non-gms (such as players, or the API) can only change things they can select (and in the case of the API, they can't select anything).&nbsp; With Players Can IDs turned on, they can pass one or more ids to the script to manipulate them. If you're in code anyway, you could use something like: let g = getObj('graphic','-Ngyyexy8HRksV92_vGY'); if(g){ g.set({ imgsrc: "<a href="https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785</a>", width: 70, height: 70 }); }
1697590409
Andrew R.
Pro
Sheet Author
Is that URL correct? It has both s3.amazonaws.com &amp; files.d20.io in it. The uploaded images in my Art Library look like: <a href="https://files.d20.io/images/326948548/IWigR9H13VLXK5txoyQMCQ/original.jpg?16758354525" rel="nofollow">https://files.d20.io/images/326948548/IWigR9H13VLXK5txoyQMCQ/original.jpg?16758354525</a>
1697590497
The Aaron
Roll20 Production Team
API Scripter
Yeah.&nbsp; The API still has to deal with the s3.amazonaws.com urls, but the backend is migrating to just files.d20.io.
1697612986

Edited 1697613365
Richard @ Damery
Pro
API Scripter
timmaugh said: I doubt whether something changed about TokenMod... the last pull date was 3 months ago. Another thing to consider would be what other scripts you have, and whether they affect the message object before it gets to TokenMod. For instance, SelectManager can be configured to restore the playerid and "who" properties of a message (filling in the last person who sent a message in the game) before the recipient script actually gets the message. Could that have been bridging the gap to have TokenMod NOT recognize you were sending a call from a script (replacing the playerid property of "api" with an actual player id, for instance)? And, if so, are you now trying in a game where SelectManager is not installed or is no longer configured? That's just one script that could have a bearing on this. You'd have to answer whether you were in a new game, or in a game where you had made some structural tweaks to a script of your own, or in a game where you had installed/uninstalled scripts, or changed their configuration. Just a thought. The only other APIs I use are ChatSetAttr, LibTokenMarkers, and my own RPGMaster Suite (RoundMaster, InitMaster, AttackMaster, MagicMaster, CommandMaster, RPGMaster Suite &amp; the RPGM Library2e). Admittedly, my API suite does manipulate the chat message flow, but I've checked that and its not causing the issue. It certainly is fully working for the other APIs. The Aaron said: Yeah.&nbsp; The API still has to deal with the s3.amazonaws.com urls, but the backend is migrating to just files.d20.io. Hmmm... I'm going to need to watch that one. I'm trying to make life as easy as possible for GMs by handling token image manipulation for setup of containers, creatures, magical effects etc for them (but allowing them to do anything if they want).&nbsp; Changes to the image addresses will be an issue - e.g. I check for marketplace images (which can't be manipulated) by sccanning their URLs for the "marketplace" string... I hope that doesn't change. The Aaron said: That hasn't changed in a long time.&nbsp; Is this a new game?&nbsp; If you have turned on Players Can IDs in the past, that would also allow it to work without --api-as.&nbsp; By default, non-gms (such as players, or the API) can only change things they can select (and in the case of the API, they can't select anything).&nbsp; With Players Can IDs turned on, they can pass one or more ids to the script to manipulate them. If you're in code anyway, you could use something like: let g = getObj('graphic','-Ngyyexy8HRksV92_vGY'); if(g){ g.set({ imgsrc: "<a href="https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785</a>", width: 70, height: 70 }); } Yes, I always have Players can use ids &nbsp;turned on, and it still wasn't working. The tokenID of the token is passed in by the command calls used to get to this point in my APIs.&nbsp; This worked fine until recently, and I'm using a testbed campaign I have used for a couple of years now, so something outside of my APIs has changed. Unfortunately, if I am going to allow the GM to code their own spell effects, containers, and creature powers, the GM needs to do stuff outside of code in what appears to them to be normal macros, to allow everything to be as simple as possible.&nbsp; In fact, the APIs do subsequently manipulate them in code, and I could parse the macros written by the GM to replace the call to TokenMod with a call in code, but that seems over the top! Anyway, I've found the fix - if I always use --api-as &lt;player-id&gt; as a parameter to every !token-mod call, then it works fine. If I don't, then sending via sendChat() will not execute the TokenMod call. And that seems to be any TokenMod call, not just ones that manipulate the images. I've messaged the Dev Team, to see if any of the recent changes to the UI might have affected this. I'll explore further, but I think using --api-as will work for now.
1697726066

Edited 1697726883
Richard @ Damery
Pro
API Scripter
Richard @ Damery said: Is there any problem with running TokenMod through sendChat() from an API? I'm sure this has been working absolutely fine until the last month or so. In August, I could send the following via sendChat() and it would work absolutely fine, changing the image of a token. !token-mod&nbsp; --ignore-selected &nbsp;--ids -Ngyyexy8HRksV92_vGY &nbsp;--set&nbsp; imgsrc|<a href="https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/2839308/_RR8niUb3sTQgLSoxDhM4g/thumb.png?1390447785</a>&nbsp; width|70&nbsp; height|70 Today, it is totally ignored and does nothing when sent via a correctly formatted sendChat() call - I know the sendChat() is correctly formatted as calls to my RPGMaster APIs (such as !magic --pickorput @{selected|token_id}|@{Rm23-Coffer|searcher}|@{Rm23-Coffer|searcher|max}|long) work absolutely fine. If I send the same command from chat, or from an API Button, it works fine. This would be very difficult for me if this fails to work - RoundMaster effects that use TokenMod will not work, and my drag &amp; drop locks and traps will fail. Perhaps there is something that I am doing wrong, or some change notification I've missed? OK, I've been playing around with this issue, and I've reduced the problem down to two issues. I've set up a testbed campaign here and loaded in TokenMod, ChatSetAttr, and a simple API I've created that just takes a command string and sends it to chat, replacing its API command with !token-mod: !tmtest --set bar1_value|8&nbsp; &nbsp; &nbsp;becomes !token-mod --set bar1_value|8 which is then sent to chat using&nbsp; sendChat('player|'+gm, msg, null, {noarchive:true, use3d:false}); where gm is replaced with the gm's ID, and msg is the translated command. (It's a little more complicated than that, but not much). The text of the translated command is sent to both the chat window and to the Mod console so you can check what was actually sent. Problem 1: !token-mod --set bar1_value|8 does not work via sendChat() If I type directly into the chat window !token-mod --set bar1_value|8 &nbsp;with a token selected, all works fine and Bar1 value is set to 8 However, with the token selected if I use !tmtest --set bar1_value|8 &nbsp;which then replaces !tmtest &nbsp;with !token-mod &nbsp;and sends it via sendChat(), nothing happens.&nbsp; I.e. the same command via typing into the chat window, and sending via sendChat() behaves differently. If I send&nbsp; !tmtest --ids - Nh6mIbDpr2SFNncW6BG &nbsp;--set bar1_value|8, all works fine. Problem 2: API commands in quick succession work intermittently My !tmtest API will take multiple commands on the same line: it splits them on the !, then sends each (with the ! replaced of course) to chat via sendChat(). So if I send the command line !tmtest &nbsp;--ids - Nh6mIbDpr2SFNncW6BG --set bar1_value|7 !setattr --charname TestChar --hp|12 This will send two separate commands to chat by two calls to sendChat() , the first being the !token-mod &nbsp;call and the second the !setattr . The !setattr always works, but the !token-mod &nbsp;is intermittent. I can't see any pattern to why TokenMod sometimes does not fire. Why do I need this? In addition to the over 6,000 pre-programmed database items (magic items, Drag &amp; Drop &nbsp;creatures &amp; containers, class &amp; race definitions, weapons, armour, attack specifications, wizard &amp; priest spells...), my APIs allow GMs to create their own spells, powers, spell effects on tokens &amp; character sheets, Drag &amp; Drop &nbsp;locked &amp; trapped containers, etc. Obviously, I can give them help (see the large number of Help Handouts my APIs generate), but I can't control everything they do, so I try to make it as simple as possible for GMs. This requires them to create Roll20 macros in ability fields on character sheets. These include data tags that my API replaces on the fly, such as the name of the shape of an area of effect, or the name of the damage macro to run on a successful hit with a weapon, etc. Many of the macros, especially in the RoundMaster Effects-DB, use TokenMod and ChatSetAttr to alter the tokens and character sheets to reflect the effects the GM wants to occur.&nbsp; The GM can't access my API or write javaScript, so the approach must be to use API calls in this way, and I want those to work easily, and consistently. I've been developing these APIs over 3 years now, and all of this used to work absolutely fine. I went away for a while, and now I'm helping a GM set up his campaign I find certain things aren't working the same way as they used to - this being one. Do have a look at the RPGMaster suite (on One-Click with that name, which will install everything), and then e.g. use the command !magic --extract-db Locks-Traps-DB and !rounds --extract-db Effects-DB and look at the ability fields on the character sheets "Locks-Traps-DB" and "Effects-DB" that are created to see examples of the macros that GM's can write (and that's just one DB of many). As you might realise, this is a bit of a labour of love! I am sure there must be some things I can do better, or differently, to help sort this - as it is I've recently modded all calls to !token-mod to use --api-as &lt;player_id&gt;, though that does not always seem to help. Thoughts very welcome...
1697728773
The Aaron
Roll20 Production Team
API Scripter
Problem 2 sounds like a long standing issue with multi-line messages to the API.&nbsp; It's something that cropped up a few years ago but hasn't been solved.&nbsp; If I were writing a script that issued API commands and wanted to try and avoid this, I would create a queue in my script of the commands to send, then send the first one and watch for it to come back as a chat event, at which point I would remove it from the queue and send the next one.&nbsp; If I didn't see the first one after some reasonable threshold, I would reissue it. Problem 1 is disturbing and I'm not sure what could be going on.&nbsp; Try replacing the | with a # and see if it works at that point: !tmtest &nbsp;--ids - Nh6mIbDpr2SFNncW6BG --set bar1_value#7
1697729112
timmaugh
Pro
API Scripter
So, when you send a command from a mod script, you are actually sending it as the Script Moderator (like a virtual player at the VTT, but one which cannot select tokens). That differs from when you send the command from chat yourself, since you are the player initiating the call and the selected tokens are whatever YOU selected. If you send a command to TokenMod that doesn't have selected tokens and you do NOT use the --ids argument (and have the script properly configured to let players use ids), then TokenMod can't do anything. I think you are running into a combination of this and the requirement to have the --api-as argument (since you're sending it from your script). In any case, the no-tokens-selected thing is exactly what SelectManager was made to solve. Install it, and it will "restore" to the script-generated-message the tokens that were selected as of the initial message. To follow your tmtest example, SelectManager would give to the outbound TokenMod message object all of the tokens that were selected as of you running the tmtest (since, as a human player, you could have tokens selected). If you find that this solves your problem but you don't want to have SelectManager installed... PM me and I can explain how SM does what it does if you want to lift the important bits out for your own use. I think that's overkill, though, as you could just as easily make SelectManager a dependency of your script suite and get the same result... and not have to worry about cases where SelectManager was installed in combination with your suite (either before or after), and then have to deal with whether SelectManager had handled the selected tokens already, or vice versa. As for the lines dropping, I've run into that, too, especially with rapid iterative calls. I even had the problem if I (to borrow again from your example) ran the ChatSetAttr line from a setTimeout(). I found two things that work: 1) a similar technique to how SelectManager handles tokens lets the dispatching script "own" the dispatched TokenMod message until the message comes back from Roll20; then it can release it to TokenMod and only THEN dispatch the ChatSetAttr message. And 2) since this is what ZeroFrame does, just issue the multi-line command using ZeroFrame's batching syntax and let ZeroFrame handle the timing. I don't bring up SelectManager and ZeroFrame just because they're my scripts... I bring them up because the only way all of this works (the above) is by registering at meta-speed and stewarding the messages. You are at a point where you are trying to manage interaction between scripts, which is going to require metascripting ideas; and the specific problems you're running into are problems that have existing solutions. Again, I'm happy to discuss how the metascripts do what they do in PMs (so we don't clutter the TokenMod thread) and you can lift out the functionality you need, but I'd suggest considering the metascripts that are already written to fill these gaps (and building your outbound messages around them) if they will make things easier on you.
timmaugh said: So, when you send a command from a mod script, you are actually sending it as the Script Moderator (like a virtual player at the VTT, but one which cannot select tokens). That differs from when you send the command from chat yourself, since you are the player initiating the call and the selected tokens are whatever YOU selected. If you send a command to TokenMod that doesn't have selected tokens and you do NOT use the --ids argument (and have the script properly configured to let players use ids), then TokenMod can't do anything. I think you are running into a combination of this and the requirement to have the --api-as argument (since you're sending it from your script). In any case, the no-tokens-selected thing is exactly what SelectManager was made to solve. Install it, and it will "restore" to the script-generated-message the tokens that were selected as of the initial message. To follow your tmtest example, SelectManager would give to the outbound TokenMod message object all of the tokens that were selected as of you running the tmtest (since, as a human player, you could have tokens selected). If you find that this solves your problem but you don't want to have SelectManager installed... PM me and I can explain how SM does what it does if you want to lift the important bits out for your own use. I think that's overkill, though, as you could just as easily make SelectManager a dependency of your script suite and get the same result... and not have to worry about cases where SelectManager was installed in combination with your suite (either before or after), and then have to deal with whether SelectManager had handled the selected tokens already, or vice versa. As for the lines dropping, I've run into that, too, especially with rapid iterative calls. I even had the problem if I (to borrow again from your example) ran the ChatSetAttr line from a setTimeout(). I found two things that work: 1) a similar technique to how SelectManager handles tokens lets the dispatching script "own" the dispatched TokenMod message until the message comes back from Roll20; then it can release it to TokenMod and only THEN dispatch the ChatSetAttr message. And 2) since this is what ZeroFrame does, just issue the multi-line command using ZeroFrame's batching syntax and let ZeroFrame handle the timing. I don't bring up SelectManager and ZeroFrame just because they're my scripts... I bring them up because the only way all of this works (the above) is by registering at meta-speed and stewarding the messages. You are at a point where you are trying to manage interaction between scripts, which is going to require metascripting ideas; and the specific problems you're running into are problems that have existing solutions. Again, I'm happy to discuss how the metascripts do what they do in PMs (so we don't clutter the TokenMod thread) and you can lift out the functionality you need, but I'd suggest considering the metascripts that are already written to fill these gaps (and building your outbound messages around them) if they will make things easier on you. Thanks, timmaugh! I'll have a look at all of that.&nbsp; If they work, I can add SelectManager &amp; ZeroFrame to the script.json for my APIs and hide the issue from GMs using my scripts. I have read a bit about metaSripting but it was beyond me at the time - I've actually done a bit of it in my RPGM Library, but very simple stuff!
I'm using TokenMod to randomly set a number in the 'purple' status marker to a d6. Works great, and now I'm trying to output that rolled number using --report. !token-mod --set statusmarkers|purple:[[d6]] --report GM|"{statusmarkers}" The above would output 'purple@6' (assuming 6 was rolled). Is there a way to make it output just the 6?
1697864691
The Aaron
Roll20 Production Team
API Scripter
Not really. There might be a Metascript solution, but for TokenMod I'd need to add something.&nbsp;
1697899569

Edited 1697899625
timmaugh
Pro
API Scripter
Yep, the toolbox can help with that. .. ZeroFrame batching will let you reuse that roll across multiple command lines, so you can share the roll with as much verbiage as you like: !{{ &nbsp; !token-mod --set statusmarkers|purple:[[d6]] --report GM|"{statusmarkers}" &nbsp; /w gm The roll was $[[0]]. }} REQUIRED SCRIPTS: ZeroFrame (Recommended scripts: MetaScriptToolbox)
1697903190
The Aaron
Roll20 Production Team
API Scripter
Probably this will work then: !{{ !token-mod --set statusmarkers|purple:[[d6]] --report GM|"$[[0]]" }}
1697905194
timmaugh
Pro
API Scripter
The Aaron said: Probably this will work then: !{{ !token-mod --set statusmarkers|purple:[[d6]] --report GM|"$[[0]]" }} Oh, if you can do that, then you probably wouldn't need the ZeroFrame batch in the first place... !token-mod --set statusmarkers|purple:[[d6]] --report GM|"$[[0]]"
1697918492
Mike W.
Pro
Sheet Author
The Aaron, is there any way I can preset some default settings and then later refer to that set of settings with a single command? For example, I want to turn off Dynamic lighting, set all the settings to off, etc. Then later after I have set some of those settings on I can turn them all off with a single command. I really love using Token Mod.
1697930219
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Mike W. said: The Aaron, is there any way I can preset some default settings and then later refer to that set of settings with a single command? For example, I want to turn off Dynamic lighting, set all the settings to off, etc. Then later after I have set some of those settings on I can turn them all off with a single command. I really love using Token Mod. Mike, if the goal is better Dynamic Lighting Management, you might want to look at Dynamic Lighting Tool . It has a lot of that logic built in.
Mike W. said: The Aaron, is there any way I can preset some default settings and then later refer to that set of settings with a single command? For example, I want to turn off Dynamic lighting, set all the settings to off, etc. Then later after I have set some of those settings on I can turn them all off with a single command. I really love using Token Mod. You can create a macro for specific settings (such as setting up new tokens, or to set Dynamic Lighting settings). Here's an example: !token-mod {{ --?{UDL Visible Light On/Off?|On,on|Off,off} emits_bright_light emits_low_light --set bright_light_distance|?{UDL Bright Light Distance?|} low_light_distance|?{UDL Low Light Distance?|} }} I have several of these all saved on a Macro Mule character, along with several chat menus to call the macros, instead of saving them as Collections Macros.
1698039336
Mike W.
Pro
Sheet Author
Thanks,&nbsp; Jarren I too have written similar Macros in my Macro Mule. What I wanted was a simple one-line macro that would clear all the settings and set them all to off, 0, etc. I am also going to check in on Keith's suggestion as well.
1698099595
The Aaron
Roll20 Production Team
API Scripter
Hmm.&nbsp; Interesting ask.&nbsp; So something like: !token-mod --default prop1 prop2 prop3 Which would just set each of those properties to whatever the default value on a token would be?
Can anyone take a look at this little druid wildshape script an give me any ideas why its overwriting the player characters hp, ac and pp with whatever wild shape is previously chosen, everything else works as intended its just the players sheet is overwritten by the monsters stats in just these three areas. Im running the latest TokenMod version, Im sure I remember it working before, albeit a year or so ago. !token-mod {{ --set&nbsp; has_bright_light_vision#yes&nbsp; showname#yes ?{Wildshape |Owl,currentside#1 scale#1u represents#@{WS Owl|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset# name#'Keboo&nbsp; Owl' has_night_vision#yes night_vision_distance#120 |Octopus,currentside#2 scale#1u represents#@{WS Octopus|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Octopus' has_night_vision#yes night_vision_distance#30 |Spider,currentside#3 scale#1u represents#@{WS Spider|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Spider' has_night_vision#yes night_vision_distance#30 |Camel,currentside#4 scale#2u represents#@{WS Camel|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Camel' has_night_vision#no |Mastiff,currentside#5 scale#1u represents#@{WS Mastiff|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Mastiff' has_night_vision#no |Giant Badger,currentside#6 scale#1u represents#@{WS Giant Badger|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Badger' has_night_vision#no |Giant Wolf Spider,currentside#7 scale#1u represents#@{WS Giant Wolf Spider|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed&nbsp; bar1_reset# name#'Keboo Giant Wolf Spider' has_night_vision#yes night_vision_distance#60 |Wolf,currentside#8 scale#1u represents#@{WS Wolf|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset# name#'Keboo&nbsp; Wolf' has_night_vision#no |Crocodile,currentside#9 scale#2u represents#@{WS Crocodile|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Crocodile' has_night_vision#no |Warhorse,currentside#10 scale#2u represents#@{WS Warhorse|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Warhorse' has_night_vision#no |Brown Bear,currentside#11 scale#2u represents#@{WS Brown Bear|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Brown Bear' has_night_vision#no |Deinonychus,currentside#12 scale#1u represents#@{WS Deinonychus|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed&nbsp; bar1_reset# name#'Keboo Deinonychus' has_night_vision#no |Giant Hyena,currentside#13 scale#2u represents#@{WS Giant Hyena|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Hyena' has_night_vision#no |Giant Spider,currentside#14 scale#2u represents#@{WS Giant Spider|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Spider' has_night_vision#yes night_vision_distance#60 |Giant Toad,currentside#15 scale#2u represents#@{WS Giant Toad|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Toad' has_night_vision#no |Keboo Littlefellow,currentside#16 scale#1u represents#@{Keboo Littlefellow|character_id} bar1_link#hp bar2_link#ac bar3_link#passive_wisdom&nbsp; name#'Keboo' has_night_vision#no } }} &nbsp;&nbsp;
Kyle W. said: Can anyone take a look at this little druid wildshape script an give me any ideas why its overwriting the player characters hp, ac and pp with whatever wild shape is previously chosen, everything else works as intended its just the players sheet is overwritten by the monsters stats in just these three areas. Im running the latest TokenMod version, Im sure I remember it working before, albeit a year or so ago. !token-mod {{ --set&nbsp; has_bright_light_vision#yes&nbsp; showname#yes ?{Wildshape |Owl,currentside#1 scale#1u represents#@{WS Owl|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset# name#'Keboo&nbsp; Owl' has_night_vision#yes night_vision_distance#120 |Octopus,currentside#2 scale#1u represents#@{WS Octopus|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Octopus' has_night_vision#yes night_vision_distance#30 |Spider,currentside#3 scale#1u represents#@{WS Spider|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Spider' has_night_vision#yes night_vision_distance#30 |Camel,currentside#4 scale#2u represents#@{WS Camel|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Camel' has_night_vision#no |Mastiff,currentside#5 scale#1u represents#@{WS Mastiff|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Mastiff' has_night_vision#no |Giant Badger,currentside#6 scale#1u represents#@{WS Giant Badger|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Badger' has_night_vision#no |Giant Wolf Spider,currentside#7 scale#1u represents#@{WS Giant Wolf Spider|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed&nbsp; bar1_reset# name#'Keboo Giant Wolf Spider' has_night_vision#yes night_vision_distance#60 |Wolf,currentside#8 scale#1u represents#@{WS Wolf|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset# name#'Keboo&nbsp; Wolf' has_night_vision#no |Crocodile,currentside#9 scale#2u represents#@{WS Crocodile|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Crocodile' has_night_vision#no |Warhorse,currentside#10 scale#2u represents#@{WS Warhorse|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Warhorse' has_night_vision#no |Brown Bear,currentside#11 scale#2u represents#@{WS Brown Bear|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Brown Bear' has_night_vision#no |Deinonychus,currentside#12 scale#1u represents#@{WS Deinonychus|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed&nbsp; bar1_reset# name#'Keboo Deinonychus' has_night_vision#no |Giant Hyena,currentside#13 scale#2u represents#@{WS Giant Hyena|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Hyena' has_night_vision#no |Giant Spider,currentside#14 scale#2u represents#@{WS Giant Spider|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Spider' has_night_vision#yes night_vision_distance#60 |Giant Toad,currentside#15 scale#2u represents#@{WS Giant Toad|character_id} bar1_link#hp&nbsp; bar2_link#npc_ac bar3_link#npc_speed bar1_reset#&nbsp; name#'Keboo Giant Toad' has_night_vision#no |Keboo Littlefellow,currentside#16 scale#1u represents#@{Keboo Littlefellow|character_id} bar1_link#hp bar2_link#ac bar3_link#passive_wisdom&nbsp; name#'Keboo' has_night_vision#no } }} &nbsp;&nbsp; have you tried&nbsp; D&amp;D 5E - WildShape
lark86 said have you tried&nbsp; D&amp;D 5E - WildShape I have not, but I would be interested in an easier solution than setting up all the rollable tables and alternate tokens, thanks for the suggestion.
1701112908
The Aaron
Roll20 Production Team
API Scripter
The bar linking code is a little problematic.&nbsp; There have been a few changes in the backend that changed the way it behaved and I think it's currently mismatched.&nbsp; I'll try and take a look at&nbsp; that, but I second&nbsp; lark86 's suggestion of looking at the WildShape script.&nbsp; Often times, a special purpose script can work much better than a general purpose one.
Trying to get this to adjust Field of vision on the fly, but am missing something... This is not working for me... any assistance please... !token-mod --set field_of_vision_total|45
1701116920
The Aaron
Roll20 Production Team
API Scripter
Here's the post where I introduced UDL settings for limited field of view:&nbsp; <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/?pageforid=9064542#post-9064542" 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/?pageforid=9064542#post-9064542</a> Probably you need this at a minimum: !token-mod --set has_limit_field_of_vision|yes limit_field_of_vision_total|45 UDL's vision model is quite a bit more complicated, so there are a few more things that you need to do to make use of it.
The Aaron said: The bar linking code is a little problematic.&nbsp; There have been a few changes in the backend that changed the way it behaved and I think it's currently mismatched.&nbsp; I'll try and take a look at&nbsp; that, but I second&nbsp; lark86 's suggestion of looking at the WildShape script.&nbsp; Often times, a special purpose script can work much better than a general purpose one. Thank you @The Aaron,&nbsp; I was able to write this script and get this far with a video provided by Nick Olivo, sadly I cannot find that video anymore. Are there any similar videos instructing the use of DND 5e Wildshape mod. I always learn better by seeing, Im trying this mod but have not made heads or tails of it as of yet.
1701120247
The Aaron
Roll20 Production Team
API Scripter
Here's one for DND 5e Wildshape:&nbsp; <a href="https://www.youtube.com/watch?v=uzlnNxeaJyE" rel="nofollow">https://www.youtube.com/watch?v=uzlnNxeaJyE</a>
The Aaron said: Here's one for DND 5e Wildshape:&nbsp; <a href="https://www.youtube.com/watch?v=uzlnNxeaJyE" rel="nofollow">https://www.youtube.com/watch?v=uzlnNxeaJyE</a> Thanks, Ive gotten dnd 5e wildshape to work guess the hard way is obsolete lol, thanks again
Hello! I've noticed this issue with Tokenmod, in terms of setting the current side of a token.&nbsp; Using:&nbsp; !token-mod --set currentside|+ or any variant of the command makes animations/Webms inside the multi-token not play properly. They don't play. Even if I hit play, they stop looping entirely until I turn off looping, and turn it back on.&nbsp; Using the normal method of Choose side&gt;Webm side, it plays normally.&nbsp; Is there any way to fix this?
I believe that's a current system limitation . It sounds like that's also a big part of the Jumpgate overhaul &nbsp;that has been announced, as there were several references to improved performance for graphics, and animated tokens were specifically shown in the demo video.
How would I pass damage from a Scriptcard to Token Mod? The card generates [$Damage] as a variable, I want to take it from bar1 of a token.
1701476209
The Aaron
Roll20 Production Team
API Scripter
I don't use Scriptcard, but should be: !token-mod --set bar1_current|-[$Damage]
In ScriptCards the syntax to call a mod replaces the double dashes with underscores like so: --@token-mod|_set bar1_value|-[$Damage] I used to also use _ids in the call to token-mod as well. More info about ScriptCards call mod syntax Alternatively, you can also use&nbsp; ScriptCards object modification &nbsp;without the need for token mod. One of the main advantages is that you can then reference that later in the same ScriptCard macro whereas shelling out to TokenMod basically takes place after the ScriptCard. so something like: --!t:@{selected|token_id}|bar1_value:-=[$Damage]
Hi folks, is there a way to toggle the directional light on/off in UDL? I found the commands to set the total and center but can't get the switch to move
1701969531
The Aaron
Roll20 Production Team
API Scripter
What you're looking for is: !token-mod --flip has_directional_bright_light has_directional_dim_light Behind the scenes, there are actually two settings, one for bright and one for dim.
Aaron, I am trying to use token-mod to track ammo in the Everyday Heroes sheet, but it doesn't seem to be parsing token-mod commands.&nbsp;&nbsp;
1702597941
The Aaron
Roll20 Production Team
API Scripter
I'm not familiar with that sheet.&nbsp; Does that section at the bottom get sent to chat?&nbsp; (or is this the output in chat?)
Hello, I'm trying to use TokenMod to add status markers using animated webm files. It kind of works, but instead of placing the file over the token, it replaces it. It also doesn't loop the animation. Is this at all possible? Thanks