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

Rotate Token API?

I'm just looking to add a fun little special effect to a climactic fight in my campaign.  I want a token to spin constantly, without me selecting it and scrolling my mouse wheel. Is there any way I can automate this without having the token selected, so I can focus on other parts of the map?
1463757838

Edited 1463757907
vÍnce
Pro
Sheet Author
Maybe Aaron's SpinToken script?&nbsp; <a href="https://app.roll20.net/forum/permalink/1380961/" rel="nofollow">https://app.roll20.net/forum/permalink/1380961/</a>
1463758660
The Aaron
Pro
API Scripter
Looks really great with narrowed light sources, spinning search-light style. =D &nbsp;You can also use it to create a clock.&nbsp;
1463758848
The Aaron
Pro
API Scripter
I updated that link to reflect the new location in git. &nbsp;It's also in the Official Roll20 Repo.
1463759881
vÍnce
Pro
Sheet Author
The Aaron said: Looks really great with narrowed light sources, spinning search-light style. =D &nbsp;You can also use it to create a clock.&nbsp; It can even be used to spin Saruman on the water wheel for your The One Ring game... &nbsp;;-P
Is the answer not always, "Use one of The Aaron's scripts"? Thanks for the help.
1463768512
The Aaron
Pro
API Scripter
=D &nbsp;I do try to provide useful things... &nbsp;=D
Currently no way to 'bias a rotation' as you put it, correct? Or to spin things on another layer, like the Dynamic Lighting layer, for instance?
1463775635
The Aaron
Pro
API Scripter
hmm... It shouldn't care what layer the graphic is on. &nbsp;In fact, it should be perfectly happy for you to move or change layers as desired even while it's spinning. (though because of race conditions, it might not let you.) As for a bias, no, not yet. &nbsp;You can download a graphic and rotate it to a given angle then reupload it if you need that functionality specifically. &nbsp;I never came up with an actual use case outside the clock idea. &nbsp;Is it something you need?
1463778379
Lithl
Pro
Sheet Author
API Scripter
The Aaron said: hmm... It shouldn't care what layer the graphic is on. &nbsp;In fact, it should be perfectly happy for you to move or change layers as desired even while it's spinning. (though because of race conditions, it might not let you.) Although simply rotating a path on the DL layer isn't enough to actually affect the page's lighting.
Aaron- trying to set two objects, each emitting a cone of light, to rotate like a lighthouse beacon. Instead, both rotate the same and are therefore indistinguishable from each other. Brian- you're right, found this out the hard way. Since I couldn't get the lights to move in alternating phases, I thought a single multi-part object on the dynamic lighting layer could rotate and block two opposing 90 degree wide parts of the lighthouse beacon enclosure.
1463802681
The Aaron
Pro
API Scripter
Ah, that's a great real world example!
1463806868

Edited 1463807120
Lithl
Pro
Sheet Author
API Scripter
Daniel T. said: Brian- you're right, found this out the hard way. Since I couldn't get the lights to move in alternating phases, I thought a single multi-part object on the dynamic lighting layer could rotate and block two opposing 90 degree wide parts of the lighthouse beacon enclosure. That said, it's not impossible to get the result &nbsp;of what you would expect from rotating a DL path. You simply have to create a new path with each point in the path rotated around the path's center. Aaron posted a pretty short snippet of code a while ago to accomplish that for rectangles and polylines, but I'm not sure if he's hung onto it (I know I haven't) and I don't recall what thread it was in. Maybe he'll reproduce it for you. =P If you're trying to get light cones emitting from opposite ends of a token, you could duplicate the token and flip the second vertically, then rotate it 180 degrees relative to the original. Give them the same light angle, and you've got your beacon.