Difference between revisions of "Script:Token Lock"
From Roll20 Wiki
Andreas J. (Talk | contribs) m |
Andreas J. (Talk | contribs) m (link to feature) |
||
(7 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
+ | {{revdate}} | ||
+ | {{main|API:Script Index}} | ||
+ | |||
+ | {{notebox| For the Roll20 feature, see '''[[Token Lock]]'''. ''(April 2022)''}} | ||
{{script overview | {{script overview | ||
|name=TokenLock | |name=TokenLock | ||
Line 5: | Line 9: | ||
|dependencies={{api repository link|IsGM}} | |dependencies={{api repository link|IsGM}} | ||
|lastmodified=2020-05-21}} | |lastmodified=2020-05-21}} | ||
− | + | '''TokenLock''' allows the [[GM]] to selectively prevent [[players]] from moving their [[tokens]], by resetting any token movement made by player. | |
− | '''TokenLock''' allows the [[GM]] to selectively prevent [[players]] from moving their [[tokens]]. | + | |
Determination of player tokens is based on whether that token has an entry in the <code>controlled by</code>-field of either the token or the character it represents(this is due to <code>change:graphic</code>-events to not specify who changed the graphic). | Determination of player tokens is based on whether that token has an entry in the <code>controlled by</code>-field of either the token or the character it represents(this is due to <code>change:graphic</code>-events to not specify who changed the graphic). | ||
If <code>controlled by</code> is empty, the GM can freely move the token at any point. If there is any entry in <code>controlled by</code>, the token can only be moved when '''TokenLock''' is unlocked. | If <code>controlled by</code> is empty, the GM can freely move the token at any point. If there is any entry in <code>controlled by</code>, the token can only be moved when '''TokenLock''' is unlocked. | ||
+ | |||
+ | * {{fpl|1033747/ TokenLock Script}} - use and examples | ||
+ | ==Behavior== | ||
+ | When a token is "locked", a player can still drag their tokens on the map or use the arrow keys, but TokenLock will reset them to the previous position.. So if [[Explorer Mode]] is active, players are still able to accidentally reveal more of the map, even if TokenLock is activated. | ||
Moving of player-controlled [[Cards]] is still permissible. | Moving of player-controlled [[Cards]] is still permissible. | ||
− | + | '''Suggestion:''' Using {{fpl|9521203/ UDLWindows}}, you could create circles or boxes of DL walls that could block token movement completely, without blocking their vision. Copying these circles, lines or boxes you could then place then on the tokens so they '''actually''' can't move. | |
+ | ==Commands== | ||
:<code>!tl</code> Executing the command with no arguments prints this help. | :<code>!tl</code> Executing the command with no arguments prints this help. | ||
::The following arguments may be supplied in order to change the configuration. All changes are persisted between script restarts. | ::The following arguments may be supplied in order to change the configuration. All changes are persisted between script restarts. | ||
Line 23: | Line 31: | ||
::<code>--help</code> -- Shows the Help screen. | ::<code>--help</code> -- Shows the Help screen. | ||
::<code>--toggle-allowmoveonturn</code> -- Sets whether tokens can be moved if they are at the top of the turn order. | ::<code>--toggle-allowmoveonturn</code> -- Sets whether tokens can be moved if they are at the top of the turn order. | ||
− | |||
− | |||
− | |||
== Changelog == | == Changelog == | ||
{{changelog version|0.2.8|2020-05-21|* {{repo|Roll20/roll20-api-scripts/pull/979 PR}} }} | {{changelog version|0.2.8|2020-05-21|* {{repo|Roll20/roll20-api-scripts/pull/979 PR}} }} | ||
Line 31: | Line 36: | ||
{{changelog version|0.11|2015-02-01|* Release}} | {{changelog version|0.11|2015-02-01|* Release}} | ||
==See Also== | ==See Also== | ||
− | * [[API:Script Index]] | + | * [[Token Lock]] |
− | * '''{{fpl|2948292/ DryErase}}''' – An API that can stop players from [[Drawing Tool|drawing]] on the map, deleting any drawing instantly. | + | * [[API:Script Index]] curated list of APIs |
− | + | ** [[Token/API]] | |
− | + | ** [[MapLock]] - API for stopping any graphics from moving, helpful for GM to not accidentally move things themselves. | |
+ | ** '''{{fpl|2948292/ DryErase}}''' – An API that can stop players from [[Drawing Tool|drawing]] on the map, deleting any drawing instantly. | ||
+ | ** {{fpl|9521203/ UDLWindows}} – create/convert [[Dynamic Lighting]] walls that are see-through, but blocks movement. Works functionally better to truly block movement, but is slower to deploy. | ||
+ | |||
+ | [[Category:Tokens]] |
Latest revision as of 12:03, 23 April 2022
Page Updated: 2022-04-23 |
Main Page: API:Script Index
For the Roll20 feature, see Token Lock. (April 2022) |
Version: 0.2.8
Last Modified: 2020-05-21
Code: TokenLock
Dependencies: IsGM
Conflicts: None
TokenLock allows the GM to selectively prevent players from moving their tokens, by resetting any token movement made by player.
Determination of player tokens is based on whether that token has an entry in the controlled by
-field of either the token or the character it represents(this is due to change:graphic
-events to not specify who changed the graphic).
If controlled by
is empty, the GM can freely move the token at any point. If there is any entry in controlled by
, the token can only be moved when TokenLock is unlocked.
- TokenLock Script(Forum) - use and examples
Contents |
[edit] Behavior
When a token is "locked", a player can still drag their tokens on the map or use the arrow keys, but TokenLock will reset them to the previous position.. So if Explorer Mode is active, players are still able to accidentally reveal more of the map, even if TokenLock is activated.
Moving of player-controlled Cards is still permissible.
Suggestion: Using UDLWindows(Forum), you could create circles or boxes of DL walls that could block token movement completely, without blocking their vision. Copying these circles, lines or boxes you could then place then on the tokens so they actually can't move.
[edit] Commands
!tl
Executing the command with no arguments prints this help.- The following arguments may be supplied in order to change the configuration. All changes are persisted between script restarts.
lock
-- Locks the player tokens to prevent moving them.
-
unlock
-- Unlocks the player tokens allowing them to be moved.
-
!tl-config [<Options>|--help]
Swaps the selected Tokens for their counterparts on the other layer.--help
-- Shows the Help screen.--toggle-allowmoveonturn
-- Sets whether tokens can be moved if they are at the top of the turn order.
[edit] Changelog
v0.2.8 (2020-05-21)
v0.11-0.2.7 (2015-2020)
- several updates
v0.11 (2015-02-01)
- Release
[edit] See Also
- Token Lock
- API:Script Index curated list of APIs
- Token/API
- MapLock - API for stopping any graphics from moving, helpful for GM to not accidentally move things themselves.
- DryErase(Forum) – An API that can stop players from drawing on the map, deleting any drawing instantly.
- UDLWindows(Forum) – create/convert Dynamic Lighting walls that are see-through, but blocks movement. Works functionally better to truly block movement, but is slower to deploy.