^AngelScript^ Documents script functions (callbacks) invoked by the game.
|
| void | Game2Script::main () |
| |
| void | Game2Script::frameStep (float dt) |
| |
| void | Game2Script::eventCallback (Script2Game::scriptEvents event, int param) |
| |
| void | Game2Script::eventCallbackEx (Script2Game::scriptEvents event, int arg1, int arg2ex, int arg3ex, int arg4ex, string arg5ex, string arg6ex, string arg7ex, string arg8ex) |
| |
| void | Game2Script::defaultEventCallback (int trigger_type, string inst, string box, int nodeid) |
| |
◆ defaultEventCallback()
| 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.
- Parameters
-
| 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. |
◆ eventCallback()
Optional; Invoked if a registered event is triggered, see GameScriptClass::registerForEvent().
- Parameters
-
| event | Event code. |
| param | Event-specific parameter, see docs for the event codes. |
◆ eventCallbackEx()
| void Game2Script::eventCallbackEx |
( |
Script2Game::scriptEvents |
event, |
|
|
int |
arg1, |
|
|
int |
arg2ex, |
|
|
int |
arg3ex, |
|
|
int |
arg4ex, |
|
|
string |
arg5ex, |
|
|
string |
arg6ex, |
|
|
string |
arg7ex, |
|
|
string |
arg8ex |
|
) |
| |
◆ frameStep()
| void Game2Script::frameStep |
( |
float |
dt | ) |
|
Optional; Script update function - invoked once every rendered frame.
- Parameters
-
| dt | Elapsed time (delta time) in seconds. |
◆ main()
| 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.