An event in the ESC language
Events are triggered from various sources. Common events include
:setup : This event is always the first to be called each time the room is visited. It allows elements in the room to be prepared before the room is displayed to the player (e.g. starting particle effects).
:ready : This event is the second to be called each time the room is visited. It is run immediately after
:setupfinishes execution, if it exists. Otherwise,
:readywill be the first event to run. Regardless, this event is run after the room is displayed to the player, allowing cutscenes or animations to be run once the room is visible.
Called from the current item when it is used with the item with the global id
const FLAG_NO_SAVE: int = 8
const FLAG_NO_TT: int = 2
const FLAG_NO_UI: int = 4
const FLAG_TK: int = 1
const PREFIX: String = ":"
Prefix to identify this as an ESC event.
const REGEX: String = "^:(?<name>[^|]+)( \\|\\s*(?<flags>( (TK|NO_TT|NO_UI|NO_SAVE))+))?$"
Regex identifying an ESC event
var name: String
Name of event
var flags: int = 0
Flags set to this event
func _init(event_string: String)
Create a new event from an event line
func run() -> int
Execute this statement and return its return code