Using dialogue system for display only.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ferakiii
Posts: 13
Joined: Tue Nov 19, 2019 12:25 am

Using dialogue system for display only.

Post by ferakiii »

I’m tanking an event driven dialogue system after using the excellent node based one you have made, but I would like to use all the awesome display logic that this system has. Currently I am using barks to display all my dialogue since it isn’t setup as conversations. But there are limitations to the bark system (maybe I’m just not good at using it) like being able to detect when a bark ends, canceling a bark halfway through being two that I have hit. Is there a better way to use the dialogue system to display text that isn’t coming from the dialogue system conversations? Or is there a way to safely cancel barks? I have a weird error where if I call StandardBarkUI.hide then the sometimes it causes the bark ui to hide after one frame on subsequent bark calls. Turning the bark ui game object inactive then active fixes it temporarily. I’m probably doing something very wrong somewhere though.

Any thoughts on approach? Override BarkUI like suggested in another form post (labeled Stop Bark)

Cheers
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using dialogue system for display only.

Post by Tony Li »

Hi,

When a bark ends, the Dialogue System will send OnBarkEnd messages to the barker, listener, and Dialogue Manager.

Bark.Hide() is the right way to cancel a bark. If your bark UI is behaving strangely after manually calling Hide(), keep an eye on its Animator during play. Maybe the animator controller is getting into a strange state, or a trigger parameter is being set when it shouldn't.

The Bark Group Member component may also be useful. The enemies in DemoScene2 use it. When one member of a bark group barks, it cancels any other members' active barks.
ferakiii
Posts: 13
Joined: Tue Nov 19, 2019 12:25 am

Re: Using dialogue system for display only.

Post by ferakiii »

Awesome I’ll take a look at the animator. Thanks for the help, you really do rock.
ferakiii
Posts: 13
Joined: Tue Nov 19, 2019 12:25 am

Re: Using dialogue system for display only.

Post by ferakiii »

Yeah the animator is stuck in the "hide" state. After bark finished normally, it goes into hide state, then when I call bark it goes into show start for the correct duration. But if I have called the Hide Bark Code below on the animator, then it gets stuck in the hide state. The BarkString call doesn't seem to transition it to the show state (It may in some brief state that I can't see, cause the speech bubble pops up for an instant) but just reruns the hide state.

Any ideas where to go now?

Show Bark code:

Code: Select all

                    var duration = baseDurationTime + (toFire.say.Length / 30f); // <-- Change to your characters per second value.
                    var sequence = "Delay(" + duration + ")";
                    
                    DialogueManager.BarkString(toFire.say, characterGo.transform, null, sequence);


Hide Bark code:

Code: Select all

            foreach (var barkUI in FindObjectsOfType<StandardBarkUI>())
            {
                if (barkUI.isPlaying) {
                    barkUI.Hide();
                }
            } 
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using dialogue system for display only.

Post by Tony Li »

Hi,

It sounds like the Hide trigger parameter is getting left in the set position for some reason. Please try this patch. It will reset the Hide trigger so that showing a new bark UI should work even if Hide was left set:

DS_BarkUIPatch_2021-06-02.unitypackage
ferakiii
Posts: 13
Joined: Tue Nov 19, 2019 12:25 am

Re: Using dialogue system for display only.

Post by ferakiii »

You are a legend that worked (had to fix a compile error because it looks like it's from a different version, I'm on 2.1.16)

Reverted this line to include the UITools.CreateSprite call.

Code: Select all

                    portraitImage.sprite = UITools.CreateSprite(subtitle.speakerInfo.portrait);
But it fixed my problem, thanks so much.
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using dialogue system for display only.

Post by Tony Li »

Great! Glad I could help.
Post Reply