Skip to content
carenalga edited this page Nov 21, 2022 · 6 revisions

Description

Each room you create will have its own script file (based on RoomTemplate.gd). This is created with the name you give the room in the Create room popup prefixed by Room: E.g. RoomOffice.gd, RoomGarage.gd, RoomForest.gd.

Methods

  • on_room_entered() void

Called when players enter a room, before it fades in (the room is in the SceneTree but is not visible). E.g. You can use this to setup stuff you need in your room.

Is not blocking, so using a yield inside won't pause the excecution of its invoker (E.room_readied(room: PopochiuRoom))

func on_room_entered() -> void:
  C.player.position = get_point('Entrance')
  # The Globals singleton is something you have to create by your own.
  if Globals.game_state.has(GameState.DENTAL_COPY_DELIVERED):
    get_prop('Dentures').disable = true # Hide the prop and don't listen inputs on it
  • on_room_transition_finished() void

Called when you enter a room, after fade in is complete. At this point the room is visible. E.g. You can use it to make characters say something.

func on_room_transition_finished() -> void:
  yield(E.run(['Player: What have they done with Glottis?']), 'completed')
Clone this wiki locally