Skip to content

πŸ—¨ Dialogue Expansion

JiHyeon Lee edited this page Sep 25, 2025 · 2 revisions

πŸ“– Overview

Dialogue files are stored inside the states folder of each NPC. Each file represents a cycle (0.json, 1.json, etc.), and defines dialogues based on heart levels and conditions.

πŸ“‚ File Naming

N.json β†’ Dialogue file for cycle N

Example:

0.json β†’ Cycle 0 dialogues

1.json β†’ Cycle 1 dialogues

πŸ“ File Structure

Basic Example (0.json)

{
 "default": [
  "You look happy today!",
  "Isn't it great to enjoy the sunshine?"
 ],
  "I love watching the rain from my window.": {
  "w": "Rainy"
 }
}

Rules

Key β†’ Heart level (e.g. "0", "2", "4")

Value β†’ Dialogue definition

String β†’ A single dialogue line

Array β†’ Multiple options, randomly chosen

Object β†’ Conditional dialogue

βš™ Conditional Dialogues

Conditional dialogues are written as objects. Use supported condition keys (see Condition Keys ).

Example with weather condition

{
 "It's a beautiful day outside, isn't it?": {
   "w": "Sunny"
  }
}

Example with multiple conditions

{
 "The spring festival is today! Let's go together.": {
  "d": "spring_15",
  "l": "Town"
 }
}

πŸ‘‰ All conditions are treated as AND (all must be true).

🎲 Randomization

If you want multiple dialogue options at the same heart level:

{
 "default": [
  "I feel great today!",
  "The weather makes me smile.",
  "I had a good dream last night."
 ]
}

One of the lines will be picked randomly.

Clone this wiki locally