Yarn's Dialogue Tree question

Hello. Does anybody know if there is a way to insert dialogue lines when a global variable has a certain value? Thanks.

Since you cannot return yarn variables you have two options:

You can switch the text from yarn to scenestrings


You can make several yarn trees and use the global variable as condition to start from the desired yarn tree

When you say “scenestrings” do you mean “Scene variables”?


i use a variable “othertext” that i use as a condition, if i use yarn dialogue or different text, usually related to variables, since its not possible to show variables inside yearn.

Could I just make sure I understand:

There’s no syntax that I can use in a Yarn file which GDevelop can read and replace with a GDevelop variable?

For example, in Yarn:

<<if %HasKey == 1>>

and when GDevelop reached that node in the dialogue file, it would replace %HasKey with its own global variable HasKey?

Such a feature would be terrific, having to update Yarn variables with Set Dialogue State Variable to stay in sync with GDevelop ones is a source of bugs.

Thanks for your work on dialogue trees, it’s very good.

You can set yarn variables as you like, no problem.
But you cannot display them.

1 Like