Page 1 of 1

Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Sat Feb 05, 2022 4:59 am
by Error412
Hi, I'm trying to trigger and event when a dialogue state have responses (waiting for the user to select one).
I tried to get the value of "PixelCrushers.DialogueSystem.ConversationState.hasPCResponses" but that didn't work.

Is there a way to know when a specific conversation state have responses waiting for the user?
I have multiple simultaneous conversations playing at once, and I'm using Playmaker (but I'm fine if this can only be done by scripting).

Thanks!

Re: Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Sat Feb 05, 2022 8:22 am
by Tony Li
Hi,

The message OnConversationResponseMenu is sent to the Dialogue Manager GameObject and the two primary participants just before a response menu appears.

Since you have simultaneous conversations, you could check the conversation ID of the first response to identify which conversation it applies to. Example:

Code: Select all

void OnConversationResponseMenu(Response[] responses)
 {
     int conversationID = responses[0].destinationEntry.conversationID;
     string conversationTitle = DialogueManager.masterDatabase.GetConversation(conversationID).Title;
     Debug.Log("About to show response menu for conversation " + conversationTitle);
 }

Re: Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Mon Feb 07, 2022 3:17 am
by Error412
Thanks Tony, this really helped!
Unrelated question, but I don't think it's worth opening a new thread for it: the SMS Dialogue UI doesn't display the portrait image neither for the NPC nor the player. I even tried to use it in a fresh new project but they are still disabled. I played with the inspector settings for an hour but everything seems to be properly assigned. Is it a known issue?

Re: Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Mon Feb 07, 2022 9:08 am
by Tony Li
Hi,

The SMS Dialogue UI supports portrait images. Try assigning the SMSDialogueUI prefab to DemoScene1's Dialogue Manager > Dialogue UI. Then play the scene and talk with the NPC. You should see that the portraits appear next to each text bubble.

Re: Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Tue Feb 08, 2022 2:23 am
by Error412
Hi, it does indeed support them, but they don't seem to display (I have it assigned to Dialogue Manager) while the rest of the SMS UI works very well.
I found a way to make them display by trial and error: under "NPC Message Template" in "Standard UI Subtitle Panel" I removed "NPC Portrait Image" from the field "Portrait Image". This was the default and I'm not sure why removing it would cause it to display (goes against logic doesn't it?), but it works!
Leaving this here in case someone in the future encounter the same issue, thanks again for your help Tony.

Re: Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Tue Feb 08, 2022 9:10 am
by Tony Li
That's strange. In a vanilla install of Dialogue System version 2.2.24, you can assign SMS Dialogue UI to DemoScene1's Dialogue Manager, and the UI will show portrait images. If you'd like to investigate why this wasn't working in your project at any time, just let me know.

Re: Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Wed Feb 09, 2022 6:50 am
by Error412
I really tried on a test project (2.2.24), and it didn't work for me, until I did the above deleting the link in that field. I'm using Unity 2021.2.9f1 on a Mac, I can try to reproduce it again or provide logs if it can be of any help to you? For me now the issue is solved even if in a strange way :)

Re: Is there a way to know when a specific conversation state have responses waiting for the user?

Posted: Wed Feb 09, 2022 10:08 am
by Tony Li
If you'd like to get to the bottom of it, please feel free to send a reproduction project to tony (at) pixelcrushers.com. If you'd prefer to drop it and continue with your own project development stuff, that's fine, too.