From c73b2304de59a42a39044a5785a5dedb09a4fd60 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Sat, 28 Mar 2026 10:19:23 +0000 Subject: [PATCH] [Auto] [Improve] Fix dialogue tree docs: remove duplicate link, add typewriter effect and save state guidance --- automated_updates_data.json | 4 ++++ .../all-features/dialogue-tree/index.md | 20 ++++++++++--------- .../all-features/save-state/index.md | 2 ++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/automated_updates_data.json b/automated_updates_data.json index 8a7b974c5c0..cb9d4b701c4 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -84,6 +84,10 @@ { "date": "2026-03-24", "summary": "Fixed device-sensors docs (typo in gamma rotation description, wrong units deg/s vs m/s² for rotation values, clarified Is Absolute expression, added gravity note to acceleration) and fixed broken wiki URL in advanced-conditions OR condition" + }, + { + "date": "2026-03-28", + "summary": "Improved dialogue-tree docs (removed duplicate example link, explained typewriter effect and option navigation, clarified save/load/clear dialogue state actions) and save-state docs (documented Stop-and-restart-all-scenes load parameter)" } ] } diff --git a/docs/gdevelop5/all-features/dialogue-tree/index.md b/docs/gdevelop5/all-features/dialogue-tree/index.md index 2643b897bb2..8e23733c30b 100644 --- a/docs/gdevelop5/all-features/dialogue-tree/index.md +++ b/docs/gdevelop5/all-features/dialogue-tree/index.md @@ -6,10 +6,9 @@ title: The Dialogue Tree extension !!! tip **Try out these game examples!** 🎮 - + - [Dialogue tree simple demo](https://editor.gdevelop.io/?project=https://resources.gdevelop-app.com/examples/dialogue-tree-simple-demo/dialogue-tree-simple-demo.json) - [Dialogue tree with yarn online](https://editor.gdevelop.io/?project=https://resources.gdevelop-app.com/examples/dialogue-tree-with-yarn/dialogue-tree-with-yarn.json) - - [Yarnalia game](https://editor.gdevelop.io/?project=https://resources.gdevelop-app.com/examples/dialogue-tree-simple-demo/dialogue-tree-simple-demo.json) The Dialogue Tree extension can be used to quickly create a dynamic dialogue tree behaviour. It comes with actions, conditions and expressions that make it extremely easy to set such a system with text scrolling, animated avatars and conditional dialogues. The example demo project does that in only 16 events. @@ -130,7 +129,7 @@ Don't forget that you can put anything inside this **<>**...**<>* !!! note - 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. + The Dialogue Tree extension keeps track of all `$variables` the player sets during the game. You can read and write these variables from GDevelop events using the **Set dialogue state variable** actions. To persist player choices across game sessions, use the **Save dialogue state** action (stores the state to a global variable) and **Load dialogue state** action (restores it). Use **Clear dialogue state** when starting a new game to reset all accumulated choices. ### 3. Option line type @@ -160,8 +159,8 @@ This will simply tell yarn to continue to that node, without any user input. Use Avoid using options that contain a link to a non existent node or no link at all. That may cause the extension to crash your game -**Gotchas to watch out for: -** +**Gotchas to watch out for:** + If you try to do conditional options like this: ``` Ok kids we're gonna go with... @@ -233,10 +232,13 @@ The demo does not use the entire capability of the extension and is aiming to pr ### The basic life cycle of a dialogue -- Load the dialogue tree data at the beginning of the game or the level -- Set when a dialogue gets triggered - using the "Start Dialogue from branch..." action, and passing as a parameter the name of the node title where it will start from. That is typically the root of a tree. In my example the npc object's dialogueBranch variable is used. That makes it easy to make many npcs and just change that in their properties -- 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. +- Load the dialogue tree data at the beginning of the game or the level. +- Start a dialogue with the **Start dialogue from branch** action, passing the node title as a parameter. Typically this is stored in an NPC's variable so each NPC can have its own starting branch. +- For each game frame while a dialogue is running, read the current line type (text, command, or options) with conditions and display or react accordingly: + - For **text lines**: display `LineText()` or use `ClippedLineText()` with the **Scroll clipped text** action on a timer to create a typewriter effect. Call **Complete clipped text scrolling** if the player wants to skip ahead. Advance to the next line with **Go to the next dialogue line**. + - For **option lines**: display the choices (using `Option(index)` or `VerticalOptionsList()`/`HorizontalOptionsList()`), allow the player to navigate with **Select next/previous option**, then confirm with **Confirm selected option**. + - For **command lines**: check the command name with the condition **Dialogue line command is**, then trigger the corresponding game event (change avatar, play a sound, etc.). Use `CommandParameter(index)` to read the command's parameters. +- Set reusable commands triggered by Yarn — such as changing avatars, playing sound effects, and other game events to help tell your story. # Examples diff --git a/docs/gdevelop5/all-features/save-state/index.md b/docs/gdevelop5/all-features/save-state/index.md index 06b27a058af..4c80af45d20 100644 --- a/docs/gdevelop5/all-features/save-state/index.md +++ b/docs/gdevelop5/all-features/save-state/index.md @@ -32,6 +32,8 @@ This is the **recommended** approach for most games. It automatically stores the For this, use actions **Save game to device storage** and **Load game from device storage**. +Both load actions have an optional parameter **Stop and restart all the scenes currently played**. If your game uses stacked scenes (for example, a pause menu scene on top of the game scene), setting this to **Yes** will cleanly stop and restart all active scenes before applying the loaded state. Leave it at the default **No** for most single-scene games. + ![](save-device-storage-action.png) Each save uses a **storage key**, such as `"Save1"`, `"CheckpointA"`, or `"Autosave"`, to identify the save slot. This enables you to offer multiple save slots (in some games, it's usual to have 3 to 5 save slots that the player can use).