Changing the bark UI background in a dialogue.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
ds2497
Posts: 49
Joined: Wed Jun 14, 2023 2:13 am

Changing the bark UI background in a dialogue.

Post by ds2497 »

Hi there,

I'm currently using Bark for both idle and dialogue situations. However, I'm wondering what I should do if I want to have the idle barks with background A and the dialogue barks with background B. Can you provide some guidance on this?

Thanks!
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Changing the bark UI background in a dialogue.

Post by Tony Li »

Hi,

If by "dialogue situations" you mean conversations (versus one-off barks), what if you use the bark UI only for barks, and use an overhead subtitle panel for conversations? (How To: Show Overhead Conversation Bubble Text)

If that's not what you're looking for, you could add a script to your bark UI's main panel. In OnEnable(), check DialogueManager.isConversationActive. If it's true, use the conversation background image. Otherwise use the bark background image.
User avatar
ds2497
Posts: 49
Joined: Wed Jun 14, 2023 2:13 am

Re: Changing the bark UI background in a dialogue.

Post by ds2497 »

I have BarkOnIdle and Bark UI for regular dialogues, which is why I want to change the background so that players can differentiate between when NPCs are talking directly to them and when NPCs are just barking to themselves. Anyway, with DialogueManager.isConversationActive, it's working! However, I do have another question.

If I want to create a generic "Goodbye" dialogue, how can I accomplish this using the "Link to another dialogue" feature? In the "Goodbye" dialogue, I have "Common Npc" as the actor. When the actor "Soldier A" finishes the last line in the "Test A" dialogue and links to the "Goodbye" dialogue, there is an actor mismatch which causes the barking UI to not appear. How can I fix this?
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Changing the bark UI background in a dialogue.

Post by Tony Li »

Hi,

The solution in that case is to assign Common Npc to the first conversation, too. Since you're providing Soldier A to the Dialogue System Trigger / DialogueManager.StartConversation() method, it will use Soldier A in place of Common Npc in the first conversation and the goodbye conversation.

Alternatively, you can do a little scripting on the change to update the ConversationModel's conversation conversant info. If you need to do this, let me know and I'll describe the process.
User avatar
ds2497
Posts: 49
Joined: Wed Jun 14, 2023 2:13 am

Re: Changing the bark UI background in a dialogue.

Post by ds2497 »

I'm still working on it, meanwhile I have a quick question: it seems like link to another dialogue feature will trigger On Conversation Response Menu on the Dialogue System Events component, am I right? I know this might sound weird, but this is my test result.
User avatar
ds2497
Posts: 49
Joined: Wed Jun 14, 2023 2:13 am

Re: Changing the bark UI background in a dialogue.

Post by ds2497 »

So I've figured it out myself. The Conversation Response Menu gets triggered because the Actor of the Start Node inside the Goodbye dialogue is the player, thus the player's response is considered existing.

Thanks, Tony. You are the best!
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Changing the bark UI background in a dialogue.

Post by Tony Li »

Glad you figured it all out!
Post Reply