Put a loaded room back in shape
On this page
0.86.4.0 walkthrough / Keep the player·s setting across a release > p. 19
ROOM RESTORATION
Use a room’s restoration actions for things the player should see again when they load a checkpoint.
Say the workshop hatch is open and its little indicator should glow. On a normal visit, entering the workshop might also award a point. Loading a save should redraw that indicator and keep the score exactly where the player left it. The room now has an event for this.
1
Select the workshop itself in the Scene Designer.#
Open Adventure Database Scenes Workshop. Select the room record. In the Inspector, open Room Events and scroll to When Room State Is Restored — Step 1. If the Inspector title says Spawn or Object, select the room again.
The Workshop Inspector. The highlighted section runs whenever a checkpoint restores this room.
2
Choose the action that rebuilds the room.#
For a visible check, add a Boolean variable restore_lamp with a default of false. Choose Set Variable in the event, set the variable to restore_lamp and give it the value true. Click Apply Changes, then Save Project. In your finished room, the event can run your existing lamp-update action or script using the saved hatch flag.
3
Compare entering the room with loading it.#
Start a fresh game and enter the workshop normally. The test flag should still be false. Save in the workshop, then load that slot. Save to a second slot. Compare both in Checkpoint tests. The flag should now read true, and the score should be the same.
When the event runs
PCA rebuilds the room and its actors, restores native script data, then sends OnRestoreCustomData. Next come this room’s actions and OnRoomStateRestored (slot, sceneId, playerId). OnSaveLoaded follows. First-entry and normal-entry actions are skipped on load.
0.86.4.3 / Restore after a cinematic or a wall fade > Page 22
STUDIO 0.86.3.8 / 16
