Skip to main content
Branch Nodes are nodes that you can use to create loops and create if statements inside the dialogue file itself without needing to make logic with code.

Set Flags

Another way could be to set some flags through code like bought two items out of a three item pool:
And the code for it would look something like:
For more info on Flags, check FlagHandler.

Loops

You can create a loop in your dialogue using a branch node by having it keep rechecking a flag until it is true, here are several ways you can use this:

Item Validation

You could also have a person keep saying something or an action keep getting repeated if for example the player is missing an item!
And the code would be a simple SetFlag("is_wearing_armour") before running the dialgoue.

Hanging Dialogue

You could also make a dialogue hang until something happens, instead of quitting the dialogue, simply set a flag that would hide the UI, and have the player do something. For example we could make a character refuse to continue a dialogue before the player talks to another character.
And the code would only need to call SetFlag("asked_monica") when the player interacts with the character named Monica, then hiding the UI.As you can see, while the building blocks are simple by design, they open a lot of possibilites and allow for some fairly versatile options.For more info on branch nodes, see Reference: Branch Node.