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

Is it possible to determine which player moved a token?

1526560200
Laurent
Pro
Sheet Author
API Scripter
Is there a way in the API to know who moved a token when receiving a "change:token:left" (or top or rotation) event?
1526560564
The Aaron
Pro
API Scripter
There isn't.  Sometimes you can infer the information (no controlled by--was the GM, only one controlled by--probably that player, only one player logged in--likely them), but otherwise there is no information in the event to indicate who it was.
1526560907
Laurent
Pro
Sheet Author
API Scripter
Thanks for the quick answer. I'll manage otherwise, then.
1526561059
The Aaron
Pro
API Scripter
Yeah, it's been a thorn in my side for years. =D
I believe there is or was a script that only allowed players to move during their turns. Do you want that?
1526634951
Laurent
Pro
Sheet Author
API Scripter
No, I want players not to be able to move their 'paralyzed' tokens, but that the GM could still do it. So I think I will prevent paralyzed token from moving, but send a button to the GM to allow such a move when it is attempted. This should work, since changes from the API don't send events, if I'm not mistaken.
1526651055
The Aaron
Pro
API Scripter
You could use MapLock to prevent them from moving (well, it actually moves them back), and then just toggle it on and off for the token if you need to move it.