Skip to reading
PCA Script Programming

OnSceneLeaving

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 room lab leaves
    log(to_json(event))
end

The scene-loading route is leaving one scene for another.

Source table from OnSceneLeaving, page 294
Common context keysUse and limits
sceneId, nextSceneIdsceneId is the departing room. Do short cleanup here. The normal player Change Scene route also runs its local firstLeave/leave action lists; other loading routes need not reproduce every local transition hook.

OnPlayerChanged#

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

The controlled playable character changes.

Source table from OnSceneLeaving, page 294
Common context keysUse and limits
playerId, displayNameRefresh character-specific presentation. This event concerns player selection, not every movement of a character. The runtime follows it with OnCharacterControl in the switch path.

OnCharacterControl#

Code example
when event OnCharacterControl
    log(to_json(event))
end

A character becomes the controlled character, including initial control at startup.

Source table from OnSceneLeaving, page 294
Common context keysUse and limits
playerId, displayNameUse it for HUD/inventory presentation or control-specific setup. It also has a per-character On Control script hook. This event is a special case in which playerId can identify the calling character for this.
Page 294 of 357Permalink
Go to page