Update NPC Dialog authored by Joshua Kellogg's avatar Joshua Kellogg
Creating the XML Creating the XML
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
node-id: If current node matches node-id this will be one of the dialogue nodes that it will check when it receives a report, if not it will skip this dialogue node. This is the way "levels" of dialogue are made.
target-node: This is what it will set the current node to be if the pattern matches what the player said.
message: What gets put into chat if the players message matches the pattern.
The dialogue works on a "levels" system where there is a current node which holds a String representing what level you are on. When on a particular level the behavior will only check dialogue nodes with that level as its node-id. So to begin with the current node defaults to "start", so the dialogue node you wish to start with should have "start" as its node-id, and if pattern is set to "" it will run this node with whatever the player says. When the behavior runs a node it will send a chat message with the contents of "message" and then set the current node to target-node.
Each dialogue node should follow this pattern:
<Dialogue pattern=".*pattern*." node-id="start" target-node="BranchOne">
<message>This right here is what the NPC will say</message>
</Dialogue>
Something about dialogue timeout