Update NPC Dialogue authored by Ktyal Plummer's avatar Ktyal Plummer
Creating the XML **Creating the XML**
Overview:
When an NPC receives a message from a player it will search dialogue nodes with a `node-id` matching the currently saved `target-id`. By following the diagram below using an example dialogue you can see how different messages allow you to traverse down and back up the tree.
![betterdiagram](uploads/9334d3aefce0b3b1269dfea8ce8e4554/betterdiagram.png "Dialogue tree diagram")
<details><summary>Adding a new dialogue node</summary>
Within your `<DialougeTree>` you must have `<Dialogue>` tags which follow this format:
**pattern:**
the regular expression used to match the players message with this dialogue node
**node-id:**
the grouping this dialogue node belongs to
**target-node**
the grouping the dialogue will search through after the next message it receives
Example:
```xml
<Dialogue pattern=".*pattern*." node-id="start" target-node="BranchOne">
<message>This right here is what the NPC will say</message>
</Dialogue>
```
</details>
The outline of your XML file should look like this:
```xml
<NPCInfo>
<DialougeTree>
<Dialogue pattern="" node-id="" target-node="">
<message>Message the NPC will send after it receives a message.</message>
</Dialogue>
</DialougeTree>
</NPCInfo>
```
The dialogue portion of the XML is a series of dialogue nodes that each contain a: The dialogue portion of the XML is a series of dialogue nodes that each contain a:
pattern: Is what the NPC will be listening for pattern: Is what the NPC will be listening for
... ...
......