/// <summary> /// Looks in a conversation for a ConversationStartDialogueNode /// </summary> public void StartConversation(string pConversation) { if (ConversationIsRunning(pConversation)) { logger.Log("Trying to start conversation " + pConversation + " again, even though it's already running"); return; } List <DialogueNode> nodesInConvo = GetNodesForConversation(pConversation); DialogueNode conversationStartNode = nodesInConvo.Find(o => (o.language == _language && o is ConversationStartDialogueNode)); if (conversationStartNode != null) { logger.Log("Starting conversation '" + pConversation + "'"); conversationStartNode.Start(); } else { if (HasConversation(pConversation)) { throw new GrimmException("Can't find a ConversationStartDialogueNode in conversations '" + pConversation + "'"); } else { throw new GrimmException("The dialogue runner doesn't contain the conversation '" + pConversation + "'"); } } }
public override void Update(float dt) { if (_branchNodeCache == null) { _branchNodeCache = _dialogueRunner.GetDialogueNode(conversation, branchNode); } _branchNodeCache.Start(); }
protected void StartNextNode() { if (nextNode == "") { throw new GrimmException("No nextNode in dialogue node '" + name + "' in conversation '" + conversation + "'"); } DialogueNode n = _dialogueRunner.GetDialogueNode(this.conversation, nextNode); //_dialogueRunner.logger.Log("DialogueNode '" + name + "' is starting '" + n.name + "'" + " of type " + n.GetType().ToString() + " in conversation " + n.conversation); //Console.WriteLine("DialogueNode '" + name + "' is starting '" + n.name + "'"); n.Start(); }
public void EventHappened() { //_dialogueRunner.logger.Log("The event of ListeningDialogueNode '" + name + "' in conversation '" + conversation + "' happened"); isListening = false; if (hasBranch) { DialogueNode n = _dialogueRunner.GetDialogueNode(conversation, branchNode); n.Start(); } else { Stop(); StartNextNode(); } }