Bark Instance Not Set on an Object When Adding Standard Bark UI

Announcements, support questions, and discussion for the Dialogue System.
UnPixTheCat
Posts: 10
Joined: Sun Jan 02, 2022 3:22 pm

Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by UnPixTheCat »

Hello.

I got Unity Dialogue System today and so far it has been very buggy when I have been trying to follow the tutorials. Doing one Tutorial somehow breaks the previous one but that is not the issue.

The issue is that I am trying to follow them to see what I can create and I am only on Bark, the 3 tutorial and when I try to add the Dialogue Actor with the prefab Template Bubble "Bubble Template Standard Bark UI" to the Bark UI, I get this:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.StandardBarkUI.Bark (PixelCrushers.DialogueSystem.Subtitle subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Bark/StandardBarkUI.cs:197)
PixelCrushers.DialogueSystem.BarkController+<Bark>d__10.MoveNext () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/BarkController.cs:213)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <0ee480759f3d481d82ada245dc74f9fd>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.DialogueSystem.DialogueSystemController:Bark(String, Transform, Transform, BarkHistory) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:1386)
PixelCrushers.DialogueSystem.DialogueManager:Bark(String, Transform, Transform, BarkHistory) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueManager.cs:555)
PixelCrushers.DialogueSystem.BarkStarter:TryBark(Transform, Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/Legacy/BarkStarter.cs:133)
PixelCrushers.DialogueSystem.BarkStarter:TryBark(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/Legacy/BarkStarter.cs:96)
PixelCrushers.DialogueSystem.<BarkLoop>d__9:MoveNext() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/BarkOnIdle.cs:70)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
I understand I need a Standard UI to display it, as without it I get warning messages with the bark messages inside of them saying I need a BARK Standard UI. But how do I implement that when doing so causes NULL references? Help?
2022-01-02 21_38_15-Window.png
2022-01-02 21_38_15-Window.png (98.08 KiB) Viewed 733 times
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark Instance Not Set of an Object

Post by Tony Li »

Hi,

Thanks for making a forum post.

Did you get the Dialogue System from the Unity Asset Store?

What version of the Dialogue System are you using? It's listed in the Welcome window (menu item Tools > Pixel Crushers > Dialogue System > Welcome Window) and in Plugins / Pixel Crushers / Dialogue System / _README.txt.

Are there any other errors or warnings in the Console window?

Thank you for pasting the full stack trace details of the NullReferenceException. In version 2.2.23, line 197 of StandardBarkUI.cs doesn't contain any code that can cause a NullReferenceException.

I suspect that maybe you have an old or corrupt version of the Dialogue System.

Here's a playable scene made using the same steps as the Bark Tutorial, except that it uses the demo's dialogue database instead of creating a new database:

DS_BarkTutorialScene_2022-01-02.unitypackage
UnPixTheCat
Posts: 10
Joined: Sun Jan 02, 2022 3:22 pm

Re: Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by UnPixTheCat »

Hello.

I got it today. It is version 2.2.23. I have a suspicion the Import and Download are not working properly as I had to re-download and re-import it since the first time I added it was full of errors. I followed the Tutorial:

But somehow the Dialogue Actor section just is not working with the error and image I sent.
UnPixTheCat
Posts: 10
Joined: Sun Jan 02, 2022 3:22 pm

Re: Bark Instance Not Set of an Object

Post by UnPixTheCat »

Tony Li wrote: Sun Jan 02, 2022 3:42 pm Hi,

Thanks for making a forum post.

Did you get the Dialogue System from the Unity Asset Store?

What version of the Dialogue System are you using? It's listed in the Welcome window (menu item Tools > Pixel Crushers > Dialogue System > Welcome Window) and in Plugins / Pixel Crushers / Dialogue System / _README.txt.

Are there any other errors or warnings in the Console window?

Thank you for pasting the full stack trace details of the NullReferenceException. In version 2.2.23, line 197 of StandardBarkUI.cs doesn't contain any code that can cause a NullReferenceException.

I suspect that maybe you have an old or corrupt version of the Dialogue System.

Here's a playable scene made using the same steps as the Bark Tutorial, except that it uses the demo's dialogue database instead of creating a new database:

DS_BarkTutorialScene_2022-01-02.unitypackage
I get the same error with the test scene. I just do not understand. The Dialogue Actor with Bark UI is broken for me. I tried to re-import and download everything again.
UnPixTheCat
Posts: 10
Joined: Sun Jan 02, 2022 3:22 pm

Re: Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by UnPixTheCat »

I do not understand if it is something just broken with my Unity, as I tried on a separate project to follow the next tutorial by downloading the Standard Unity Assets and that package was full and full of errors.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by Tony Li »

What version of Unity are you using?

The Standard Assets package doesn't work out of the box with Unity 2020+. Learntocreategames.com has written a guide to use Standard Assets in Unity 2020+: https://learntocreategames.com/importin ... nity-2020/

We're working on updated tutorials for the ones that use Standard Assets. We had hoped to use Unity's Starter Assets package for them, but they have their own issues, such as requiring the new Input System package which would unnecessarily add another layer of complexity. So we'll be providing some new assets to accompany the updated tutorials.

Did the Quick Start and Conversation Conditions tutorials work correctly for you?

Apart from the Standard Assets package, were there any other errors or warnings in the Console other than the original one you posted above?

When you play the example scene I provided above, you should hear the Capsule play an enemy bark audio clip. As soon as you hear the audio clip, pause the scene. Does the Capsule have a child named "Bubble Template Standard Bark UI(Clone)"? And is the Text child object's text set to the same audio that's being played? (In the screenshot below, the audio/text is "You're going down!")
barkUI.png
barkUI.png (90.71 KiB) Viewed 725 times
UnPixTheCat
Posts: 10
Joined: Sun Jan 02, 2022 3:22 pm

Re: Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by UnPixTheCat »

My Unity is 2020.3.25f1.

The Standard Package was just an outdated script that needed GUIText to just say Text. I resolved that.

But I still do not understand why I cannot make a Bark Pop Up Bubble appear. Not even in the test scene, you sent me. I do not get an Audio prompt or anything. The moment it tries to Bark I get sent the error message about the missing instance.

Along with what I sent above about the Bark UI not finding an Instance I get this:
Dialogue System: The scene is missing an EventSystem. Adding one.
UnityEngine.Debug:LogWarning (object)
PixelCrushers.DialogueSystem.UITools:RequireEventSystem () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/UITools.cs:40)
PixelCrushers.DialogueSystem.StandardUIQuestLogWindow:Awake () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Quest/StandardUIQuestLogWindow.cs:104)
UnityEngine.Object:Instantiate<UnityEngine.GameObject> (UnityEngine.GameObject)
PixelCrushers.InstantiatePrefabs:OnEnable () (at Assets/Plugins/Pixel Crushers/Common/Scripts/Misc/InstantiatePrefabs.cs:37)
2022-01-02 22_14_56-Window.png
2022-01-02 22_14_56-Window.png (121.01 KiB) Viewed 725 times
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by Tony Li »

You can ignore the "Dialogue System: The scene is missing an EventSystem. Adding one." warning. It's just saying that there's no EventSystem, so the Dialogue System is creating one. An EventSystem is required for Unity UI to recognize input.

In your project, what is line 197 of Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Bark/StandardBarkUI.cs?

(I have to step out of the office for ~45 minutes, but I'll reply as soon as I get back in.)
UnPixTheCat
Posts: 10
Joined: Sun Jan 02, 2022 3:22 pm

Re: Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by UnPixTheCat »

2022-01-02 22_25_50-Window.png
2022-01-02 22_25_50-Window.png (57.4 KiB) Viewed 721 times
Line 197 is:
portraitImage.sprite = speakerPortrait;
which means that having None in Portrait might be what is causing the issue?
UnPixTheCat
Posts: 10
Joined: Sun Jan 02, 2022 3:22 pm

Re: Bark Instance Not Set on an Object When Adding Standard Bark UI

Post by UnPixTheCat »

BTW, QuickStart and conversation Tutorials worked perfectly fine. It is just something not working on Barks for me and has something to do with the Dialogue Actor as I tried different methods to trigger it. But the failure is always on the Bark bubble / Dialogue Actor.

I have to go to bed since I am working tomorrow so I will have to see if I can resolve this tomorrow.
Post Reply