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

Can I use the API to change token image based on character direction?

January 07 (7 years ago)
I would like to know if it is possible to use the API to change the image of a token base upon the direction it's facing.

The closest example I could give is oldschool video game RPGs with the sprites, where your sprite changes depending on the direction you were walking.

I will still probably end up getting the API anyhow, after reading what it can do and what I can't do with Macros (like setting Attribute values).
January 07 (7 years ago)
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Yes. The images for the token must be ones you have uploaded though.
January 07 (7 years ago)
Awesome, thanks!
January 07 (7 years ago)

Edited January 07 (7 years ago)
plexsoup
Marketplace Creator
Sheet Author
API Scripter
You're in luck. I' ve got a script for you. It flips the token left/right.
Start here: https://youtu.be/JAzsj9iVeW4
Get the script here: https://gist.github.com/plexsoup/6fb407c51d3ded601...

Bonus, you also get a directional light!
January 07 (7 years ago)
vÍnce
Pro
Sheet Author

plexsoup said:

You're in luck. I' ve got a script for you. It flips the token left/right.
Start here: https://youtu.be/JAzsj9iVeW4
Get the script here: https://gist.github.com/plexsoup/6fb407c51d3ded601...

Bonus, you also get a directional light!
Plexsoup does some GREAT stuff.  Thank you.

January 09 (7 years ago)
plexsoup
Marketplace Creator
Sheet Author
API Scripter
Thanks Vince! It's all for that sweet, sweet dopamine.
January 09 (7 years ago)
This is almost exactly what I want.  Thank you very much!
January 09 (7 years ago)
vÍnce
Pro
Sheet Author

plexsoup said:

Thanks Vince! It's all for that sweet, sweet dopamine.
Whatever Gets You Thru The Night


January 09 (7 years ago)
Lithl
Pro
Sheet Author
API Scripter

Stephen L. said:

Yes. The images for the token must be ones you have uploaded though.
That somebody has uploaded, not necessarily you. =)