2023-05-21: Yes, we're back. No, you can't login yet

EventScript

Uploaded by McTwist

The add-on board icon. Support Mods
The add-on file name icon. Support_EventScript.zip
The add-on upload date icon. Aug 19th 2018, 4:00 PM
The add-on download count icon. 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)

[ FocalFlare ]
2018-12-09 04:39:40
Apparently there's a bug that I found with this add-on. First of all, this add-on works fine (just wondering what the language of the scripts these events are copied and pasted in). No clickbait shit. 10/10. But I digress. Now the bug is this: Whenever you bind a key to copy, paste, or open the editor of the events, you already "activated a ticking time bomb right off the bat." I said this because you'll happen to not realize until you start or join a server. The next time you start/join a server, it's already over with, because by the time you are in it, randomly out of complete nowhere, your three keys that you've binded to copy, paste, and open the editor will lose function, meaning they will not work temporarily. On the client's side, this will only go away until you restart the game. However, I decided to REMOVE THE KEYBINDS of those three actions. But in order for me to use this again, this bug needs to be fixed. Once again, as stated before, this is a great add-on, but needs some bug-fixing. - Ya boi RomanFox2
McTwist
2018-12-13 13:34:32
@LmaoRomanFox2Wtf I have tried to on my server several times, but am unable to recreate the bug. I even tried to use the not recommended Ctrl+C and Ctrl+V, and it still worked like it was nothing. However, if I opened the options window while inside the events window, it broke the keybinds somehow. I'm looking into that as I'm writing this. Either you are using a Mac, which is having issues with keys anyway, or you did something that I have no control over. Keep in mind, that even with the shortcuts not working, there is three buttons on the top right of the event window that I left there as a last way out if the shortcuts didn't work. So you can still use the mod normally without the shortcuts.
Mango 2
2018-12-19 12:04:54
Dosent The Duplicator Have The Command /FillEvents
McTwist
2018-12-20 15:54:48
@Mango 2 True, but it doesn't have /ShareEvents or /UploadToForum.