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

Lock Movement When Not on Top of Turn Counter

So, I have no idea what exactly is available in the API as far as functions go~ Would it be possible to make it so that players can only move their tokens (keyboard or mouse) when they're at the top of the turn counter?
1428727492
Gen Kitty
Forum Champion
Yes, it is possible, and there's a script or two floating around here that do that. Sadly, I don't have any direct links, but search the forums and you should find at least one. ^_^
1428778720
The Aaron
Pro
API Scripter
<a href="https://app.roll20.net/forum/post/1033747/script-t" rel="nofollow">https://app.roll20.net/forum/post/1033747/script-t</a>... you can just add this between lines 99 and 100 to get this effect: && ( ('' !== Campaign().get('turnorder')) ? (JSON.parse(Campaign().get('turnorder'))[0].id) : undefined) !== obj.id
Awesome, thanks to both of you!
Aaron I inserted this between lines 99 and 100 as recommended, but it doesn't seem to have worked correctly. I got two players in, assigned them control of two tokens, said something in chat to turn on isGM, did !tl lock (and got the message), I right clicked to tokens and added them to the turn listing. Both players could still move their tokens regardless of their turn order, though. Here's what the chunk of code looks like, post-insertion (save the jokes!): <a href="http://pastebin.com/1sCgPVqd" rel="nofollow">http://pastebin.com/1sCgPVqd</a> I'm sure it's some stupid user error.
Actually, it looks like it may be clashing with some of my other scripts. I run with the Dungeon Mapper scripts, BloodAndHonor, and ItsATrap. No idea which one it's not compatible with, but with your TurnLock script installed, none of the others work. Maybe I'll have to look at doing a more condensed version that only does the turn order thing (if that's possible). Haven't ever messed with much scripted outside of shell...
1428859821
The Aaron
Pro
API Scripter
hmm.. that looks right... I'll give it a shot locally and see... Ok, I went ahead and wrote this into the script. It will show up in the mainline version as soon as it's merged, but here's a link to it in my repo: GIT: <a href="https://github.com/shdwjk/Roll20API/blob/master/To" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/To</a>... Now featuring the GenKitty Config System. =D
This was awesome, looks like it hates bump though. Bump won for me!
1428877399
The Aaron
Pro
API Scripter
Yeah, they both activate on token changes. Probably the mirrored token would be moved, but not moved back. They would sync on the next valid move.