/*this is the entry point for the dialogue manager*/ private void CreateConvoButton_Click(object sender, EventArgs e) { ConversationalParamaters cParams = new ConversationalParamaters(ConversationalParamaters.ConversationType.helloOnly, worldManager.world.findAgentByName("John Snow"), worldManager.world.findAgentByName("Mary Jane"), worldManager.world); cParams.greetingMode = ConversationalParamaters.GreetingMode.fourTurn; cParams.farewellMode = ConversationalParamaters.FarewellMode.simple;//by default conversation type helloOnly doesnt have a farewell Topic t = new Topic(Topic.ExchangeTypeEnum.where); t.subject = worldManager.world.findByProperNoun("Westerberg Campus"); cParams.addTopic(t); if (dialogueGenerator.conversation == null) { dialogueGenerator.newConversation(cParams); } //get everything off the output buffer while (dialogueGenerator.hasNextOutput()) { updateOutput(dialogueGenerator.getOutput()); } EndConvoButton.Enabled = true; }
void Update() { string log = agents.Count + " agents registered: "; foreach (NEEDSIMNode agent in agents) { log += agent.name + ", "; } if (state == State.NoConversation) { if (agents.Count >= 2) { PickRandomPair(); state = State.ConversationRunning; dialogueGenerator.newConversation(cParams); StartCoroutine(displayDialog()); } } else if (state == State.ConversationEnding) { SetAgentColors(Color.red); if (!dialogueGenerator.hasNextOutput()) { state = State.NoConversation; SetAgentColors(Color.white); } } else if (state == State.ConversationRunning) { SetAgentColors(Color.green); } }