Skip to reading
PCA Script Programming

OnGlobalReady

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page

Earlier edition reference / Current 0.86.4.0 property paths > p. 329

Code example
when global ready
    log(to_json(event))
end

A persistent/global script is initialized through its language runtime's ready route.

Source table from OnGlobalReady, page 298
Common context keysUse and limits
Language-specific startup context; native GDScript includes eventName and scriptIdUse it to initialize that global instance, not to assume a playable room is ready. The GDScript runtime calls a global script's matching method directly. The visual On Event picker does not offer this ready event; do not design it as a universal room-ready graph broadcast.

OnInteraction#

Code example
when player interacts
    log(to_json(event))
end

A scene-entity verb interaction reaches its execution point.

Source table from OnGlobalReady, page 298
Common context keysUse and limits
entityId, targetEntityId, targetKind, sceneId, playerId, characterId, verb, inventoryItemId, sourceItemId; regionId for a regionThis is the shared notification before the local verb action list. Filter both target and verb. The local list receives a related but smaller context; do not assume every key shown here is passed unchanged to every nested call.

OnTriggerEntered#

Code example
when player enters trigger welcome_trigger
    log(to_json(event))
end

The active player enters an eligible trigger/interactive-region overlap.

Source table from OnGlobalReady, page 298
Common context keysUse and limits
triggerId, entityId, sceneId, playerId, event="enter"; regionId for a regionIn the checked 3D route, other NPC bodies do not trigger this player-entry hook. The shared event runs before local onEnter actions. Starting inside a volume can create startup contact behavior; test that case separately.
Page 298 of 357Permalink
Go to page