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

[Script] LayerScripter

1485745623

Edited 1487123963
LayerScripter is a GM tool which will allow you to preset any number of objects or paths to move to a different layer on the click of a signal macro button. Any Graphic or path can be added to the list of actions to perform and can by moved to any layer (gmlayer, object, map or wall). When you create a button with the API a macro button will will be created which will execute and number of changes. With it you will be able to do things like the follow with one macro button. The party is in a long hallway with a door at the far end. Has the get about ten feet from the door they trigger a trap. A wall appears between them cutting the party in two (wall image moves from gmlayer to map layer and a path moves from the gmlayer to walls layer for dynamic lighting). The door in front of them opens and a flesh golem steps out. (The path on the dynamic lighting layer wall moves to the gmlayer and the flesh golem moves to the object layer from the gmlayer). <a href="https://github.com/mcstalker/LayerScripter/blob/master/LayerScripter.js" rel="nofollow">https://github.com/mcstalker/LayerScripter/blob/master/LayerScripter.js</a> Change Log v0.6.2b&nbsp; Fixes: Fixed issue with schema not installing correctly. v0.6.1b Fixes: Cannot read property 'Configurations' of undefined for ne installations v0.6b Adds: Added Debug function. Added image to action detail. Changes: - Changed all functions to named functions. - Changed all chat messages to be no archive. Fixes: - Minor bug fixes and code improvements. v0.5b Initial Release
1485757537
The Aaron
Pro
API Scripter
Neat!
1485792973

Edited 1485793009
<a href="https://youtu.be/l_daBtJQywQ" rel="nofollow">https://youtu.be/l_daBtJQywQ</a> Here is a link to a video of the API
This looks and sounds like an awesome script. But I can't actually get it to work... I'm getting the following: "SyntaxError: Illegal return statement" &nbsp;--so yeah, maybe someone could shed some light on this for me--because this looks quite useful. :)
@Charlie N. I will look in to the problem but can you tell me when you get the error message?
1486080773

Edited 1486239802
@Charlie N. To clarify my question, do you get the error when the api starts or when you preform a command? &nbsp;If the later, which command. &nbsp;I have not been able to find anything that sends that error. &nbsp;Can you also tell me which browser you are using?
1486339192

Edited 1486341515
Layer Scripter v0.6 Released&nbsp; <a href="https://github.com/mcstalker/LayerScripter/blob/master/LayerScripter.js" rel="nofollow">https://github.com/mcstalker/LayerScripter/blob/master/LayerScripter.js</a> Change Log v0.6b Adds: Added Debug function. Added image to action detail. Changes: - Changed all functions to named functions. - Changed all chat messages to be no archive. Fixes: - Minor bug fixes and code improvements.
1486339986
plexsoup
Marketplace Creator
Sheet Author
API Scripter
FYI: that link takes us to the releases page, which shows old versions. Took me a minute to figure out where the&nbsp; 0.6b version was.
plexsoup said: FYI: that link takes us to the releases page, which shows old versions. Took me a minute to figure out where the&nbsp; 0.6b version was. Thanks link has been fixed
Ah sorry I didn't even see you responded to my message for some reason. Anyway, right now, with the more recent script you posted, I am getting the following the error message whenever I spin up a new sandbox with your script enabled: TypeError: Cannot read property 'Configurations' of undefined&nbsp; Sorry for getting back to this so late. Hoping you can still help.
Charlie N. said: I am getting the following the error message whenever I spin up a new sandbox with your script enabled: TypeError: Cannot read property 'Configurations' of undefined&nbsp; Thanks for the feed back I know what the problem is and will be sending out a fix shortly. &nbsp;
Awesome! Thanks :)
1486597297

Edited 1486650017
@Charlie N. Can you please test this following? <a href="https://github.com/mcstalker/LayerScripter/blob/master/LayerScripter.js" rel="nofollow">https://github.com/mcstalker/LayerScripter/blob/master/LayerScripter.js</a>
Change Log v0.6.1b Fixes: Cannot read property 'Configurations' of undefined for ne installations
Well, it doesn't immediately crash anymore on start-up, so that's progress. But it does crash the api whenever I try to make a button.
Can you run the following command and then send me the api log after it crashes? !LayerScripter --debug !LayerScripter
Here's what the api spit out when I put the debug command in: "Layer scripter v0.6.1b debug mode is now enabled." "Layer Scripter Debug Message:: in ShowMenu at 19179::Entering Function" "Layer Scripter Debug Message:: in ShowButtons at 19095::Entering Function" "Layer Scripter Debug Message:: in ShowButtons at 19173::Exiting function with Output" "Layer Scripter Debug Message:: in SendChat at 19031::Entering Function with output_msg::&lt;div style = \" background: #fff; border: solid 1px #000; border-radius: 5px; font-weight: bold; margin-bottom: 1em; overflow: hidden;\"&gt;&lt;div style = \" background: #000; color: #fff; text-align: center;\"&gt;Layer Scripter Button List&lt;/div&gt;&lt;div style = \" text-align: left;\"&gt;&lt;table style = \" border: solid 1px #000; width: 100%; table-layout: fixed;\"&gt;&lt;tbody&gt;&lt;tr style = \" border-bottom: solid 1px #000; border-left: solid 1px #000; border-right: solid 1px #000;\"&gt;&lt;td style = \" text-align: left; border-top: solid 1px #000; width: 100%;\" colspan = \"3\"&gt;&lt;a style = \" font-size: 10px; text-align: center; width: 100px; height: 13px; margin: -5px 0 0 0; padding: 0 0 0 0; border-radius: 10px; border-color: #000000; white-space: nowrap; background-color: #028003;\" href = \"!LayerScripter --AddButton ?{Button Name}\"&gt;Add New Button&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;" "Layer Scripter Debug Message:: in SendChat at 19034::Exiting function with false" "Layer Scripter Debug Message:: in ShowMenu at 19188::Exiting function" "Layer Scripter Debug Message:: in ChatHandler at 18608::Exiting Function" "Layer Scripter Debug Message:: in ChatHandler at 18498::Entering Function with Roll20_msg::[object Object]" "Layer Scripter Debug Message:: in ChatHandler at 18517::API Call found in chat message." "Layer Scripter Debug Message:: in ShowMenu at 19179::Entering Function" "Layer Scripter Debug Message:: in ShowButtons at 19095::Entering Function" "Layer Scripter Debug Message:: in ShowButtons at 19173::Exiting function with Output" "Layer Scripter Debug Message:: in SendChat at 19031::Entering Function with output_msg::&lt;div style = \" background: #fff; border: solid 1px #000; border-radius: 5px; font-weight: bold; margin-bottom: 1em; overflow: hidden;\"&gt;&lt;div style = \" background: #000; color: #fff; text-align: center;\"&gt;Layer Scripter Button List&lt;/div&gt;&lt;div style = \" text-align: left;\"&gt;&lt;table style = \" border: solid 1px #000; width: 100%; table-layout: fixed;\"&gt;&lt;tbody&gt;&lt;tr style = \" border-bottom: solid 1px #000; border-left: solid 1px #000; border-right: solid 1px #000;\"&gt;&lt;td style = \" text-align: left; border-top: solid 1px #000; width: 100%;\" colspan = \"3\"&gt;&lt;a style = \" font-size: 10px; text-align: center; width: 100px; height: 13px; margin: -5px 0 0 0; padding: 0 0 0 0; border-radius: 10px; border-color: #000000; white-space: nowrap; background-color: #028003;\" href = \"!LayerScripter --AddButton ?{Button Name}\"&gt;Add New Button&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;" "Layer Scripter Debug Message:: in SendChat at 19034::Exiting function with false" "Layer Scripter Debug Message:: in ShowMenu at 19188::Exiting function" "Layer Scripter Debug Message:: in ChatHandler at 18608::Exiting Function" "Layer Scripter Debug Message:: in ChatHandler at 18498::Entering Function with Roll20_msg::[object Object]" "Layer Scripter Debug Message:: in ChatHandler at 18608::Exiting Function" "Layer Scripter Debug Message:: in ChatHandler at 18498::Entering Function with Roll20_msg::[object Object]" "Layer Scripter Debug Message:: in ChatHandler at 18608::Exiting Function" "Layer Scripter Debug Message:: in ChatHandler at 18498::Entering Function with Roll20_msg::[object Object]" "Layer Scripter Debug Message:: in ChatHandler at 18517::API Call found in chat message." "Layer Scripter Debug Message:: in AddButton at 18475::Entering Function with ButtonId::undefined PlayerId::-KPwoJAaK5qBfdP3vOXh" "Layer Scripter Debug Message:: in IsButtonNameUnique at 18922::Entering Function with ButtonName::Test" "Layer Scripter Debug Message:: in FindButtonId at 18781::Entering Function with ButtonName::Test" "Layer Scripter Debug Message:: in FindButtonId at 18791::Exiting function with false" "Layer Scripter Debug Message:: in IsButtonNameUnique at 18929::Exiting function with true" "Layer Scripter Debug Message:: in GetMacroButtonId at 18838::Entering Function with ButtonName::Test" "Layer Scripter Debug Message:: in GetMacroButtonId at 18841::Exiting function with guid" "Layer Scripter Debug Message:: in guid at 18880::Entering Function" "Layer Scripter Debug Message:: in guid at 18887::Exiting function" Hope that helps! Thanks for working through this with me!
@&nbsp;Charlie N. Sorry for the delay. &nbsp;The log did help me find the problem right away but it took me some time to figure out the best way to fix it. &nbsp;v0.6.2b should correct your problem. &nbsp;Let me know if it doesn't. &nbsp;And thanks for bug testing.
1488032469

Edited 1488032519
Yeah...I was definitely under the impression that when a token moved from one layer to another, it would create a path on the dynamic lighting layer. You know, if you put a door on the map layer a line would appear on the walls layer so said door would block light/movement. As of right now, moving tokens to other layers with chat commands is something that I can already do...is the script still not working correctly or is moving tokens between layers all this script actually does?
The script does not create a path but you can create a path and have the path move from the dynamic light to the gm layer or vice versa. That is how I do it. &nbsp;
1488044057

Edited 1488044127
Gotcha. Awesome. Yeah it's working perfectly now. Sorry for the super late response!...I kinda forgot about this for a bit there. Anyway this is super useful--I have wanted a script that does exactly this forever!&nbsp;Thanks for making it dude :D