Page 1 of 1

Switching between two dialogue ui

Posted: Mon Mar 11, 2024 3:19 pm
by Arturicon
I believe there is somewhere such topic, but i couldn't find it. I want to make two completely different dialogue ui. One of them is for ordinary events (it's just window with text and menu) and another one is more complex for real dialogs with character pictures and camera movement (as in Banner Saga). I don't how to switch them depending on specific conversation which trigger it.
I suppose it has something to do with OverrideDisplaySettings, but im not shure how to use it to achieve my goals

Re: Switching between two dialogue ui

Posted: Mon Mar 11, 2024 7:02 pm
by Tony Li
Hi,

You can use an Override Dialogue UI component. Add it to a character, and assign a dialogue UI. If either primary participant in a conversation has an Override Dialogue UI component, the conversation will use the Override Dialogue UI's dialogue UI instead of the default one that was assigned to the Dialogue Manager GameObject's Display Settings > Dialogue UI.

More info about participants: Character GameObject Assignments

I suggest assigning your more complex dialogue UI to the Dialogue Manager's Display Settings > Dialogue UI component.

Then create an empty GameObject for an "Events" actor that you can use in your ordinary event conversations. Add an Override Dialogue UI to it, and assign your simple text + menu dialogue UI to it. Add a Dialogue Actor component to your Events GameObject, and set the Actor dropdown to Events.

Re: Switching between two dialogue ui

Posted: Mon Mar 18, 2024 2:30 pm
by Arturicon
Thanks, it helped a lot. By the way i also wonder can i change dialog ui right in the middle of dialog in depending on who speaking?

Re: Switching between two dialogue ui

Posted: Mon Mar 18, 2024 3:26 pm
by Tony Li
It's probably best to use different subtitle panels in that case. But, yes, it is possible to change dialogue UIs. Assign a different UI to the C# property DialogueManager.conversationView.dialogueUI. The easiest way to use different subtitle panels is to add a Dialogue Actor component to the character's GameObject and set Dialogue UI Settings > Subtitle Panel Number.

Re: Switching between two dialogue ui

Posted: Mon Mar 18, 2024 4:30 pm
by Arturicon
I'm calling Dialogue Manager.conversationView.dialogue UI = newDialogueUI; by Lua when reaching required Dialogue Entry and the old DialogueUI disappearing, but new one doesn't show up. Should i write something else?

Re: Switching between two dialogue ui

Posted: Mon Mar 18, 2024 4:53 pm
by Tony Li
Are there any errors or warnings in the Console window?

If you check the new UI's subtitle text, does it contain the dialogue entry's text?

Re: Switching between two dialogue ui

Posted: Tue Mar 19, 2024 4:27 pm
by Arturicon
There is a Dialog Entry where i call TestChangeUI() { DialogueManager.conversationView.dialogueUI = testDialogueUI;}
And actor - Result which i bind to new Dialogue UI
And when i reaching Dialog Entry where actor is Result and old DialogueUi disappeared and i getting this in console
Рассказчик, Барсег and Result are actors in this conversation.

Any way, you suggested me to change subtitles panel, but there is also some custom panels and menu panels that need to be changed. So if i need completely change the view i suppose i should change whole dialogue UI. Or i don't understand something wrong?

Re: Switching between two dialogue ui

Posted: Tue Mar 19, 2024 11:49 pm
by Tony Li
Here's an example:

DS_ChangeDialogueUIExample_2024-03-19.unitypackage

I just used the SendMessage() sequencer command, but that shouldn't make a difference from using a custom sequencer command or Lua function.

Re: Switching between two dialogue ui

Posted: Wed Mar 20, 2024 4:49 pm
by Arturicon
Thank you) It works now. My mistake was that i was trying to activate new ui that was just prefab, but i had to put it in canvas in dialog manager as an gameobject already.

Re: Switching between two dialogue ui

Posted: Wed Mar 20, 2024 10:36 pm
by Tony Li
Hi,

Yes, that's something I should have made clearer. If you assign a prefab to the Dialogue Manager's Display Settings > Dialogue UI field, the Dialogue Manager will instantiate it when it starts up. But if you just assign conversationView.dialogueUI it won't instantiate a prefab.