Skip to content

Yarn Tutorial ‐ Basic

Faulty edited this page Feb 24, 2021 · 9 revisions

Table of Contents

Introduction

Yarn File Structure

A simplistic breakdown of Yarn files is as follows:

1. [File Tags Section]

2. [Node Header]
3. [Node Header Delimiter]
4. [Node Body]
5. [Node Body Delimiter]

6. Repeat 2 - 5 for multiple nodes
  1. File tags are file-level metadata. The only requirement is the content must be preceded by a # character, otherwise file tags can contain any character. The file tag section is optional within the Yarn file. An example of a file tag would be #file_version: 2.
  2. Node headers contain header tags which are used for node-level metadata. Header tags follow the key:value syntax. Every node header must contain a Title:node_name tag to denote the title of your node and these must be unique within your file.
  3. The node header delimiter is ---. This just tells the program reading your Yarn file that the header section is done being read.
  4. The node body is where the actual content of your node will go. This is where you will place all your dialogue and expressions.
  5. The node body delimiter is ===. This tells the program reading your Yarn file that the node body section is done being read and if anything follows, it's the start of a new node.
  6. You would just repeat sections 2 - 6 if you wanted to create multiple nodes.

The following is a basic example of a Yarn file:

#file_version: 1
Title:Start
---
My dialogue goes here.
===

For a more advanced breakdown of Yarn file structure, please check the Yarn Syntax Reference.

Clone this wiki locally