Skip to reading
Action Lists & Events

14. Understand room-event order

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

In the normal room-entry path, the runtime marks the room visited, runs firstEnter if appropriate, then runs enter. It emits OnSceneLoaded afterward. The visible inspector lists enter first, but that is not the execution order for a first visit.

Source table from 14. Understand room-event order, page 18
MomentNormal player room-change route
Leaving the old roomfirstLeave if needed, then leave.
Beginning the loadOnSceneLeaving reports the old sceneId and nextSceneId.
Entering the new roomfirstEnter if needed, then enter.
Entry lists are finishedOnSceneLoaded reports the new scene, previous scene and firstVisit.

Figure 12. Use the first-entry list for the introduction or initial room objective.

This ordering matters when both a local list and a global listener change the same value. For example, set the objective locally, then let a global listener refresh a custom objective display from that value.

Save loading and other low-level loading routes can have different needs from a normal player exit. Do not use a local leave event as the only cleanup for every possible load, restart, teleport or interrupted sequence.

Page 18 of 189Permalink
Go to page