Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Script:Move Lighting"

From Roll20 Wiki

Jump to: navigation, search
(Script Use)
m
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{revdate}}
 
{{script overview
 
{{script overview
 
|name=Move Lighting
 
|name=Move Lighting
Line 4: Line 5:
 
|version=0.1.4
 
|version=0.1.4
 
|lastmodified=2018-05-02
 
|lastmodified=2018-05-02
|code=MoveLighting}}
+
|code=moveLighting}}
  
'''NOTE: THIS SCRIPT IS NOT YET AVAILABLE AND IS AWAITING PULL REQUEST AUTHENTICATION ON GITHUB - ETA TO AVAILABILITY = 1 to 2 WEEKS'''
+
This script lets you quickly move a [[Dynamic Lighting]] line(polygon path object) from one [[Layers|game layer]] to another layer.
 
+
This script lets you quickly move a dynamic lighting polygon path object from one game layer to another game layer.
+
  
 
== Syntax ==
 
== Syntax ==
 +
{{apiboxRec}}
 
{{syntaxbox top|Example|nocat=true}}
 
{{syntaxbox top|Example|nocat=true}}
 
{{API command|movelight}}<br>
 
{{API command|movelight}}<br>
{{API command|movelight <map,objects,gmlayer,walls> <id>}}<br>
+
{{API command|movelight <map,objects,gmlayer,walls> <token_id>}}<br>
 
{{syntaxbox end}}
 
{{syntaxbox end}}
  
 
== Installation and Configuration ==
 
== Installation and Configuration ==
'''MoveLighting''' ''currently isn't available as a one click install option and must be installed manually.''
+
(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 [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
 
You can copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
  
 
== Script Use ==
 
== Script Use ==
To use simply type !movelight [layer] [object ID] into the chat. <br />
+
To use simply type {{c|!movelight [layer] [token_id]}} into the chat. To move a single selected drawing use <code>@{selected|token_id}</code> instead of the {{c|token_id}} directly. (Drawings have a {{c|token_id}} even though they kinda aren't tokens.) <br />
 
<br />
 
<br />
 
'''Valid Layers:'''<br />
 
'''Valid Layers:'''<br />
Line 31: Line 31:
 
<br />
 
<br />
 
'''Example of running the command:'''<br />
 
'''Example of running the command:'''<br />
Move dynamic lighting polygon object from lighting layer to GM Layer:<br />
+
Select a drawing/polygon object, call this command, and select the layer you want from the popup:
!movelight gmlayer -L9XSOq-voBH6SR73hpH<br />
+
<pre>!movelight ?{Move to Layer|Map & Background,map|Objects & Tokens,objects|GM Info Layer,gmlayer|Dynamic Lighting,walls} @{selected|token_id}</pre>
<br />
+
 
Move dynamic lighting polygon object from GM layer back to lighting layer (this will restore path obstruction and line of sight etc. etc.)<br/>
+
Move selected dynamic lighting polygon object from lighting layer to GM Layer:
!movelight walls -L9XSOq-voBH6SR73hpH<br />
+
<pre>!movelight gmlayer @{selected|token_id}</pre>
<br />
+
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.)<br/>
This script was built for its synergy with the script [[Script:Token Mod|Token Mod]] due to the fact that [[Script:Token Mod|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.<br />
+
<pre>!movelight walls -L9XSOq-voBH6SR73hpH</pre>
Get the ID of the dynamic lighting polygon object obstructing path and line of sight through the door and store it in bar1 of the door token graphic. Then you can create the following two macros:<br /><br />
+
 
'''Open Door'''<br />
+
This script was built for its synergy with the script [[Script:Token Mod|Token Mod]] due to the fact that [[Script:Token Mod|Token Mod]] does not support moving dynamic lighting polygon path objects.  
!movelight gmlayer @{selected|bar1}<br />
+
===Open/Close Door===
!token-mod --set layer|gmlayer --ids @{selected|token_id}<br />
+
Here is an example of using the two scripts together to open / close doors on a map.<br />
<br />
+
Get the ID of the dynamic lighting polygon object (by selecting it and call <code>@{selected|token_id}</code> in text chat) obstructing path and line of sight through the door and store it in {{c|bar1}} of the door [[token]].
 +
 
 +
Then you can create the following two macros:<br /><br />
 +
'''Open Door'''
 +
<pre>!movelight gmlayer @{selected|bar1}
 +
!token-mod --set layer|gmlayer --ids @{selected|token_id}</pre>
 +
 
 
'''Close Door'''<br />
 
'''Close Door'''<br />
!movelight walls @{selected|bar1}<br />
+
<pre>!movelight walls @{selected|bar1}
!token-mod --set layer|objects --ids @{selected|token_id}<br />
+
!token-mod --set layer|objects --ids @{selected|token_id}</pre>
<br />
+
 
 
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.
 
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.
 +
 +
===Fixes===
 +
It might be possible to use [[SelectManager]] to be able to use the "Move Lighting" to move several drawings or all selected at the same time, instead of just one with the normal <code>@{selected|token_id}</code> call.
  
 
== Changelog ==  
 
== Changelog ==  
 
{{changelog version|0.1.4|2018-05-02|* Initial release}}
 
{{changelog version|0.1.4|2018-05-02|* Initial release}}
 +
 +
[[Category:Dynamic Lighting]]

Latest revision as of 17:12, 9 March 2022

API ScriptAuthor: Kastion
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

[edit] Syntax

!movelight
!movelight <map,objects,gmlayer,walls> <token_id>

[edit] 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.

[edit] 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.

[edit] Open/Close Door

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.

[edit] Fixes

It might be possible to use SelectManager to be able to use the "Move Lighting" to move several drawings or all selected at the same time, instead of just one with the normal @{selected|token_id} call.

[edit] Changelog

v0.1.4 (2018-05-02)

  • Initial release