Skip to content

Making Rooms

Anynam edited this page Jun 27, 2026 · 4 revisions

Room Scripts

Place a script with the same name in Rooms/Scripts for it to run upon entering the room.

Controls

  • Zoom Out (-)
  • Zoom In (+)
  • Pan Camera (Arrow keys)
  • Place Tile/Object (Left Click)
  • Remove Tile/Object (Right Click)
  • Copy Object (Middle Click)

Setting Properties

Properties are set using str_to_var() in Godot. This means that Godot constructors can be used to set values, e.g.

  • Vector2(640,480)
  • [1,2,3,4,5]
  • "yeah"
  • 45

However you can just type text for strings and it will work the same as surrounding it with ". Note that object types and property names are case-sensitive.

Built-in Object Types

Wall

Description

Self explanatory.

DiagonalWall

Description

Self explanatory.

Character

Description

Character object to be used for cutscenes. Extends CharacterBody2D.

Properties

CharacterJson

String value, defaults to player. The name of the JSON for the character to use, starting at Data/Characters.

Character_Sprite

Should not be set using the room editor. Controls the sprites and animations.

Speed

Integer value, defaults to 3. In pixels per frame. (For comparison, 20 pixels is 1 tile.)

Functions

move(steps : int, dir : Vector2)

Moves the character in a direction. UTScript equivalent is moveCharacter.

RoomSprite

Description

A sprite with a changeable alignment. Extends Sprite2D.

Properties

path

String value, defaults to "". The file path without the extension.

horizontal_alignment

String value, defaults to "center". Should be left, center, or right.

vertical_alignment

String value, defaults to "center". Should be top, center, or bottom.

Player

Description

Player object. It has no different properties from Character. Extends Character.

NPC

Description

NPC object that says dialogue on interaction. Extends Character.

Properties

dialog

Array value, defaults to []. Should only have strings to work properly. e.g. ["* Hey!","* How you doing?"]

extra_dialog

Array value, defaults to []. Should only have arrays of strings to work properly. e.g. [["* So..","*The weather today, huh...?"], ["* ...I don't really know what else[newline] to say."]]

Signals

interacted

Fires when the player interacts with the NPC.

finished_interacting

Fires when the NPC dialogue finishes.

SavePoint

Description

Generic savepoint. Extends StaticBody2D.

Properties

dialogue

Array value, defaults to []. Should only have strings to work properly. e.g. ["* Hey!","* How you doing?"]

saveName

String value, appears on the save file.

Trigger

Description

Sends out a signal when the player touches it. Extends Area2D.

Properties

trigger_once

Boolean value, defaults to true. Self explanatory.

Signals

triggered

Self explanatory.

Portal

Description

Acts as a doorway between rooms. Extends Trigger.

Properties

destination

String value. Should be the path to the target room from Rooms with no file extension.

exitpos

Vector2 value, default is (0,0). Position in tiles (x20 pixels) for where the player should appear after entering the new room.

Interactible

Description

Sends a signal when the player presses the Z key over the object.

Signals

interact

Fired upon interaction.

Custom Object Types

You can create custom objects by making a text file with an extends and any other preset properties you would like and placing it in Data/Objects. You can run a script for the object by placing a script with the same filename in Scripts/Objects.

Example:

Data/Objects/floaty.txt

extends=NPC
editor_image=npc1
dialog=["* test"]

Scripts/Objects/floaty.utscript

function _ready() {
  initvar(floaty,NUMBER,0);
  initvar(temptimer,NUMBER,0);
};

function _update() {
  temptimer = FRAME_TIMER;
  temptimer *= 5;
  floaty = sin(temptimer,2);
  floaty -= 10;
  set(getNode("Sprite"),"position",vec2(0,floaty));
};