Effective way to switch Dialog UI?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
2linescrossed
Posts: 31
Joined: Tue May 16, 2023 10:37 pm

Effective way to switch Dialog UI?

Post by 2linescrossed »

Hi, so in the current game I'm developing, there are two sections - sections at a table where conversations play automatically, and different sections more akin to visual novels where the text goes by one at a time/scenes change after text advances.
My question is:
- How do I 'change' the current DialogueUi in the Conversation Manager based off of the current type of scene? If I want to have more than one design of UI (for example a second one that looks like the first but the position of the text is at the top of the sceen or at the bottom of the screen)
- Simple question, but how do I directly adjust the DialogueManager's settings like text speed, 'auto continue', and the keybind that makes conversations automatically complete their text/move to the next sentence?
User avatar
Tony Li
Posts: 21049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Effective way to switch Dialog UI?

Post by Tony Li »

Hi,

> How do I 'change' the current DialogueUi in the Conversation Manager based off of the current type of scene? If I want to have more than one design of UI (for example a second one that looks like the first but the position of the text is at the top of the sceen or at the bottom of the screen)

There are a few ways to do this. Here are some:
  • You can configure different subtitle panels in your primary dialogue UI -- for example, a visual novel panel by default, a narrator panel to use for a narrator, even overhead bubble subtitle panels for cartoon-style speech bubbles or thought bubbles. Then use [panel=#] markup tags in your Dialogue Text to direct a specific dialogue entry to a panel, or the SetPanel() sequencer command to tell an actor to use a panel for the duration of the conversation, or add a Dialogue Actor component to the speaker's GameObject (using an empty GameObject if the speaker doesn't have one) and set the Dialogue Actor's Dialogue UI Settings > Subtitle Panel Number. This latter method is also what you'd use to set up overhead speech bubbles.
  • Or add an Override Dialogue UI or Override Display Settings component to one of the participants' GameObjects, and assign an entirely different dialogue UI.
> Simple question, but how do I directly adjust the DialogueManager's settings like text speed, 'auto continue', and the keybind that makes conversations automatically complete their text/move to the next sentence?

To change the continue mode on a per-conversation basis, inspect the conversation in the Dialogue Editor. Select Menu > Conversation Properties. Then tick Override Display Settings > Subtitle Settings, and change the Continue Button mode dropdown.

To change the continue button's keybind, use a different subtitle panel with a continue button bound to a different input (e.g., using a UI Button Key Trigger component).

To change the typewriter speed, you can use a different subtitle panel or write a script (e.g., using an OnConversationLine method) such as this example.
PinkPanther
Posts: 12
Joined: Sun Aug 06, 2023 7:43 pm

Re: Effective way to switch Dialog UI?

Post by PinkPanther »

Hi Tony! Sorry but Can you tell me in more detail how the Override Dialog UI script works? I dont understand, although I have read what is written in the documentation and what you wrote.
I added this script to the NPC Emma and I also added the Dialogue Actor script to Emma. Initially, my own Dialog UI was added to my dialog manager (Called History_UI). At the beginning of the game, a dialogue begins between Player and Player_2 and I want History_UI to be used in this dialogue, and then when the dialogue with Emma begins, I want Basic Dialog UI to be used (in the Override Dialog UI component that Emma has, Basic Dialog UI is used). But it doesn't work. When the first dialog starts, the Basic Dialog UI is used. I tried adding an Override Dialog UI for the Player, but it didn't work. :cry:
User avatar
Tony Li
Posts: 21049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Effective way to switch Dialog UI?

Post by Tony Li »

Hi,

Check the actor assignments in your conversations.

Open the Player - Player_2 conversation in the Dialogue Editor window and select Menu > Conversation Properties. Make sure the Actor and Conversant are set to Player and Player_2. The conversation's Actor and Conversant are called the primary participants. Then check each of the conversation's dialogue entry nodes and make sure the Actor is set to the correct speaker (Player or Player_2).

Then open the Player - Player_2 conversation in the Dialogue Editor window and select Menu > Conversation Properties. Make sure the Actor and Conversant are set to Player (I assume) and Emma. Then check each of the conversation's dialogue entry nodes and make sure the Actor is set to the correct speaker.

In your scene, add Dialogue Actor components to the Player, Player_2, and Emma GameObjects. Set their Actor dropdowns to the correct actors.

On the Emma GameObject, add an Override Dialogue UI component and assign the Basic Standard Dialogue UI prefab.

Your Emma GameObject shouldn't be a child of the Player or Player_2 GameObject's hierarchy. When the Dialogue System checks if a conversation's primary participant has an Override Dialogue UI component, it looks on the participant's GameObject and all of its children. If Emma were a child of Player_2, for example, then when Player_2 is a primary participant it would see Emma's Override Dialogue UI in its hierarchy and switch to the Basic Standard Dialogue UI.

Finally, inspect your Dialogue System Triggers. Make sure the Actions > Start Conversation > Conversation Actor and Conversation Conversant match the conversation's primary participant actors, or leave them unassigned. If they're unassigned, they'll find the correct GameObjects through their Dialogue Actor components.

If that doesn't work, watch the Logging & Debugging Tutorial. It explains how to turn on Info logging so you can see which GameObjects the conversation is using as the primary participants when it starts each conversation.
PinkPanther
Posts: 12
Joined: Sun Aug 06, 2023 7:43 pm

Re: Effective way to switch Dialog UI?

Post by PinkPanther »

Thanks, Tony! It works 8-)
User avatar
Tony Li
Posts: 21049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Effective way to switch Dialog UI?

Post by Tony Li »

Glad to help!
Post Reply