Difference between revisions of "Script:Move Lighting"
From Roll20 Wiki
Andreas J. (Talk | contribs) (update w/ @{selected|token_id} example) |
Andreas J. (Talk | contribs) m |
||
Line 31: | Line 31: | ||
<br /> | <br /> | ||
'''Example of running the command:'''<br /> | '''Example of running the command:'''<br /> | ||
+ | Select a drawing/polygon object, call this command, and select the layer you want from the popup: | ||
+ | <pre>!movelight ?{Move to Layer|Map & Background,map|Objects & Tokens,objects|GM Info Layer,gmlayer|Dynamic Lighting,walls} @{selected|token_id}</pre> | ||
+ | |||
Move selected dynamic lighting polygon object from lighting layer to GM Layer: | Move selected dynamic lighting polygon object from lighting layer to GM Layer: | ||
<pre>!movelight gmlayer @{selected|token_id}</pre> | <pre>!movelight gmlayer @{selected|token_id}</pre> |
Revision as of 17:00, 9 March 2022
Page Updated: 2022-03-09 |
Version: 0.1.4
Last Modified: 2018-05-02
Code: moveLighting
Dependencies: None
Conflicts: None
This script lets you quickly move a Dynamic Lighting line(polygon path object) from one game layer to another layer.
Contents |
Syntax
Roll20 Mod
Mod Suggestions
- D&D 5E
- Combat
- Character Sheet
- Dynamic Lighting
- Jukebox
- Maps
- Text Chat/Macros
- Tokens
- System Specific
- Mod Guides by Script
Debug
Other
!movelight
!movelight <map,objects,gmlayer,walls> <token_id>
Installation and Configuration
(It's in the API install menu)
You can copy the script's code, available from the menu on the right and stored at Roll20's API GitHub Repository. Paste the code into a new script in your campaign's API Script Editor. Save the new script and it will be available inside your campaign.
Script Use
To use simply type !movelight [layer] [token_id]
into the chat. To move a single selected drawing use @{selected|token_id}
instead of the token_id
directly. (Drawings have a token_id
even though they kinda aren't tokens.)
Valid Layers:
map
objects
gmlayer
walls
Example of running the command:
Select a drawing/polygon object, call this command, and select the layer you want from the popup:
!movelight ?{Move to Layer|Map & Background,map|Objects & Tokens,objects|GM Info Layer,gmlayer|Dynamic Lighting,walls} @{selected|token_id}
Move selected dynamic lighting polygon object from lighting layer to GM Layer:
!movelight gmlayer @{selected|token_id}
Move dynamic lighting polygon object from GM layer back to lighting layer, by specifying the object's token ID. (this will restore path obstruction and line of sight etc.)
!movelight walls -L9XSOq-voBH6SR73hpH
This script was built for its synergy with the script Token Mod due to the fact that Token Mod does not support moving dynamic lighting polygon path objects. Here is an example of using the two scripts together to open / close doors on a map.
Get the ID of the dynamic lighting polygon object (by selecting it and call @{selected|token_id}
in text chat) obstructing path and line of sight through the door and store it in bar1
of the door token.
Then you can create the following two macros:
Open Door
!movelight gmlayer @{selected|bar1} !token-mod --set layer|gmlayer --ids @{selected|token_id}
Close Door
!movelight walls @{selected|bar1} !token-mod --set layer|objects --ids @{selected|token_id}
Then to use these macros, have the door on the object layer, select the door, and run the Open Door macro. Then move to the GM Layer, select the door, and run the Close Door macro.
Changelog
v0.1.4 (2018-05-02)
- Initial release