This page goes over how to use dialogue in New Horizons.
Understanding Dialogue
Dialogue Tree
A dialogue tree is an entire conversation, it’s made up of dialogue nodes.
Dialogue Node
A node is a set of pages shown to the player followed by options the player can choose from to change the flow of the conversation.
Condition
A condition is a yes/no value stored for this loop and this loop only. It can be used to show new dialogue options, stop someone from talking to you (looking at you Slate), and more.
Persistent Condition
A persistent condition is similar to a condition, except it persists through loops, and is saved on the players save file.
Remote Trigger
A remote trigger is used to have an NPC talk to you from a distance; ex: Slate stopping you for the umpteenth time to tell you information you already knew.
Example XML
Here’s an example dialogue XML:
Using the XML
To use the dialogue XML you have created, you simply need to reference it in the dialogue prop
Dialogue Config
To view the options for the dialogue prop, check the schema
Controlling Conditions
You can set condition in dialogue with the <SetCondition> and <SetPersistentCondition> tags
Dialogue Options
There are many control structures for dialogue options to hide/reveal them if conditions are met. Take a look at the DialogueOption schema for more info.
Controlling Flow
In addition to <DialogueOptions>, there are other ways to control the flow of the conversation.
DialogueTarget
Defining <DialogueTarget> in the <DialogueNode> tag instead of a <DialogueOption> will make the conversation go directly to that target after the character is done talking.
DialogueTargetShipLogCondition
Used in tandem with DialogueTarget, makes it so you must have a ship log fact to go to the next node.
Adding to existing dialogue
Here’s an example of how to add new dialogue to Slate, without overwriting their existing dialogue. This will also allow multiple mods to all add new dialogue to the same character.
NH will merge together <DialogueNode> nodes that have the same <Name> field, adding their <DialogueOptionsList> together. No other changes will be merged.
NH can also add new <DialogueNode> nodes into the text, however you have to add <DialogueOption>s that link to them for them to ever be read by the player.
Be careful to use unique names to ensure optimal compatibility between mods. Consider prefixing the names of your nodes with the name of your mod.
To use this additional dialogue you need to reference it in a planet config file: