EventScript
There has been several ways to handle events, even additions that add more functionality for it. Some even used it in ways that it was not supposed to. However, there was no specification or standard of how to write events outside of Blockland. Everyone went as they pleased and even if most people understood it, it was still tedious to implement the events if they were long enough.
Introducing the new scripting language EventScript. It standardizes the specification of how to write events through text.
Copies the left code into the event system and then copies the event system into readable script.
EventScript Support List
- Standardized format for events, everything included
- Optional semantics
- Easy as copy-paste
- Comments
- Labels
- Indexing and ranges
Example
# Normal event
[x][33]onActivate->Self->fireRelayNum("1-5 5 7", "Brick")
# Disabled and delay with no params
[ ][500]onBlownUp->Player->Kill
[x][ 0]onRelay->Self->fakeKillBrick("5 10 3.4", 2)
# Separate lines
[x][56]onRelay
->Self
->setColor(
"0.000000 0.000000 1.000000 1.000000"
)
# Default behavior
onRelay -> "test_brick" -> setColliding (1)
setApartment -> And -> setOwner (9845)
onProjectileHit -> Projectile -> Bounce (1.3)
# Indexes and ranges
onRelay -> Self -> toggleEvents([0:3])
onRelay -> Self -> toggleEvents([1,3,5])
# Labels
myLabel:
onRelay -> Self -> toggleEvents([myLabel:myLabel])
Semantics
The language is built on being forgiving. All sort of whitespace is ignored and newlines are the only used as an exception for certain cases due to parsing issues. Below is a detailed walk-through of the first event in the example above.
Enabled / Delay
Each of these needs to be put between a pair of square brackets.
The first x is defining that the event is enabled. If there is no x, then it is disabled. Leaving this parameter out will default to enabled.
The second 33 is the delay. Leaving this out will default to 0 or server default.
These can be written in any order.
Input
This defines the input event name. The arrow indicates the end of the name and the beginning of the target.
Target / Name
This indicates the current target. For named targets, one just put the name between double quotes. As for input event name, the arrow indicates the end of the name and the beginning of the output name.
Output
The output name of the event.
Parameters
The parameters for the output event needs to be put between paranthesis. This is optional for output events with no parameters. Each parameters is separated with a comma. They could also be put between double quotes if it contain comma or double quotes. Recommendation is to put everything that isn't number between double quotes to avoid issues.
Indexes and ranges
Indexes or ranges is a feature to handle a bigger amount of event numbers. It supports both specific indexes and ranges from one number to inclusive an another number.
Labels
The above code creates a label that can be used to reference to the event after it.
These are then used for indexes and ranges so direct numbers are not needed.
Links