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 .
×
D&D 2024 has arrived! Pre-order the new core rulebooks now and get an exclusive pre-order bonus for free!
Create a free account

Light angle lock

1416420187

Edited 1416420327
DXWarlock
Sheet Author
API Scripter
I've been trying for a while, but thought Id come ask around here as I'm out of ideas. Anyone know a way to lock the light angle of characters? For example, using characters with an angle on light set to simulate a flashlight is a bit pointless, as they can just spin their token around and see 360 anyway when its not on their turn. Using Aarons locking script does no good, as they aren't moving a token, they are merely spinning around. Update on drop doesn't stop it either. (which I assume it should, it should lock the angle until they let go of the handle). Im trying to simulate them in a dark, dank dungeon with flashlights, where creatures sneaking up on them is a suspense element. its completely broken when they can just twirl around endlessly like a lighthouse on speed, while waiting for thier turn in the turn order.
1416420469
The Aaron
Roll20 Production Team
API Scripter
Hmm, I could change the script to prevent them from rotating in the same way I prevent movement.
1416420554

Edited 1416420847
DXWarlock
Sheet Author
API Scripter
Not sure that would work, as they can rotate all the want, it would just lock them back on letting go. Problem is light updates as they spin around holding the handle, the script doesnt know they are doing anything until they let it go :\. (like when they are locked but update on drop is off..they can drag around and look all they want with the light all over the map, just they get drug back when letting go, not a script problem since its allowing light to update on client side until they let go). So I end up with a party of battle ballerinas, stopping and spinning around a few times every few seconds since light updates when they are holding the turn handle..lol
1416420849
Pat S.
Forum Champion
Sheet Author
Sounds like an interesting suggestion to be made if one hasn't been done yet.
1416421089
The Aaron
Roll20 Production Team
API Scripter
Fixed: <a href="https://app.roll20.net/forum/post/1033747/script-tokenlock-allows-gms-to-selectively-prevent-players-from-moving-their-tokens/#post-1358131" rel="nofollow">https://app.roll20.net/forum/post/1033747/script-tokenlock-allows-gms-to-selectively-prevent-players-from-moving-their-tokens/#post-1358131</a>
1416421211
The Aaron
Roll20 Production Team
API Scripter
Well, for what it's worth, I changed the script. If you have update on drop turned on, they should only get a flash of what's there. You could handle this with some optional rule about rotating taking movement, and I can certainly mod the script to tell you when they turn and how much if that would interest you.
1416421378

Edited 1416422354
DXWarlock
Sheet Author
API Scripter
Sure any help would make it much better if you feel like the hassle, thanks for the update so quick :) And totally unrelated, was it you that made the script that makes token 'autoface' the direction they moved? I know i saw one but cannot find it. Found it <a href="https://app.roll20.net/forum/post/369596/script-auto-facing-slash-rotation#post-370044" rel="nofollow">https://app.roll20.net/forum/post/369596/script-auto-facing-slash-rotation#post-370044</a> This and yours should help a bit to stop it. Thanks, you are the man!
1416423802
The Aaron
Roll20 Production Team
API Scripter
If you want to be notified when things are attempted, just put this in for your HandleMove (addition bolded): HandleMove = function(obj,prev) { if(state.TokenLock.locked && 'token' === obj.get('subtype') && ( obj.get('left') !== prev.left || obj.get('top') !== prev.top || obj.get('rotation') !== prev.rotation ) ) { sendChat('TokenLock','/w gm ' +(obj.get('Name')||(getObj('character',obj.get('represents'))||{get:function(){return 'Unknown';}}).get('name')) +' just tried to move:' +(obj.get('left') !== prev.left ? ' X: '+Math.round((obj.get('left')-prev.left)/70) : '' ) +(obj.get('top') !== prev.top ? ' Y: '+Math.round((obj.get('top')-prev.top)/70) : '' ) +(obj.get('rotation') !== prev.rotation ? ' º: '+(obj.get('rotation')-prev.rotation) : '' ) ); if('' !== obj.get('controlledby')) { obj.set({left: prev.left, top: prev.top, rotation: prev.rotation}); } else if('' !== obj.get('represents') ) { var character = getObj('character',obj.get('represents')); if( character && character.get('controlledby') ) { obj.set({left: prev.left, top: prev.top, rotation: prev.rotation}); } } } }, That will cause it to whisper attempted changes to you: (From TokenLock): [P] The Mayfield just tried to move: X: 1 Y: -1 (From TokenLock): [P] The Mayfield just tried to move: X: 1 Y: 4 (From TokenLock): [P] The Mayfield just tried to move: X: 0 Y: 4 (From TokenLock): [P] The Mayfield just tried to move: º: 90
1416425285
DXWarlock
Sheet Author
API Scripter
That was quick :) That should help a lot to catch the ones spinning around on one side of the map while Im watching the other split party, thanks again!
1416427453
The Aaron
Roll20 Production Team
API Scripter
No worries. =D