-
Notifications
You must be signed in to change notification settings - Fork 72
Godot editor integration
MetSys comes with some features that enhance editing scenes.
The base bridge between MetSys and your game is RoomInstance node. You can find it in addons/MetroidvaniaSystem/Nodes folder. In editor it draws room boundaries and allows switching to neighboring scenes. You can put this node anywhere in the scene, but keep in mind that the position affects where the bounds are drawn. You should add RoomInstance to every room with assigned scene.

The white lines are borders of map cells, while the magenta lines mark connections to adjacent rooms. You can configure their colors in Database Theme. Size of the cell is defined by In Game Cell Size of General Settings.
When a room is connected to another one at the border, its scene's preview will be displayed:

If you select the RoomInstance node, you can interact with the previews. Clicking the preview will go to that scene, while preserving the current editor view.

While MetSys tries to keep the previews up-to-date, if they get outdated for any reason, you can force-refresh them using the "Refresh Adjacent Previews" button at the top (visible when RoomInstance is selected).

Rooms are considered connected if there is a non-wall border at either side.
Inspector helper for referencing scenes. To enable it, export your variable with @export_file("room_link"), e.g.
@export_file("room_link") var target_map: String
Clicking either button will open a file dialog that lets you pick a target scene. Once you select one, the main button changes to scene link.

Clicking it will open the linked scene. You can still change the scene using the file pick button, or using drag and drop.
If the scene is not found, the main button becomes disabled.

Internally, the linked scene is stored as UID, so you can freely rename or move the referenced file. The value of the link variable can be directly used in load_room() method.