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

[Query] Token Status Animations

I know very little about writing script but I was wondering about the possibility of perhaps using the API to alter the image used on a token so a sleeping guard could look visually different from an angry one depending on their conditions or afflicted statuses. I'm somewhat of an aspiring artist and would love it if a character would occasionally upchuck if afflicted with poison, setup on like a random interval of turns/movement. Then you could have little upchuck puddle assets that evoke attacks of opportunity on a 50% chance for slipping on it at a dead sprint. I know I'm getting a little ahead of myself, I just don't know how possible it would be given the current tools available. And for the record, if it turns out it's possible I'm not above drawing 15-20 status images per character. Just because of how badass that would be to have.
1421002619
The Aaron
Roll20 Production Team
API Scripter
So, you can programmatically change the imgsrc of a token with the caveat that: The image you are setting it to must be in a player library (not purchased, but uploaded, any player will do, doesn't have to be you) The image url is the /thumb.png version. If you fail either of those conditions, the image will not update (but the script won't crash) and an error will be writtin to the API log.
this is also very specific, you'd have to hardcode it or have some list mechanic with pop ups or specific manual data entry requirements. I'm not sure if roll20 will update on the img source change, I'm not sure of roll20's update-page requirements.
1421039149
The Aaron
Roll20 Production Team
API Scripter
Tokens will update on imgsrc change from the API. They will not update on side change for rollable table tokens currebtly.