Orion Solutions Docs
ORION SOLUTIONS LUA API

Events

Register and remove Lua callbacks for Orion Solutions events.

The callbacks library lets scripts register functions that are executed when supported Orion Solutions events are dispatched.

callbacks.add

callbacks.add(event_name, function)

Registers a function for the specified event. Returns true when the callback is registered successfully.

Arguments

NameTypeDescription
event_namestringName of the supported event.
functionfunctionFunction executed when the event is dispatched.

Example

callbacks.add("Draw", function()
    print("Draw called")
end)

callbacks.remove

callbacks.remove(event_name)

Removes callbacks owned by the current script for the specified event. Returns true when a matching callback existed.

Example

callbacks.remove("Draw")
Script Errors

If a callback throws a Lua error, Orion Solutions logs the error and unloads the owning script. Unloading a script also removes its registered callbacks.