void Reply(System.Guid id, Name initiator, Name target) { Debug.Log("We are replying" + initiator + " and " + target); // Retrieving the chosen dialog object var dialog = _iat.GetDialogActionById(id); // Playing the audio of the dialogue line this.StartCoroutine(Speak(id, initiator, target)); //Writing the dialog on the canvas GameObject.Find("DialogueText").GetComponent <Text>().text = initiator + ": " + dialog.Utterance; // Getting the full action Name var actualActionName = "Speak(" + dialog.CurrentState + ", " + dialog.NextState + ", " + dialog.Meaning + ", " + dialog.Meaning + ")"; //So we can generate its event var eventName = EventHelper.ActionEnd(initiator, (Name)actualActionName, target); ClearAllDialogButtons(); //Inform each participating agent of what happened _rpcList.Find(x => x.CharacterName == initiator).Perceive(eventName); _rpcList.Find(x => x.CharacterName == target).Perceive(eventName); //Handle the consequences of their actions HandleEffects(eventName); }
public void OnDialogueSelected(Guid dialogId) { /*var d =*/ iat.GetDialogActionById(dialogId); if (ResetEmotions) { var currentMood = agent1RPC.Mood; agent1RPC.ResetEmotionalState(); agent1RPC.Mood = currentMood; } HandleSpeakAction(dialogId, "Player", agent1RPC.CharacterName.ToString()); }
public void Reply(Guid dialogId) { ClearDialogOptions(); var state = _agentController.RPC.GetBeliefValue("DialogState(Player)"); if (state == IATConsts.TERMINAL_DIALOGUE_STATE) { return; } var reply = _iat.GetDialogActionById(dialogId); var actionFormat = string.Format("Speak({0},{1},{2},{3})", reply.CurrentState, reply.NextState, reply.Meaning, reply.Style); GameObject.FindObjectOfType <HeadLookController>().LookAtPlayer(); // StartCoroutine(PlayerReplyAction(actionFormat, reply.NextState)); PlayerReplyAction(actionFormat, reply.NextState); UpdateScore(reply); alreadyUsedDialogs.Add(reply.Utterance, reply.UtteranceId); UpdateScore(reply); // UpdateHistory(reply.Utterance); }
public void Reply(Guid dialogId) { /* var state = _agentController.RPC.GetBeliefValue("DialogState(Player)"); * if (state == IATConsts.TERMINAL_DIALOGUE_STATE) * { * return; * }*/ var reply = _iat.GetDialogActionById(dialogId); Name actionName = Name.BuildName("Speak"); Name actionCS = Name.BuildName(reply.CurrentState); Name actionNS = Name.BuildName(reply.NextState); Name actionMean = Name.BuildName(reply.Meaning[0]); Name actionStyle = Name.BuildName(reply.Style[0]); Name utteranceID = Name.BuildName(reply.UtteranceId); var act = new ActionLibrary.Action(new List <Name>() { actionName, actionCS, actionNS, actionMean, actionStyle }, chosenTarget); _agentControllers.Find(x => x.RPC.CharacterName == _chosenCharacter).Speak(this, act); UpdateButtonTexts(true, new DialogueStateActionDTO[1]); // alreadyUsedDialogs.Add(reply.Utterance, reply.UtteranceId); }
void Reply(System.Guid id, Name initiator, Name target) { dialogueTimerAux = dialogueTimer; // Retrieving the chosen dialog object var dialog = _iat.GetDialogActionById(id); var utterance = dialog.Utterance; var meaning = dialog.Meaning; var style = dialog.Style; var nextState = dialog.NextState; var currentState = dialog.CurrentState; // Playing the audio of the dialogue line if (useTextToSpeech) { this.StartCoroutine(Speak(id, initiator, target)); } //Writing the dialog on the canvas GameObject.Find("DialogueText").GetComponent <Text>().text = initiator + " says: '" + utterance + "' ->towards " + target; // Getting the full action Name var actualActionName = "Speak(" + currentState + ", " + nextState + ", " + meaning + ", " + style + ")"; //So we can generate its event var eventName = EventHelper.ActionEnd(initiator, (Name)actualActionName, target); ClearAllDialogButtons(); //Inform each participating agent of what happened _rpcList.Find(x => x.CharacterName == initiator).Perceive(eventName); _rpcList.Find(x => x.CharacterName == target).Perceive(eventName); //Handle the consequences of their actions HandleEffects(eventName); }
public void Reply(Guid dialogId, Name target) { var reply = _iat.GetDialogActionById(dialogId); var actionFormat = string.Format("Speak({0},{1},{2},{3})", reply.CurrentState, reply.NextState, reply.Meaning, reply.Style); StartCoroutine(PlayerReplyAction(actionFormat, target)); alreadyUsedDialogs.Add(reply.Utterance, reply.UtteranceId); foreach (var b in m_buttonList) { Destroy(b.gameObject); } m_buttonList.Clear(); }
public void Reply(Guid dialogId) { var state = _agentController.RPC.GetBeliefValue("DialogState(Player)"); if (state == IATConsts.TERMINAL_DIALOGUE_STATE) { return; } var reply = _iat.GetDialogActionById(dialogId); var actionFormat = string.Format("Speak({0},{1},{2},{3})", reply.CurrentState, reply.NextState, reply.Meaning, reply.Style); StartCoroutine(PlayerReplyAction(actionFormat, reply.NextState)); alreadyUsedDialogs.Add(reply.Utterance, reply.UtteranceId); foreach (var b in m_buttonList) { Destroy(b.gameObject); } m_buttonList.Clear(); }