-
Notifications
You must be signed in to change notification settings - Fork 0
Making Rooms
Place a script with the same name in Rooms/Scripts for it to run upon entering the room.
- Zoom Out (-)
- Zoom In (+)
- Pan Camera (Arrow keys)
- Place Tile/Object (Left Click)
- Remove Tile/Object (Right Click)
- Copy Object (Middle Click)
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.
Self explanatory.
Self explanatory.
Character object to be used for cutscenes. Extends CharacterBody2D.
String value, defaults to player. The name of the JSON for the character to use, starting at Data/Characters.
Should not be set using the room editor. Controls the sprites and animations.
Integer value, defaults to 3. In pixels per frame. (For comparison, 20 pixels is 1 tile.)
Moves the character in a direction. UTScript equivalent is moveCharacter.
A sprite with a changeable alignment. Extends Sprite2D.
String value, defaults to "". The file path without the extension.
String value, defaults to "center". Should be left, center, or right.
String value, defaults to "center". Should be top, center, or bottom.
Player object. It has no different properties from Character. Extends Character.
NPC object that says dialogue on interaction. Extends Character.
Array value, defaults to []. Should only have strings to work properly. e.g. ["* Hey!","* How you doing?"]
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."]]
Fires when the player interacts with the NPC.
Fires when the NPC dialogue finishes.
Sends out a signal when the player touches it. Extends Area2D.
Boolean value, defaults to true. Self explanatory.
Self explanatory.
Acts as a doorway between rooms. Extends Trigger.
String value. Should be the path to the target room from Rooms with no file extension.
Vector2 value, default is (0,0). Position in tiles (x20 pixels) for where the player should appear after entering the new room.
Sends a signal when the player presses the Z key over the object.
Fired upon interaction.
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.
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));
};