Different Conversation UI

Announcements, support questions, and discussion for the Dialogue System.
nrvllrgrs
Posts: 20
Joined: Wed Nov 11, 2015 4:55 pm

Different Conversation UI

Post by nrvllrgrs »

Is it possible to create a different UI for different conversations? For example, when conversing with a person then the UI is the traditional tree. And when conversing with a computer, the UI is replaced with a more digital experience.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: Different Conversation UI

Post by Tony Li »

Hi,

Yes, add an Override Dialogue UI to the computer and assign the digital-style dialogue UI to it. The Feature Demo scene's "Terminal" GameObject provides an example of doing this.
nrvllrgrs
Posts: 20
Joined: Wed Nov 11, 2015 4:55 pm

Re: Different Conversation UI

Post by nrvllrgrs »

That's fantastic! Working brilliantly.

Is it possible to override it at the node level? I'm trying to create a command line email experience. The inbox would have one UI and the message would have another UI.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: Different Conversation UI

Post by Tony Li »

Not out of the box, sorry. Here are a few ideas:

1. Treat the inbox and message as separate conversations.

2. Or write your own implementation of the IDialogueUI C# interface.

You might be able to use script messages such as OnConversationLine or node events (the OnExecute() section in the Inspector) to change things up somehow. To be honest, I haven't thought through how you could leverage those for this case, but I wanted to at least mention it.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: Different Conversation UI

Post by Tony Li »

Sorry for the double post. A better idea just occurred to me. You could set up the inbox and messages as separate actors.

Set up the inbox as the main "NPC" actor.

Set up the messages section on a separate GameObject as a secondary "NPC" actor. (It can be an empty GameObject.) On this GameObject, add an Override Unity UI Dialogue UI Controls component, and assign the alternate UI elements for the messages section.

Finally, tick the Unity UI Dialogue UI's Find Actor Overrides checkbox (at the bottom of the Inspector) to tell the dialogue UI to check actors for overrides.
nrvllrgrs
Posts: 20
Joined: Wed Nov 11, 2015 4:55 pm

Re: Different Conversation UI

Post by nrvllrgrs »

Thanks. I'll give that a try.
nrvllrgrs
Posts: 20
Joined: Wed Nov 11, 2015 4:55 pm

Re: Different Conversation UI

Post by nrvllrgrs »

nrvllrgrs wrote:That's fantastic! Working brilliantly.
I fear that I'm going to have to retract this statement. It works if I use a legacy UI prefab. It does not work if I use a Unity UI prefab.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: Different Conversation UI

Post by Tony Li »

It should work basically the same with Unity UI. Note that you can't assign a prefab directly to Override Dialogue UI. You have to assign a scene instance. Otherwise,if Override Dialogue UI had to instantiate an instance of the prefab, it wouldn't know which Canvas to put it under. Legacy UI prefabs don't have this issue since they aren't required to be under a Canvas.

It occurred to me this morning that you might not need to define the inbox and messages as separate actors. Would it work in your case to set up the inbox as the player response menu, and the messages section as the subtitle panel? When the player selects a response (i.e., an inbox message header) from the response menu (i.e., the inbox), it would show the message body in the subtitle panel. If this sounds like what you're looking for, I can put together a simple example. If you'd like to see that, just let me know.
nrvllrgrs
Posts: 20
Joined: Wed Nov 11, 2015 4:55 pm

Re: Different Conversation UI

Post by nrvllrgrs »

I think I see what you mean. I'll give it a try and if I run into problems I'll reach out again. Thanks.
User avatar
Tony Li
Posts: 22106
Joined: Thu Jul 18, 2013 1:27 pm

Re: Different Conversation UI

Post by Tony Li »

Here's an example if you'd like to see one way to do it:

EmailConversationExample_2016-10-05.unitypackage

The graphics aren't fancy, but that's fairly easy to change:

Image
Post Reply