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.

January 21 (6 years ago)
Joe
Pro

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.

January 21 (6 years ago)


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

January 21 (6 years ago)
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. 

January 21 (6 years ago)

Edited January 21 (6 years ago)
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 ;-)).

January 21 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Aaron posted an example a couple of posts later.

January 21 (6 years ago)
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. 

January 21 (6 years ago)
Joe
Pro

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.




January 21 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

It’s a good point. Fixed!

January 21 (6 years ago)
Joe
Pro

I’m happy to report that after hand-copying as a new script the new feature works great!  Thanks again! :-)

January 21 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

Sweet. =D. Let me know if you come up with any more enhancements!

January 22 (6 years ago)

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?

January 22 (6 years ago)
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. 

January 22 (6 years ago)

Edited January 22 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

This (version with scale and u,g,s modifiers) should be live now. 

January 28 (6 years ago)

Edited January 28 (6 years ago)
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.

https://imgur.com/jM7ocl9

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. 

January 28 (6 years ago)
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.

January 29 (6 years ago)
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. 

January 29 (6 years ago)
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. 

January 29 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

Hmm. I’ll have to see if I can duplicate the behavior. 

January 31 (6 years ago)

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.  Now the graphic goes ALL the way to the left of the screen, moves a smidgen (probably 2d10 pixels) and then disappears.  When I reload, it ends up where it should be.  

January 31 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

Ug!  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. 

January 31 (6 years ago)

Yes i believe im using the latest.  Used the one click install with the latest option.  I figured it was related to what he mentioned.

January 31 (6 years ago)

Edited February 01 (6 years ago)

Aaron, it's all so new yet, so I'm sure there are a lot of bug fixes/ workarounds to tackle first.  Before getting to suggestions, I definitely want to see existing features restored.  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)?  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
January 31 (6 years ago)

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

February 01 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

That appears to be problem beyond the API.  I can't manually set any auras either.

February 01 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

Verified this is a known issue: https://app.roll20.net/forum/post/7160288/animations-and-afow-offical-feedback-thread/?pageforid=7160288#post-7160288


February 01 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

If the grid is off, auras don't show up right.

February 01 (6 years ago)

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

February 05 (6 years ago)

Edited February 05 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

Update v0.8.43 -- Added displaying 0 on status markers where that makes sense.  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.  Previously, 0 was represented as no number, but now it will display.  This is great for showing things like elevation:

!token-mod --set statusmarkers|fluffy-wing[1]:3|fluffy-wing[2]:0



February 05 (6 years ago)

Edited February 05 (6 years ago)
Joe
Pro

Fantastic timing, thank you!  I was just about to change my Fly script before my game tonight. :-)

February 05 (6 years ago)
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!

February 05 (6 years ago)
Joe
Pro

I meant I use TokenMod, like I do for 90% of my macros. ;-) 

February 05 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

Well, good then!  Glad I got it out in time!  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

February 05 (6 years ago)


The Aaron said:

Update v0.8.43 -- Added displaying 0 on status markers where that makes sense.  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.  Previously, 0 was represented as no number, but now it will display.  This is great for showing things like elevation:

!token-mod --set statusmarkers|fluffy-wing[1]:3|fluffy-wing[2]:0




Very nice!

February 05 (6 years ago)
I wish they would allow us to go from 00-99 instead of 0-9, but oh well ...
February 05 (6 years ago)
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.


February 05 (6 years ago)
Joe
Pro


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*

February 05 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

That would be cool. Thanks Aaron!

February 05 (6 years ago)

Edited February 05 (6 years ago)


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?  That would certainly help that too, to know exactly what die to use instead of halving that value to get it under 9.  This way a d6 could be allforone:6, not alforone:3



February 05 (6 years ago)

Edited February 05 (6 years ago)


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?  Lately I've been getting it when using the bubbles to degrade HP also.  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.  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.  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.).

February 05 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

I bet there’s a stylus config that could improve that. 

February 05 (6 years ago)

Edited February 05 (6 years ago)
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.  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.  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. 

https://app.roll20.net/forum/permalink/6903614/

You can use the Stylus browser extension to override roll20's default style.

here's a snippet from Noon

https://app.roll20.net/forum/permalink/6911577/




February 05 (6 years ago)

Edited February 05 (6 years ago)


The Aaron said:

I bet there’s a stylus config that could improve that. 


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

https://app.roll20.net/forum/permalink/6903614/

You can use the Stylus browser extension to override roll20's default style.

here's a snippet from Noon

https://app.roll20.net/forum/permalink/6911577/





Awesome.  I learn new things from y'all every day!

Just want to know about the lag issue.  Is there a top end to API scripts you should have on your campaign?  I have 26, but several are snippets (recursive tables, RealizeStatusMarkers, etc.) and support functions for other APIs (VectorMath, MatrixMath, PathMath, TokenCollisions, etc.).  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.


February 05 (6 years ago)

Edited February 05 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Beat me to the punch, Vince!

February 06 (6 years ago)
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.  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.  Try rebooting your computer, disabling things that might be running in the background.  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.  Also try disabling dynamic lighting.  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.

February 06 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

v0.8.43 is now live in one-click install.

February 06 (6 years ago)
Joe
Pro

Thanks again!

The Aaron said:

v0.8.43 is now live in one-click install.




February 06 (6 years ago)
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...


February 06 (6 years ago)
The Aaron
Roll20 Production Team
API Scripter

Me too, man. =D

February 06 (6 years ago)

ok - back on topic - have you decided to go double digits on the statusmarkers?  Is it possible?

February 06 (6 years ago)


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.  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.  Try rebooting your computer, disabling things that might be running in the background.  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.  Also try disabling dynamic lighting.  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.  Even though I saw it was disabled ... "WeightedDice", eh?  LMAO