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

Help - Multi-sided token de-selects on changing face via API script

I'm trying to put together an API script that changes the side of a multi-sided token, depending on token movement. I have kludged together bits of this script to change token side, and this one to determine angle of movement. I have an extremely rudimentary understanding of Javascript, so most of this has been guesswork. So far, the script works mostly as intended. However, every time the token changes side it will deselect the token - forcing the GM/player to re-select it before being able to move further. This is using the arrow keys and grid snap movement. Is there any way I can either automatically re-select the token after it has changed side, or bypass the de-selecting behavior in the script itself? Before movement: Pressing arrow keys ↓ + →
1600688652
David M.
Pro
API Scripter
This isn't very helpful, but there is no way to re-select a token through the api ( reference ), since it can't interface with the VTT directly. An interesting but irritating problem, for sure. Hopefully one of the lurking js gurus has encountered this before and has some kind of solution. A real longshot, but does it matter if the token is converted to a Drawing first (via right click->advanced->IsDrawing)? Following...
1600690018
The Aaron
Roll20 Production Team
API Scripter
I was basically going to post what David said.  The only way I can think of to get the effect that you want is to have two graphics: a clear one the player is moving and the actual graphic which the api moves and rotated.