Usable Issue: The Playable Graph Is Null

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Usable Issue: The Playable Graph Is Null

Post by PayasoPrince »

Hello,

When I start a conversation with my NPC's in the overworld via a proximity selector, I am receiving the following error:

Code: Select all

NullReferenceException: The PlayableGraph is null.
UnityEngine.Playables.PlayableGraph.GetRootPlayableInternal (System.Int32 index) (at <d02824b4a0b24381ae4f3c43dbb3365a>:0)
UnityEngine.Playables.PlayableGraph.GetRootPlayable (System.Int32 index) (at <d02824b4a0b24381ae4f3c43dbb3365a>:0)
PixelCrushers.DialogueSystem.SequencerCommands.SequencerCommandTimeline+<Proceed>d__9.MoveNext () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Options/Timeline/Sequencer/SequencerCommandTimeline.cs:152)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <d02824b4a0b24381ae4f3c43dbb3365a>:0)
Worth mentioning that this issue does not occur during while starting a conversation with them through a Timeline scene.

If it helps, here is the Lua code that I use for the default sequencer In the Dialogue Managers > Default cutscene settings:

Code: Select all

Timeline(speed, TimelineManager, 0);
required Timeline(speed, TimelineManager, 1)@Message(Continued);
AnimatorPlay(Talking);
required AnimatorPlay(Idle)@Message(Typed);
Delay({{end}})
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Usable Issue: The Playable Graph Is Null

Post by Tony Li »

Hi,

Does the GameObject named "TimelineManager" have a Playable Director component with a valid Timeline asset assigned to its Playable field?
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Re: Usable Issue: The Playable Graph Is Null

Post by PayasoPrince »

Hi,

Yes it does.
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Usable Issue: The Playable Graph Is Null

Post by Tony Li »

Is there maybe another GameObject also named TimelineManager?

If not, can you send a reproduction project to tony (at) pixelcrushers.com?
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Re: Usable Issue: The Playable Graph Is Null

Post by PayasoPrince »

Hi Tony,

Confirmed that there is no other object named TimelineManager. Removing these lines from the Dialogue Manager > Camera & Cutscene Settings > Default Sequence removes the error:

Code: Select all

Timeline(speed, TimelineManager, 0);
required Timeline(speed, TimelineManager, 1)@Message(Continued);
I assume that this means it is looking for TimelineManager's playable director even if there is no cutscene happening? Is there an "If" statement I can add so that it does not look for TimerManager if there is no Timeline playing?

Additional information: My TimelineManager Gameobject is in "CommonScene" and this NPC is in my "DungeonScene" that gets opened additively. So, they are not in the same scene even though they are both open at the same time. There is also this weird issue when I trigger the OnUse() Dialogue it is showing the main character's sprite.

Image
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Usable Issue: The Playable Graph Is Null

Post by Tony Li »

For the Timeline() issue, you can either send a reproduction project or set a breakpoint and trace through the SequencerCommandTimeline class's Start() method. Alternatively, you could copy SequencerCommandTimeline.cs and make a custom sequencer command to work the way you want.

For the other issue, make sure the correct GameObjects are being used. In the Dialogue Editor, inspect the conversation and select Menu > Conversation Properties. Assuming your conversation's Actor is the player and the Conversant is the NPC, the player GameObject should be assigned to your Dialogue System Trigger's Conversation Actor field, and the NPC should be assigned to the Conversation Conversant field. More info: Character GameObject Assignments
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Re: Usable Issue: The Playable Graph Is Null

Post by PayasoPrince »

Tony Li wrote: Mon May 02, 2022 9:52 pm For the Timeline() issue, you can either send a reproduction project or set a breakpoint and trace through the SequencerCommandTimeline class's Start() method. Alternatively, you could copy SequencerCommandTimeline.cs and make a custom sequencer command to work the way you want.
I'm still not very comfortable sending my project and it would probably require a ton of work recreating, so I guess I will continue looking into this on my end. I don't think the player graph being null is impacting my games playability.
Tony Li wrote: Mon May 02, 2022 9:52 pm For the other issue, make sure the correct GameObjects are being used. In the Dialogue Editor, inspect the conversation and select Menu > Conversation Properties. Assuming your conversation's Actor is the player and the Conversant is the NPC, the player GameObject should be assigned to your Dialogue System Trigger's Conversation Actor field, and the NPC should be assigned to the Conversation Conversant field. More info: Character GameObject Assignments
I'd like to at least focus on this issue. I have already reviewed the link you provided and also watched

I need to clarify, to my understanding the actor should always be the NPC speaking to you and should ONLY be the player when you want the dialogue to be in the Player's response menu, correct?

This is how I have the conversation with my NPC Bootler setup:
Image

The actor Bootler is correctly set in the Dialogue System trigger's conversation actor field:
Image

The issue is these event's that are listed on my Hero(Playercontroller) are not being called. My hero has a proximity selector and an Actor component. OnUse() is being called and the dialogue plays, but for some reason the events do not trigger.
Image
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Usable Issue: The Playable Graph Is Null

Post by Tony Li »

Hi,

Select Menu > Conversation Properties and set the Actor to Bootler to fix this:

assignParticipants.png
assignParticipants.png (24.39 KiB) Viewed 2271 times

Also, Dialogue System event messages are only sent to the primary participants. If you want the player's Dialogue System Events to receive OnConversationStart/End events:

1. Select Menu > Conversation Properties. Set the Actor to Player and the Conversant to Bootler. It doesn't matter that the Player doesn't have any dialogue entry nodes assigned to it. Make sure the one text node is still assigned to Bootler.

2. Assign the player GameObject to the Dialogue System Trigger's Conversation Actor and Bootler GameObject to Conversation Conversant. If you can't assign the player, then add a Dialogue Actor component to the player and set the Actor dropdown to Player.
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Re: Usable Issue: The Playable Graph Is Null

Post by PayasoPrince »

Finally got it working!

So, I really just want to make sure I'm grasping this:

Conversations between the Player and an NPC should always be

Menu > Conversation properties:
Actor: Player
Conversant: (NPC)

THEN, each dialogue node should be:
Actor (NPC)
Conversant: Player

UNLESS the player needs to be responding using the response panel.

Do I have that right? :oops:
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Usable Issue: The Playable Graph Is Null

Post by Tony Li »

Yes, that's correct.
Post Reply