PCA events: all shared hooks
On this page
Earlier edition reference / Current 0.86.4.0 property paths > p. 350
Native records subscribe through the editor’s Event Functions checkboxes. Each shared hook calls the matching on_* method. A method that is merely named on_scene_loaded does not automatically subscribe itself.
The event Dictionary depends on the emitter. The keys below describe standard runtime emitters; optional/local routes can supply different data. Read optional values with get and an appropriate fallback.
A global native instance defining on_global_ready receives PCA’s deferred ready call after binding. That special initialization route differs from an ordinary broadcast subscription.
OnGameStart#
func on_game_start(event: Dictionary = {}) -> void:
Log(ToJSON(event))The runtime reaches its game-start hook. It is a game-session event, not a once-per-room event.
| Common context | Use and 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#
func on_scene_loaded(event: Dictionary = {}) -> void:
Log(ToJSON(event))A room has been constructed and its local entry actions have run.
| Common context | Use and 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. |
