Shared script events: the full reference
On this page
The GDScript, PCA Script, Lua and BASIC script editors expose 18 shared subscription names. A handler runs because the script is subscribed or because a dedicated hook explicitly calls it; writing a similarly named function alone is not a universal subscription.
The payload lists below describe the standard emitters in this build. A context is a dictionary of information supplied by the caller, not a fixed global object. Local actions, inherited calls and language-specific initialization can add or omit keys.
The visual On Event picker exposes 15 of these names. Video and music have dedicated graph entry nodes; Global Ready belongs to script initialization. Read the media and ready entries before assuming identical support on every surface.
OnGameStart#
GDScript handler: on_game_start(event: Dictionary = {})
The runtime reaches its game-start hook. It is a game-session event, not a once-per-room event.
| Standard context | Practical use / limits |
|---|---|
| sceneId, playerId | Initialize session-level logic here. Do not reset saved puzzle variables on every scene entry. A direct Test Scene can start a test session too; test a normal new game and a loaded game separately. |
OnSceneLoaded#
GDScript handler: on_scene_loaded(event: Dictionary = {})
A room has been constructed and its local entry actions have run.
| Standard context | Practical use / limits |
|---|---|
| sceneId, previousSceneId, playerId, firstVisit | Filter sceneId before changing room-specific props. In the normal entry path, firstEnter runs before enter, then this event is emitted. It is not a substitute for the room's first-time event. |
