--- Title: Dialogue Description: Guide to making dialogue in New Horizons Sort_Priority: 50 --- # Dialogue 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 player's 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: ```xml EXAMPLE NPC Start DEFAULT Start Start Part 2 Goto 1 1 Goto 2 2 Goto End End 1 This is 1 Goto 2 2 Goto End End 2 This is 2 Goto 1 1 Goto End End End This is the end ``` # Using the XML To use the dialogue XML you have created, you simply need to reference it in the `dialogue` prop ```json { "Props": { "dialogue": [ { "position": {"x": 5, "y": 10, "z": 0}, "xmlFile": "planets/path/to/your_file.xml" } ] } } ``` # Dialogue Config To view the options for the dialogue prop, check [the schema]({{ "Celestial Body Schema"|route }}#Props_dialogue) # Controlling Conditions You can set condition in dialogue with the `` and `` tags ```xml EXAMPLE_CONDITION EXAMPLE_P_CONDITION ``` # 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]({{ "Dialogue Schema"|route }}#DialogueTree-DialogueNode-DialogueOptionsList-DialogueOption-DialogueTarget) for more info. # Controlling Flow In addition to ``, there are other ways to control the flow of the conversation. ## DialogueTarget Defining `` in the `` tag instead of a `` will make the conversation go directly to that target after the character is done talking. ## DialogueTargetShipLogCondition Used in tandum with `DialogueTarget`, makes it so you must have a [ship log fact]({{ "Ship Log"|route }}#explore-facts) to go to the next node.