EventScript
Uploaded by McTwist
Support Mods
Support_EventScript.zip
Aug 19th 2018, 4:00 PM
1,078
Description
For years people have used Duplicator or manual copying to transfer events from bricks and builds to other bricks and builds. Sharing events to others is also a hassle. Handling a huge amount of events have always become tedious and problematic. However, there is a solution for this.
This mod introduces the ability to script your events, through the new scripting language EventScript. It removes the hurdle of sharing. It reduces the problem with huge amounts of events. It completely obliterates copying issues.
Download. Install. Set your shortcuts of copy/paste/editor. Start scripting.
Copies the left code into the event system and then copies the event system into readable script.
Details
After installing the add-on, go to Options to set the shortcuts for copying and pasting events. Keep in mind that anything that relates to ctrl+c, alt+c, ctrl+v and alt+v will not work as expected. When this is done, one could easily just join a server and go into eventing mode. While there, just copy the events with previously mentioned shortcut. This will place the script in the clipboard, ready to be pasted in any text editor of choice. If a script already is within the clipboard, it can be pasted in the same manner with the other shortcut.
Any errors will halt the script and let the user know, giving brief explanation of why it could not parse the script. Keep in mind that pasting will always overwrite your current events, unless an error occurs.
There also exists an in-game editor, for quicker access and easier eventing.
It is also possible to paste the script on the server, if the add-on is enabled.
$script = EventScriptServer_save(_myBrick);
EventScriptServer_load(_myBrick, $script)
First function saves the events to a string. Second function loads the string onto the brick.
Key bindings
When no binding is set, these are the default:
ctrl+shift+c Copy
ctrl+shift+v Paste
ctrl+shift+e Editor
cmd+shift+c Copy
cmd+shift+v Paste
cmd+shift+e Editor
Script Example
Script provided by Platypi.
# Author: Platypi / SadBlobfish
# Makes a brick change colors on a loop when toggled
# Start color changing (start with events enabled)
start: [x][0]onActivate->Self->playSound("Beep_Checkout.wav")
[x][33]onActivate->Self->fireRelay
# Stop color changing (start with events disabled)
[ ][0]onActivate->Self->playSound("Beep_Denied.wav")
end: [ ][0]onActivate->Self->cancelEvents
# Alternate between starting and stopping color changing
[x][0]onActivate->Self->toggleEventEnabled([start:end])
# Change colors
[x][0]onRelay->Self->setColor("0.898039 0.000000 0.000000 1.000000")
[x][500]onRelay->Self->setColor("0.898039 0.898039 0.000000 1.000000")
[x][1000]onRelay->Self->setColor("0.000000 0.498039 0.247059 1.000000")
[x][1500]onRelay->Self->setColor("0.200000 0.000000 0.800000 1.000000")
# Loop color changing
[2000]onRelay->Self->fireRelay
# Stop color changing when brick is blown up
onBlownUp->Self->cancelEvents
Known issues
An unknown amount of Add-Ons wont work correctly with this mod as they are modifying the Event window in an evil manner. It is known that people have their own suggestion for design, but surely this standard is already set and cannot be altered.
Comments (4)
2018-12-09 04:39:40
2018-12-13 13:34:32
2018-12-19 12:04:54
2018-12-20 15:54:48