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.

Hi Aaron, thanks for the quick turn-around and adding this feature!  I'm looking forward to using it. Please remind me, how long does it usually take to push out a new version?  Reloading my API shows TokenMod at v0.8.41, not 42, even though I have "Latest" version selected.
Joe said: Hi Aaron, thanks for the quick turn-around and adding this feature!  I'm looking forward to using it. Please remind me, how long does it usually take to push out a new version?  Reloading my API shows TokenMod at v0.8.41, not 42, even though I have "Latest" version selected. Its the weekend, sure it won't be before Monday ...
1548039092
The Aaron
Roll20 Production Team
API Scripter
They usually do it on tuesdays. Might be next Tuesday though. You can get the latest version from my repo if you want to try it out before then. Link in the first post. 
1548079650

Edited 1548079665
Joe
Pro
The Aaron said: They usually do it on tuesdays. Might be next Tuesday though. You can get the latest version from my repo if you want to try it out before then. Link in the first post.  Thanks, I’ll do that. As a very minor note, in your version description on this thread (just previously and in the first post) you wrote: “ Additionally, I added a pseudo field  Scale : scale  is a pseudo field which adjusts both  width  and  height  with the same operation. This will scale a token to twice it's current size.” However, the “this will scale...” sounds like there will be an example after it, and there isn’t (I know there is in the help, and that’s the important place; that’s why this is a very minor note ;-)).
1548084059
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Aaron posted an example a couple of posts later.
1548084335
The Aaron
Roll20 Production Team
API Scripter
That’s a good point. I was being rushed by the wife to get the kids out of the house. The help, from where I shamelessly copy/pasted that, has an example following it of exactly that nature. 
Yes, I did see that, and this isn’t meant as a critique, just a helpful pointing out of a typo that he might want to fix on the top post of this thread for future viewers. No biggie, but worth editing at some point IMHO. keithcurtis said: Aaron posted an example a couple of posts later.
1548091036
The Aaron
Roll20 Production Team
API Scripter
It’s a good point. Fixed!
I’m happy to report that after hand-copying as a new script the new feature works great!  Thanks again! :-)
1548102098
The Aaron
Roll20 Production Team
API Scripter
Sweet. =D. Let me know if you come up with any more enhancements!
Hello, I love seeing this getting some updates. Has anything been done with doing recursive tasks to tokens? Going way back to random HP for tokens using a custom formula?
1548178040
The Aaron
Roll20 Production Team
API Scripter
Good reminder. Not yet. There’s a question of how to specify that, and how to capture what to apply. 
1548192862

Edited 1548192911
The Aaron
Roll20 Production Team
API Scripter
This (version with scale and u,g,s modifiers) should be live now. 
1548718211

Edited 1548718343
Mik Holmes
Pro
Marketplace Creator
Hey, since the scale update, there seems to be a bit of a bug. When I select one or more tokens and run --set scale|*2 (or --set width|*2 height|*2), it correctly sizes up the graphic, but Roll20 seems to think the token's location is different from the graphic, and it messes with the token's normal size handles in such a way that the first time moving the token will size-snap it to the grid. <a href="https://imgur.com/jM7ocl9" rel="nofollow">https://imgur.com/jM7ocl9</a> In blue is where my mouse cursor is, clicking once after running tokenmod, but it's selecting Lyn. In red, it shows what I mean by the token's size handles. Only the top left three are showing.&nbsp;
1548719695
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I can confirm the first part. I ignored it because it seemed to settle down after I selected other objects.
1548720045
The Aaron
Roll20 Production Team
API Scripter
Hmm. See if the previous version has the same behavior. This pretty much has to be a Roll20 issue, scale literally just expands to width and height.&nbsp;
1548720237
Mik Holmes
Pro
Marketplace Creator
It seems to fix itself once I've selected it once, but when I'm resizing a batch of tokens at the same time, I have to select each of them in turn which can take a while. The latter part is the big issue for me; there's a small familiar in my game that snaps to a full grid unit even if I alt-select it.&nbsp;
1548720387
The Aaron
Roll20 Production Team
API Scripter
Hmm. I’ll have to see if I can duplicate the behavior.&nbsp;
Hey Aaron, I think since the change that roll20 did, my token-mod regarding movement has gone wonky. Before I could use --set left|+[[2d10]] and it would move 2d10 pixels to the right.&nbsp; Now the graphic goes ALL the way to the left of the screen, moves a smidgen (probably 2d10 pixels) and then disappears.&nbsp; When I reload, it ends up where it should be.&nbsp;&nbsp;
1548912149
The Aaron
Roll20 Production Team
API Scripter
Ug! &nbsp;That sounds related to what Mik was saying. I’ll try to duplicate the issue, I’m betting on a Roll20 bug, but I’ll try your command and see. You’re using the latest version, right? Just want to make sure I test apples to apples.&nbsp;
Yes i believe im using the latest.&nbsp; Used the one click install with the latest option.&nbsp; I figured it was related to what he mentioned.
1548961063

Edited 1549004912
Aaron, it's all so new yet, so I'm sure there are a lot of bug fixes/ workarounds to tackle first.&nbsp; Before getting to suggestions, I definitely want to see existing features restored.&nbsp; So consider the next as a back-burner idea ... Suggestion/ Feature: When those are fixed, could we see new controls for stopping and starting the animated tokens (looping)?&nbsp; Could be useful to macro animated traps. !token-mod --set ani-looping|on !token-mod --set ani-looping|off !token-mod --flip ani-looping|on
Hello Guys I am also experiencing problem with one of the macros. It was working before the update and is not at all complicated. I dont really dont know what may be wrong !token-mod --set aura1_radius|8 aura2_radius|16 Is only this but when i click is not working. I cannot see the auras popping. Dont know what I am missing
1548984581
The Aaron
Roll20 Production Team
API Scripter
That appears to be problem beyond the API.&nbsp; I can't manually set any auras either.
1548984777
The Aaron
Roll20 Production Team
API Scripter
Verified this is a known issue:&nbsp;<a href="https://app.roll20.net/forum/post/7160288/animations-and-afow-offical-feedback-thread/?pageforid=7160288#post-7160288" rel="nofollow">https://app.roll20.net/forum/post/7160288/animations-and-afow-offical-feedback-thread/?pageforid=7160288#post-7160288</a>
1548984803
The Aaron
Roll20 Production Team
API Scripter
If the grid is off, auras don't show up right.
Yeah, I saw that is a bug after the new patch. Thx Aaron. I tought it was weird that the other macros were working and not my distance/range macros that I use with auras
1549337022

Edited 1549337119
The Aaron
Roll20 Production Team
API Scripter
Update v0.8.43 &nbsp;-- Added displaying 0 on status markers where that makes sense.&nbsp; Fixed ordering of status markers (Roll20 Update changed the ordering). One new thing in Roll20 since the update is that Status Markers can show a 0.&nbsp; Previously, 0 was represented as no number, but now it will display.&nbsp; This is great for showing things like elevation: !token-mod --set statusmarkers|fluffy-wing[1]:3|fluffy-wing[2]:0
1549369396

Edited 1549369411
Joe
Pro
Fantastic timing, thank you! &nbsp;I was just about to change my Fly script before my game tonight. :-)
1549369590
The Aaron
Roll20 Production Team
API Scripter
=D. Sweet. If you have a different script specifically for flying, I can point you toward how to fix it. Or if you mean you’re already using TokenMod for it and it was messing up the order, then great, that should work with version 0.8.43!
I meant I use TokenMod, like I do for 90% of my macros. ;-)&nbsp;
1549370132
The Aaron
Roll20 Production Team
API Scripter
Well, good then! &nbsp;Glad I got it out in time! &nbsp;You’ll probably need to grab it from my repo, but they may get it merged to the one-click by tonight, depending on when that is for you. =D
The Aaron said: Update v0.8.43 &nbsp;-- Added displaying 0 on status markers where that makes sense.&nbsp; Fixed ordering of status markers (Roll20 Update changed the ordering). One new thing in Roll20 since the update is that Status Markers can show a 0.&nbsp; Previously, 0 was represented as no number, but now it will display.&nbsp; This is great for showing things like elevation: !token-mod --set statusmarkers|fluffy-wing[1]:3|fluffy-wing[2]:0 Very nice!
I wish they would allow us to go from 00-99 instead of 0-9, but oh well ...
1549386982
The Aaron
Roll20 Production Team
API Scripter
I’m considering rewriting the statusmarkers code in TokenMod to handle the extra digits automatically, so you’d just say statusmarkers|blue:32 And it would add or remove digit statuses for you.
The Aaron said: I’m considering rewriting the statusmarkers code in TokenMod to handle the extra digits automatically, so you’d just say statusmarkers|blue:32 And it would add or remove digit statuses for you. That would certainly make the flight macro simpler, taking only one query instead of two. *thumbs up*
1549387573
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That would be cool. Thanks Aaron!
1549403057

Edited 1549403252
The Aaron said: I’m considering rewriting the statusmarkers code in TokenMod to handle the extra digits automatically, so you’d just say statusmarkers|blue:32 And it would add or remove digit statuses for you. Remember the bard inspiration roll/ Realize Status Markers ?&nbsp; That would certainly help that too, to know exactly what die to use instead of halving that value to get it under 9.&nbsp; This way a d6 could be allforone:6, not alforone:3
1549403374

Edited 1549403874
Joe said: The Aaron said: I’m considering rewriting the statusmarkers code in TokenMod to handle the extra digits automatically, so you’d just say statusmarkers|blue:32 And it would add or remove digit statuses for you. That would certainly make the flight macro simpler, taking only one query instead of two. *thumbs up* Does anyone else get lag when responding to queries, or is that just my old@$$ machine?&nbsp; Lately I've been getting it when using the bubbles to degrade HP also.&nbsp; Wasn't sure if it was because of using APIs or something native to Roll20. Also wish they would increase the standard text box size when writing in text, or use the textarea tag in addition to the input text tag as query options.&nbsp; When you are using the query command to input a lot of text (say a response to a player's question in a private message) the input text field is not enough space to work with.&nbsp; Same is true if adding an optional amount of text in Rollable Table entries (as when talking to a specific NPC, for example, who might know some random tidbits of info.).
1549406198
The Aaron
Roll20 Production Team
API Scripter
I bet there’s a stylus config that could improve that.&nbsp;
1549406452

Edited 1549406537
vÍnce
Pro
Sheet Author
Wolf Thunderspirit said: Also wish they would increase the standard text box size when writing in text, or use the textarea tag in addition to the input text tag as query options.&nbsp; When you are using the query command to input a lot of text (say a response to a player's question in a private message) the input text field is not enough space to work with.&nbsp; Same is true if adding an optional amount of text in Rollable Table entries (as when talking to a specific NPC, for example, who might know some random tidbits of info.). This came up recently.&nbsp; <a href="https://app.roll20.net/forum/permalink/6903614/" rel="nofollow">https://app.roll20.net/forum/permalink/6903614/</a> You can use the Stylus browser extension to override roll20's default style. here's a snippet from Noon <a href="https://app.roll20.net/forum/permalink/6911577/" rel="nofollow">https://app.roll20.net/forum/permalink/6911577/</a>
1549407777

Edited 1549408148
The Aaron said: I bet there’s a stylus config that could improve that.&nbsp; Vince said: Wolf Thunderspirit said: Also wish they would increase the standard text box size when writing in text, or use the textarea tag in addition to the input text tag as query options.&nbsp; When you are using the query command to input a lot of text (say a response to a player's question in a private message) the input text field is not enough space to work with.&nbsp; Same is true if adding an optional amount of text in Rollable Table entries (as when talking to a specific NPC, for example, who might know some random tidbits of info.). This came up recently.&nbsp; <a href="https://app.roll20.net/forum/permalink/6903614/" rel="nofollow">https://app.roll20.net/forum/permalink/6903614/</a> You can use the Stylus browser extension to override roll20's default style. here's a snippet from Noon <a href="https://app.roll20.net/forum/permalink/6911577/" rel="nofollow">https://app.roll20.net/forum/permalink/6911577/</a> Awesome.&nbsp; I learn new things from y'all every day! Just want to know about the lag issue.&nbsp; Is there a top end to API scripts you should have on your campaign?&nbsp; I have 26, but several are snippets (recursive tables, RealizeStatusMarkers, etc.) and support functions for other APIs (VectorMath, MatrixMath, PathMath, TokenCollisions, etc.).&nbsp; Just wanted to know if I'm my own worst enemy here and should think about trimming down to absolutely necessary only in order to reduce lag. Don't wanna derail the topic, just think it's important for end users like me to know.
1549408064

Edited 1549408081
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Beat me to the punch, Vince!
1549412086
The Aaron
Roll20 Production Team
API Scripter
I think it would be hard to have too many scripts... It really has more to do with what the scripts are doing, when it comes to misbehaving APIs. That said, when the API is misbehaving, it doesn't have an effect on the performance for the client. If your client is running slowly, it's more likely to be something about the browser, the local computer, or possibly something in the chat archive.&nbsp; I would suggest trying a different browser, or trying a browser in Incognito/private mode, disabling extensions or functionality of the browser that causes it to traverse the website DOM (Firefox had a thing with autocomplete that killed it's performance for a while.&nbsp; Try rebooting your computer, disabling things that might be running in the background.&nbsp; And finally, try torching your chat archive. If none of that helps, well... I'm not sure what to try next. Oh, if you're using Advanced Fog of War, try disabling that.&nbsp; Also try disabling dynamic lighting.&nbsp; And be certain that your browser is using hardware acceleration. I've not noticed any problems in Firefox or Chrome on the Mac, but I have a pretty beefy Mac currently.
1549412229
The Aaron
Roll20 Production Team
API Scripter
v0.8.43 is now live in one-click install.
Thanks again! The Aaron said: v0.8.43 is now live in one-click install.
1549415453
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Aaron said: I think it would be hard to have too many scripts... Every time you post an image like that, I have to read all the titles and wonder what everything does...
1549416154
The Aaron
Roll20 Production Team
API Scripter
Me too, man. =D
ok - back on topic - have you decided to go double digits on the statusmarkers?&nbsp; Is it possible?
The Aaron said: I think it would be hard to have too many scripts... It really has more to do with what the scripts are doing, when it comes to misbehaving APIs. That said, when the API is misbehaving, it doesn't have an effect on the performance for the client. If your client is running slowly, it's more likely to be something about the browser, the local computer, or possibly something in the chat archive.&nbsp; I would suggest trying a different browser, or trying a browser in Incognito/private mode, disabling extensions or functionality of the browser that causes it to traverse the website DOM (Firefox had a thing with autocomplete that killed it's performance for a while.&nbsp; Try rebooting your computer, disabling things that might be running in the background.&nbsp; And finally, try torching your chat archive. If none of that helps, well... I'm not sure what to try next. Oh, if you're using Advanced Fog of War, try disabling that.&nbsp; Also try disabling dynamic lighting.&nbsp; And be certain that your browser is using hardware acceleration. I've not noticed any problems in Firefox or Chrome on the Mac, but I have a pretty beefy Mac currently. Hrmmmmmmm .... remind me not to be in one of ur campaigns.&nbsp; Even though I saw it was disabled ... "WeightedDice", eh?&nbsp; LMAO