Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions automated_updates_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
{
"date": "2026-04-02",
"summary": "Improved multiplayer docs: added Quick Join section, documented player username/ping/last-joined/last-left expressions, lobby ID expression, custom message variable variant, and synchronization rate action"
},
{
"date": "2026-04-05",
"summary": "Improved dialogue tree docs: added sections on branch tags, visited branches, saving/loading dialogue state, and typewriter effect; clarified Yarn variable scope; fixed outdated Heroku reference in P2P docs"
}
]
}
32 changes: 32 additions & 0 deletions docs/gdevelop5/all-features/dialogue-tree/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Don't forget that you can put anything inside this **<<if ...>>**...**<<endif>>*

The dialogue tree extension stores all the $variables the player sets while playing the game and also comes with expressions/actions to get/set them - in case you want to store them when the game is saved by the player and be able to reload them.

Yarn `$variables` are scoped to the dialogue system only — they are not GDevelop scene or global variables. To read or write them from GDevelop events, use the **Set dialogue state string/number/boolean variable** actions (passing the variable name without the `$` prefix), and the `DialogueTree::Variable("name")` (number) or `DialogueTree::VariableString("name")` (string) expressions.


### 3. Option line type

Expand Down Expand Up @@ -238,6 +240,36 @@ The demo does not use the entire capability of the extension and is aiming to pr
- Tell the game engine how you want the dialogue data to be displayed to the player and used by the engine - for each of the three types
- Set reusable commands to be triggered by Yarn - such as changing of avatars, playing of sound effects and any other game events to help tell your story.

## Branch tags

Yarn nodes support **tags** in their header — for example:

```
title: VillageElder
tags: important npc
---
```

From GDevelop you can check whether the current branch contains a specific tag using the **Current dialogue branch contains a tag** condition, and retrieve the tag by index with the `DialogueTree::BranchTag(index)` expression. Tags are a convenient alternative to `<<commands>>` for attaching metadata to dialogue branches (e.g. marking which branches unlock achievements, or which character portrait to show).

## Tracking visited branches

The extension automatically records which branches the player has visited. Use the **Branch title has been visited** condition to check if the player has already seen a specific branch. The `DialogueTree::VisitedBranchTitles()` expression returns a comma-separated list of all visited branch titles if you need to inspect them programmatically.

## Saving and loading dialogue state

Player choices and `$variables` accumulate in memory as the dialogue runs, but they are lost when the game is closed. To persist them across sessions, use the dialogue state actions:

- **Save dialogue state** — serialises the current state (visited branches and variables) into a GDevelop **global variable**. Call this alongside your normal game-save logic.
- **Load dialogue state** — restores a previously saved state from that global variable. Call this when the player loads a save.
- **Clear dialogue state** — resets all dialogue state, useful when starting a new game.

The saved state variable can be stored to permanent storage using the [Storage extension](/gdevelop5/all-features/storage/) like any other variable.

## Typewriter effect

The extension includes a built-in character-by-character reveal effect. Each frame, call the **Scroll clipped text** action; use `DialogueTree::ClippedText()` as the displayed text instead of `DialogueTree::LineText()`. The **Clipped text has completed scrolling** condition tells you when the full line has been revealed, and **Complete clipped text scrolling** lets the player skip ahead to the full line instantly.

# Examples

[Open example in GDevelop](https://editor.gdevelop.io/?project=example://dialogue-tree-with-yarn){ .md-button .md-button--primary }
Expand Down
2 changes: 1 addition & 1 deletion docs/gdevelop5/all-features/p2p/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ After the above has been completed, the **Use custom broker server** action is u

!!! tip

Note that this is a local server, so it will only work on your machine. When releasing your game you will need to deploy one to a Node.js compatible hosting, like Heroku.
Note that this is a local server, so it will only work on your machine. When releasing your game you will need to deploy the server to a Node.js compatible hosting service (such as Railway, Render, or a VPS of your choice).

#### Use the default server

Expand Down