Let the engine call your script
BASIC IN YOUR GAME
An event is the game telling you something happened. A room-arrival handler can read which room just loaded without checking the room every frame.
OnSceneLoaded is checked for the Room Notice record in the BASIC Designer.
SUB OnSceneLoaded(context AS Dictionary)
PRINT "Arrived in " & context.sceneId
END SUB01. Open the BASIC record, check OnSceneLoaded under Event Functions, enter the matching SUB, then apply and save. The editor’s upper record fields identify this handler as room_notice.
02. Start or enter a room. In the recorded preview, the room’s ID was lab and the output read Arrived in lab. The player-facing room name can be completely different.
context is a dictionary of details for this event. A scene event can supply sceneId. Other events supply different details. To inspect what actually arrived, put PRINT context inside the SUB and trigger the event in the game.
