CaveWarps

Goals

Cave Warps are an "entity" used to get out of caves (ProceduralWorld) and get back to LinearWorld.

How it works

They can be placed in any cave scene, but are supposed to go into StartLevel_*.tscn and EndRewardLevel_*.tscn scenes. Currently they usually start invisible and are "revealed" in two situations:

  • On StartLevel scenes, they double as starting points and are revealed once the player moves away from them
  • On EndRewardLevel scenes they are revealed once all chests in the scene are opened.

The sprite is currently a placeholder white circle, but once it is changed to it's final art, this "revealing" logic can be replaced for whatever is needed.

Using CaveWarp in StartLevel scenes

Setting up Cave Warps in the Scene

  1. Place it inside the main YSort of the scene
  2. Make sure it's property is_final_room_warp is set to false.

Placing Cave Warps 3. Move the warp to whatever position you want, avoiding any space near doors.

It's important to avoid doors so that we don't give the false impression the player came into the Cave through that door.

Player Starting Position

Also, by moving the CaveWarp, it is automatically updating the value of the Room's player_starting_position. To make sure this is working just test the room by pressing F6 or clicking the Play Scene button on the top right.

Play Scene button

For more info on debugging options for caves see Testing Caves (Procedural World).

Using CaveWarp in EndLevelReward scenes

Setting Up CaveWarps on EndLevelReward

  1. Place it inside the main YSort of the scene
  2. Make sure it's property is_final_room_warp is set to true.
  3. Open "Paths to Rewards" on the inspector and increase its Size to the same amount of "item chests" in the scene.
  4. For each of the values inside "Paths to Rewards" click on "Assign" and choose one of the ItemChest nodes.
  5. Move the warp to whatever position you want.

The CaveWarp will reveal once all the listed ItemChests are opened by the player. You can test it with F6 though, they won't drop any items in this case.

With what script it communicates

Only in the Editor it communicates with Room.gd so that it can be used as a tool to set player_starting_position. During runtime, it communicates with the player when the player is in range to show the action tooltip, but other than that it just listens to signals and sends out Events.