Update NPC Dialog authored by Joshua Kellogg's avatar Joshua Kellogg
...@@ -64,7 +64,10 @@ There is no limit to how many nodes you can have within the dialogue tree ...@@ -64,7 +64,10 @@ There is no limit to how many nodes you can have within the dialogue tree
INFO POOL: INFO POOL:
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 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. ADDITIONAL INFO:
There needs to be a node with the node-id as "start", this will be the root node from which the NPC will start its conversation.
A pattern of "" will run this node no matter what the player has said, as long as the player sends a message.
See "MowreyInfoXML.xml" in the project for an example about how the dialogue works
Each dialogue node should follow this pattern: Each dialogue node should follow this pattern:
...@@ -74,4 +77,5 @@ Each dialogue node should follow this pattern: ...@@ -74,4 +77,5 @@ Each dialogue node should follow this pattern:
</Dialogue> </Dialogue>
``` ```
Something about dialogue timeout DIALOGUE TIMEOUT:
\ No newline at end of file There is a instance variable in RoamingInfoNPCBehavior called "CHAT_DELAY_SECONDS", which is the amount of seconds before the NPC will reset back to its start node in the tree
\ No newline at end of file