![]() |
RigsofRods
2023.09
Soft-body Physics Simulation
|
^AngelScript^ Documents script functions (callbacks) invoked by the game. More...
Namespaces | |
| Game2Script | |
| Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation. | |
Functions | |
| void | Game2Script::main () |
| Required; Script setup function - invoked once when script is loaded. More... | |
| void | Game2Script::frameStep (float dt) |
| Optional; Script update function - invoked once every rendered frame. More... | |
| void | Game2Script::eventCallback (Script2Game::scriptEvents event, int param) |
Optional; Invoked if a registered event is triggered, see GameScriptClass::registerForEvent(). More... | |
| void | Game2Script::eventCallbackEx (Script2Game::scriptEvents event, int arg1, int arg2ex, int arg3ex, int arg4ex, string arg5ex, string arg6ex, string arg7ex, string arg8ex) |
Optional; if present, will be used instead of Game2Script::eventCallback(). More... | |
| void | Game2Script::defaultEventCallback (int trigger_type, string inst, string box, int nodeid) |
OBSOLETE, ONLY WORKS WITH TERRAIN SCRIPTS - Use eventCallbackEx() with event SE_EVENTBOX_ENTER instead, it does the same job and works with any script. More... | |
^AngelScript^ Documents script functions (callbacks) invoked by the game.
| void Game2Script::defaultEventCallback | ( | int | trigger_type, |
| string | inst, | ||
| string | box, | ||
| int | nodeid | ||
| ) |
OBSOLETE, ONLY WORKS WITH TERRAIN SCRIPTS - Use eventCallbackEx() with event SE_EVENTBOX_ENTER instead, it does the same job and works with any script.
Optional; Invoked when a vehicle touches an eventbox which has no custom handler function. This is a legacy feature which pre-dates generic events SE_EVENTBOX_ENTER and SE_EVENTBOX_EXIT and bundled objects like truckshop/spawners still rely on it.
| trigger_type | Unused, always 0. |
| inst | Unique ID of the terrain object instance which created the eventbox. |
| box | Name of the eventbox as defined by the terrain object's ODEF file. |
| nodeid | Number of the node which triggered the event, or -1 if not known. |
| void Game2Script::eventCallback | ( | Script2Game::scriptEvents | event, |
| int | param | ||
| ) |
Optional; Invoked if a registered event is triggered, see GameScriptClass::registerForEvent().
| event | Event code. |
| param | Event-specific parameter, see docs for the event codes. |
| void Game2Script::eventCallbackEx | ( | Script2Game::scriptEvents | event, |
| int | arg1, | ||
| int | arg2ex, | ||
| int | arg3ex, | ||
| int | arg4ex, | ||
| string | arg5ex, | ||
| string | arg6ex, | ||
| string | arg7ex, | ||
| string | arg8ex | ||
| ) |
Optional; if present, will be used instead of Game2Script::eventCallback().
Invoked if a registered event is triggered, see GameScriptClass::registerForEvent(). The first argument is the same as eventCallback() gets, other are extras, see descriptions at Script2Game::scriptEvents.
| event | Event code. |
| void Game2Script::frameStep | ( | float | dt | ) |
Optional; Script update function - invoked once every rendered frame.
| dt | Elapsed time (delta time) in seconds. |
| void Game2Script::main | ( | ) |
Required; Script setup function - invoked once when script is loaded.
If not present, the game will report error and abandon the script.
1.8.17