Bark UI Issues

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
grofit
Posts: 13
Joined: Sun Feb 07, 2016 2:47 pm

Bark UI Issues

Post by grofit »

So I am now moving onto barks and for some reason I cannot get a bark to display correctly.

I have setup a useable script on the NPC and I have added a custom panel with some text in, with a Bark UI component and mapped the text to the BarkText as well as another text bit for the Speaker Name. I have not added a CanvasGroup as was not sure if that was needed (I did try adding one and it didnt change anything).

The NPC has a BarkTrigger and I set it to (OnUse) and I know the useable bit works as thats the trigger for a conversation (which works, but is disabled in this scenario).

So should I be doing anything else in this scenario to get a bark working?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark UI Issues

Post by Tony Li »

Hi,

Here are some things to check:
  • Does the NPC have a collider on a layer listed in the player's Selector > Layer Mask? (Trigger colliders work, too.)
  • When you target the NPC, does the Selector show targeting text (e.g., "spacebar to interact")? (I know you said these work; I'm just adding them for completeness for future readers who might have a similar question.)
  • Is the NPC's Bark Trigger set to OnUse?
  • Is the Conversation set?
  • If the Barker field is set, does it point to a GameObject with a bark UI, and is the bark UI enabled? (On a child is fine, too.)
  • If the bark UI canvas doesn't have an Animator but it does have a Canvas Group, make sure the Canvas Group's Alpha is set to 1.
  • Is the bark UI canvas positioned so that it's visible? If it's a world space canvas, it's usually positioned above the NPC's head.
If those things look good, please try this:

1. Temporarily set the Dialogue Manager's Debug Level to Info.

2. Trigger the bark.

3. Check the Console for lines like this:

Code: Select all

Dialogue System: Add Link (YourNPC): ID=#:# 'Your bark line.' (True)
Dialogue System: Bark (speaker=YourNPC, listener=Player): 'Your bark line.'
If you've set Conditions on your bark lines, you may also see "Dialogue System: Block on False Link" for lines whose Conditions aren't true yet.

You might see one of these errors:

Code: Select all

Bark (speaker=X, listener=Y): conversation title is blank
^ Set the conversation in your Bark Trigger. If you're using multiple databases, make sure the database containing that conversation is loaded.

Code: Select all

Bark (speaker=X, listener=Y): 'Title' speaker has no bark UI
or

Code: Select all

Bark (speaker=X, listener=Y): 'Title' bark UI is null or disabled
^ The Dialogue System can't find the bark UI, or it's disabled.

Code: Select all

Bark (speaker=X, listener=Y): 'Title' has no START entry
^ There's a problem with the conversation. Make sure it has an orange START entry.

Code: Select all

Bark (speaker=X, listener=Y): 'Title' has no valid bark at this time
^ None of the Conditions are true yet. If you want to debug it, you could use the Watches tab on the Dialogue Editor or add a Lua Console to your scene.

If that doesn't help, temporarily remove the NPC's bark UI, and add a Unity Bark UI component. This is the legacy Unity GUI version. It's simpler to set up because you don't need to create a canvas, etc. It may help you identify whether the issue is on the trigger side or the UI side.

And if that doesn't help, please feel free to send me an example project. I'll be happy to take a look.
grofit
Posts: 13
Joined: Sun Feb 07, 2016 2:47 pm

Re: Bark UI Issues

Post by grofit »

Hey,

Thanks for that the info bit is EXTREMELY useful, it turns out it is being triggered as I can see it outputting the correct blurb on the console as well as setting the variable associated.

I think one thing which I noticed you mention which is different to mine is:
- If the Barker field is set, does it point to a GameObject with a bark UI, and is the bark UI enabled? (On a child is fine, too.)
Now I was under the impression that it was like the conversation UI and I just had a single instance and it just was resolved somehow, so this may be the crux of it. So does every NPC with a bark trigger need to have a UI within their child structure?

Here is a screenshot to show the basic setup:

Image

TestNPC is the object with the Bark Trigger, and like mentioned the console output shows it is working, so the use scripts and everything else are fine it must just be down to the resolving of the bark ui.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark UI Issues

Post by Tony Li »

grofit wrote:Now I was under the impression that it was like the conversation UI and I just had a single instance and it just was resolved somehow, so this may be the crux of it. So does every NPC with a bark trigger need to have a UI within their child structure?
Yes. This allows the Dialogue System to position each NPC's bark UI relative to the NPC's position. If you just move your BarkUI GameObject under TestNPC, it should work.

At the very least, every NPC needs a bark UI script, such as the Unity UI Bark UI script shown in your screenshot. You could, alternatively, point its Canvas Group, Bark Text and Name Text properties to any UI elements in your scene. They don't absolutely have to be children of the bark UI.
Strig
Posts: 40
Joined: Fri Aug 21, 2020 12:33 pm

Re: Bark UI Issues

Post by Strig »

Hello, I'm having a similar issue. I've tried taking a look at the debug, but it shows no warnings.

I did notice, though, that the Alpha in the Bark UI is being forcefully set to 0 during Play mode. The regular Dialogue UI is unaffected by this.

I started getting this error after we did a major UI rework in our game. Is the Dialogue System UI subordinate to other Canvas Groups in the scene, if there is one present?
Captura de Tela (21).png
Captura de Tela (21).png (10.69 KiB) Viewed 1070 times
EDIT: It should be noted that I tried the same with the default Bark UI and I still get the same error.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark UI Issues

Post by Tony Li »

Hi,

Dialogue System canvases are not subordinate to other canvases. They're all independent.

Your bark UI probably has an Animator component whose animator controller is setting the Canvas Group's Alpha to zero. The bark UI's Show and Hide Triggers should set the animator states that control the Alpha.
Post Reply