Node Structure
Every dialogue segment is a node. Nodes have three parts:| Part | Description |
|---|---|
title: | Unique identifier for the node |
--- | Separates the header from the body |
=== | Marks the end of the node |
.yarn file can contain multiple nodes.
Dialogue Lines
Basic dialogue uses the formatSpeaker: Text:
Line IDs
Add#line:identifier to tag lines for localization:
.yarn files. Line IDs connect to translation entries in CSV localization files (e.g., zh-cn.csv). See Project Development for the localization workflow.
Player Choices
Use-> to create options the player can select:
Nested Choices
Options can contain more options:Variables
Store and retrieve values with variables:Conditionals
Use<<if>>, <<elseif>>, and <<else>> for branching:
Conditional Options
Show options only when conditions are met:Commands
Commands trigger game actions. Wrap them in<<command>>:
Yarn Reference
See all available commands and functions.
Jumping Between Nodes
Use<<jump>> to move to another node:
Functions
Call functions to get values from the game:Many functions take integer IDs rather than string names. Character IDs, item IDs, and value IDs are defined in the game’s internal data tables. See the Functions Reference for parameter types.
Functions Reference
Browse all available query functions.
Comments
Add comments with//:
