Adding Locations
Locations are the places in your game world. Players travel between them using the map.
Defining a Location
Section titled “Defining a Location”Create content/locations/tavern.yaml:
id: tavernname: '@location.tavern.name'description: '@location.tavern.description'banner: tavern.pngmusic: tavern_ambience.oggambient: ''| Field | Description |
|---|---|
id | Unique identifier, used in dialogue effects and map references |
name | Display name (use @key for localization) |
description | Text shown when the player is at this location |
banner | Image displayed at the top of the location view |
music | Background music track (auto-plays, crossfades between locations) |
ambient | Ambient sound loop (plays alongside music) |
Creating a Map
Section titled “Creating a Map”Maps connect locations and let players travel between them. Create content/maps/town.yaml:
id: townname: '@map.town.name'image: town_map.pngscale: 1locations: - id: tavern x: 200 y: 350 - id: market x: 500 y: 200| Field | Description |
|---|---|
id | Unique map identifier |
name | Display name |
image | Background image for the map |
scale | Travel time multiplier (higher = longer travel) |
locations | Array of location markers with x/y coordinates on the map image |
The x and y coordinates position clickable markers on the map image. Players click a marker to travel.
Location Intro Dialogues
Section titled “Location Intro Dialogues”Use triggered dialogues to narrate a location’s first visit:
TRIGGER tavernREQUIRE notFlag seenTavernIntro
NODE start NARRATOR: @narrator.tavern_intro SET flag seenTavernIntro
CHOICE @narrator.choice.look_around END dialogue ENDThe TRIGGER keyword auto-starts this dialogue when the player enters the tavern. The REQUIRE notFlag ensures it only fires once.
Travel Effects
Section titled “Travel Effects”When a player travels to a location:
currentLocationupdates to the new location- Time advances based on map
scaleand distance - Any active dialogue ends
- Triggered dialogues at the new location are checked
You can also move the player via dialogue effects:
CHOICE @npc.choice.follow_me GOTO location marketENDEnabling/Disabling the Map
Section titled “Enabling/Disabling the Map”The map can be toggled with the SET mapEnabled effect:
# Disable map during a dialogue sequenceSET mapEnabled false
# Re-enable afterSET mapEnabled trueThe player starts with the map enabled by default.
Moving Characters Between Locations
Section titled “Moving Characters Between Locations”Characters can be moved to different locations:
SET characterLocation merchant marketOnly characters at the player’s current location appear in the charactersHere list.