Page 1 of 3
Different Conversation UI
Posted: Tue Sep 27, 2016 9:27 pm
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.
Re: Different Conversation UI
Posted: Wed Sep 28, 2016 4:40 am
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.
Re: Different Conversation UI
Posted: Mon Oct 03, 2016 9:50 pm
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.
Re: Different Conversation UI
Posted: Mon Oct 03, 2016 10:01 pm
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.
Re: Different Conversation UI
Posted: Mon Oct 03, 2016 10:06 pm
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.
Re: Different Conversation UI
Posted: Mon Oct 03, 2016 10:54 pm
by nrvllrgrs
Thanks. I'll give that a try.
Re: Different Conversation UI
Posted: Tue Oct 04, 2016 7:09 am
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.
Re: Different Conversation UI
Posted: Tue Oct 04, 2016 9:36 am
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.
Re: Different Conversation UI
Posted: Wed Oct 05, 2016 6:01 pm
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.
Re: Different Conversation UI
Posted: Wed Oct 05, 2016 8:58 pm
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: