Help with Bark Conversations

Announcements, support questions, and discussion for the Dialogue System.
Mackerel_Sky
Posts: 111
Joined: Mon Apr 08, 2019 8:01 am

Help with Bark Conversations

Post by Mackerel_Sky »

Hi,

I'm trying to get two NPCs to hold a randomised conversation. After some digging around on the forums I understand the best practice for this is to use a conversation and override their subtitle UIs.

In order to simulate a randomised conversation, I have a OnTriggerEnter Dialogue Trigger that links to a conversation starting with a randomiser node that has a sequencer calling RandomizeNextEntry() and Continue(). The actual conversation start nodes are all linked to the randomiser node.

However, the normal dialogue UI starts when the conversation starts. I tried putting an override dialogue UI linking to one of the bark UIs but that doesn't seem to work. Player input is also suspended during normal dialogue, so I hope that there's a way to avoid triggering a normal conversation and freezing the player.

Continue also seems to be running twice for some reason - the bark UI does show up as expected, but it skips the first entry in the conversation and goes straight to the second.

Would you be able to help me find the issue on this?

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

Re: Help with Bark Conversations

Post by Tony Li »

Hi,

You don't need to use a bark UI or Override Dialogue UI. Please see:

How To: Set Up Overhead Bubble Conversations
Mackerel_Sky
Posts: 111
Joined: Mon Apr 08, 2019 8:01 am

Re: Help with Bark Conversations

Post by Mackerel_Sky »

Hey Tony,

Thanks for that link - I didn't catch it during my research.

I'm still having issues with the normal dialogue UI coming up and the player input being paused however. I could maybe get around it by having sequences play to hide the dialogue UI and reenable player input but it would probably lead to microstutters and maybe wreak havoc if there's a normal conversation going on at the same time. Is there some way or a more elegant way around this?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help with Bark Conversations

Post by Tony Li »

Hi,

There's no need for workarounds, so I'd avoid workarounds to prevent unexpected side effects.

For the issue with the normal dialogue appearing: Given the extra info in the last few posts, add an Override Dialogue UI component to one of the participants. Assign the Basic Standard Dialogue UI prefab to it.

For the issue of the player's controls being disabled during conversations: Are you using any character controller frameworks such as Opsive UCC or More Mountains' Corgi Engine? If so, what are the Dialogue System-related configurations on the player (if any)?
Mackerel_Sky
Posts: 111
Joined: Mon Apr 08, 2019 8:01 am

Re: Help with Bark Conversations

Post by Mackerel_Sky »

Hi Tony,


For the Override Dialogue UI component, I set it to the basic Dialogue UI prefab as described and it worked! Now we just need to fix the player input.

I'm using my own character controller, unfortunately. I have a GameManager object with a Dialogue System Events component that disables the player input component on conversation start. Not sure if that's sufficient information.

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

Re: Help with Bark Conversations

Post by Tony Li »

Hi,
Mackerel_Sky wrote: Sun Nov 20, 2022 2:35 amFor the Override Dialogue UI component, I set it to the basic Dialogue UI prefab as described and it worked!
Thanks for confirming. Here's why this works: Conversations always need a dialogue UI to coordinate the visibility of subtitle panels and menu panels, even overhead bubble subtitle panels. The Dialogue System keeps the dialogue UI open for the duration of the conversation, even if it's using Dialogue Actors' custom panels instead of the panels built into the dialogue UI. This is fine if you're using a UI such as Basic Standard Dialogue UI whose only visible content are in subtitle panels and menu panels. But if your dialogue UI has visible UI elements even if none of its subtitle panels or menu panels are open, those UI elements will be visible during the conversation.
Mackerel_Sky wrote: Sun Nov 20, 2022 2:35 amI'm using my own character controller, unfortunately. I have a GameManager object with a Dialogue System Events component that disables the player input component on conversation start. Not sure if that's sufficient information.
How does your GameManager know when a conversartion has started? For example, does it receive OnConversationStart and OnConversationEnd messages? Hook into DialogueManager.instance.conversationStarted?

Your GameManager should probably check if the current conversation involves the player. You can check if DialogueManager.currentActor or currentConversant is the player. If neither is the player, don't disable controls.
Mackerel_Sky
Posts: 111
Joined: Mon Apr 08, 2019 8:01 am

Re: Help with Bark Conversations

Post by Mackerel_Sky »

Thanks Tony - all makes sense from me.

The Game Manager knows when a dialogue starts because of the Dialogue Events component - I have it set up like this:



I added a check to the actor and conversant like you suggested - it got rid of the input issue, but now I can't start any conversation with the player or other (standard) bark as the Dialogue System throws this alert: Dialogue System: Another conversation is already active.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help with Bark Conversations

Post by Tony Li »

Are you trying to run simultaneous conversations (e.g., a bark conversation between NPCs A & B, and an interactive conversation between the player and NPC c)? If so, tick the Dialogue Manager's Other Settings > Allow Simultaneous Conversations.
Mackerel_Sky
Posts: 111
Joined: Mon Apr 08, 2019 8:01 am

Re: Help with Bark Conversations

Post by Mackerel_Sky »

Hi Tony,

Thanks for the suggestion, it would be good but my current OnUse input message I'm using is the down arrow, which is also used to navigate player dialogue choices. So if we disable simulatenous conversations, then conversations will start over and over again when the player needs to respond.

There's also another complication - The UIs used for the background bark canvas seem to be throwing an error when we move scenes while it is playing. The error log is:

Code: Select all

MissingReferenceException: The object of type 'StandardUISubtitlePanel' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
PixelCrushers.UIPanel.Close () (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIPanel.cs:200)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel.Close () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:293)
PixelCrushers.DialogueSystem.StandardUISubtitleControls.ShowSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitleControls.cs:337)
PixelCrushers.DialogueSystem.StandardDialogueUI.ShowSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:198)
PixelCrushers.DialogueSystem.ConversationView.StartSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle, System.Boolean isPCResponseMenuNext, System.Boolean isPCAutoResponseNext) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:141)
PixelCrushers.DialogueSystem.ConversationController.GotoState (PixelCrushers.DialogueSystem.ConversationState state) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:208)
PixelCrushers.DialogueSystem.ConversationController.OnFinishedSubtitle (System.Object sender, System.EventArgs e) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:265)
PixelCrushers.DialogueSystem.ConversationView.FinishSubtitle () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:399)
PixelCrushers.DialogueSystem.ConversationView.HandleContinueButtonClick () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:371)
PixelCrushers.DialogueSystem.ConversationView.OnConversationContinueAll () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:363)
UnityEngine.Component:BroadcastMessage(String, SendMessageOptions)
PixelCrushers.DialogueSystem.Sequencer:HandleContinueInternally() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:2489)
PixelCrushers.DialogueSystem.Sequencer:HandleCommandInternally(String, String[], Single&) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:1088)
PixelCrushers.DialogueSystem.Sequencer:ActivateCommand(String, String, Transform, Transform, String[]) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:721)
PixelCrushers.DialogueSystem.Sequencer:OnSequencerMessage(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:867)
UnityEngine.Component:SendMessage(Component, String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.Sequencer:Message(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:205)
PixelCrushers.DialogueSystem.<SendTimedSequencerMessage>d__119:MoveNext() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:829)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Any ideas? It might not be worth the effort to set up after all, if there are too many hoops to jump through :?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help with Bark Conversations

Post by Tony Li »

Hi,

Only tick Allow Simultaneous Conversations if you actually want to run two or more conversations at the same time.

If not, and if you're still getting the "Dialogue System: Another conversation is already active" warning, then we need to find out why a previous conversation is still active.

Regarding the down arrow, use a Dialogue System Events component on the player to disable whatever listens for the down arrow to send OnUse. (See 07:00 of the Interaction Tutorial.)
Post Reply