Trouble with actor overrides
Re: Trouble with actor overrides
Hi,
Make sure the dialogue UI's Find Actor Overrides checkbox is ticked.
Could the Override Unity UI Dialogue UI Controls script have been removed or disabled on the other speech bubbles?
Try temporarily setting the Dialogue Manager's Debug Level to Info. This will add a lot of information to the Console view. As each conversation plays, it will log the Actor and Conversant GameObjects. Make sure they're pointing to the correct GameObjects.
To get rid of those yellow warning messages, add some Text elements to your Dialogue System > Canvas > Dialogue UI > Dialogue Panel and assign them to the corresponding fields on the Unity UI Dialogue UI script. Under normal circumstances, they won't be used, so they'll stay hidden. But they'll suppress those warnings. Also, if the dialogue UI isn't able to find the actor overrides, it will use these Text elements. This might give you another clue to the problem.
If none of those suggestions help, please feel free to send an example to tony (at) pixelcrushers.com. I'll be happy to take a look!
(BTW, cool-looking game!)
Make sure the dialogue UI's Find Actor Overrides checkbox is ticked.
Could the Override Unity UI Dialogue UI Controls script have been removed or disabled on the other speech bubbles?
Try temporarily setting the Dialogue Manager's Debug Level to Info. This will add a lot of information to the Console view. As each conversation plays, it will log the Actor and Conversant GameObjects. Make sure they're pointing to the correct GameObjects.
To get rid of those yellow warning messages, add some Text elements to your Dialogue System > Canvas > Dialogue UI > Dialogue Panel and assign them to the corresponding fields on the Unity UI Dialogue UI script. Under normal circumstances, they won't be used, so they'll stay hidden. But they'll suppress those warnings. Also, if the dialogue UI isn't able to find the actor overrides, it will use these Text elements. This might give you another clue to the problem.
If none of those suggestions help, please feel free to send an example to tony (at) pixelcrushers.com. I'll be happy to take a look!
(BTW, cool-looking game!)
Re: Trouble with actor overrides
Thanks!
Okay so it works correctly now that I've moved the Conversation Trigger from the Main Camera to Cowboy 1 (the actor whose bubble was missing). I'm not sure I quite understand why it works now though.
edit: Another question for you! What's the simplest way to query the state of an actor? Specifically I'd like to know if, on the given frame, Actor 1 is talking. The actors will have a variety of animations states and one of them is for speaking.
Okay so it works correctly now that I've moved the Conversation Trigger from the Main Camera to Cowboy 1 (the actor whose bubble was missing). I'm not sure I quite understand why it works now though.
edit: Another question for you! What's the simplest way to query the state of an actor? Specifically I'd like to know if, on the given frame, Actor 1 is talking. The actors will have a variety of animations states and one of them is for speaking.
Re: Trouble with actor overrides
If a Conversation Trigger's Actor and/or Conversant properties are unassigned, the Conversation Trigger will try to figure out which GameObjects to use. It will use the Conversation Trigger's GameObject for the Conversant. If the Conversation Trigger is set to OnUse, OnTriggerEnter, or OnCollisionEnter, it will use the triggering object (usually the player) for the Actor.hannah wrote:Okay so it works correctly now that I've moved the Conversation Trigger from the Main Camera to Cowboy 1 (the actor whose bubble was missing). I'm not sure I quite understand why it works now though.
I'm guessing that the Conversation Trigger's Conversant property is unassigned. Since you moved the Conversation Trigger to Cowboy 1, the Conversation Trigger is now using Cowboy 1 as the Conversant, so now it can find the Override component.
I'll describe two ways: in a script and in a sequence.hannah wrote:edit: Another question for you! What's the simplest way to query the state of an actor? Specifically I'd like to know if, on the given frame, Actor 1 is talking. The actors will have a variety of animations states and one of them is for speaking.
On any given frame, you can check the DialogueManager.CurrentConversationState property. This is a ConversationState, which is an object that contains information about the current state of the conversation. You can get info about the current actor like this:
Code: Select all
actorName = DialogueManager.CurrentConversationState.subtitle.speakerInfo.Name;
actorTransform = DialogueManager.CurrentConversationState.subtitle.speakerInfo.transform;
- Dialogue Text: "Howdy, partner!"
- Sequence: AnimatorPlay(TalkingState); required AnimatorPlay(Idle)@{{end}}
If you want the sequence above to be the default sequence used for all dialogue entry nodes, you can set the Dialogue Manager's Default Sequence field. In this case, leave the dialogue entry node's Sequence field blank. If the Sequence field is blank, the dialogue entry node will use the Dialogue Manager's Default Sequence.
Re: Trouble with actor overrides
Okay! Very cool.
So I've set up that as the default sequence but it seems to be ending the animation early.
So I've set up that as the default sequence but it seems to be ending the animation early.
Re: Trouble with actor overrides
Hi,
From the GIF, it looks like there are two dialogue entries: "Howdy, stranger." and "Care to play a hand or two?...". Is this the case?
If so, it looks like the sequence is only playing on the first dialogue entry. In the second dialogue entry, is the Sequence field set? If so, it wouldn't use the Default Sequence.
Also, please feel free to send an example project to tony (at) pixelcrushers.com any time. I'll be happy to take a look. But I think we should be able to get the final touches done through this forum thread fairly quickly if you prefer.
From the GIF, it looks like there are two dialogue entries: "Howdy, stranger." and "Care to play a hand or two?...". Is this the case?
If so, it looks like the sequence is only playing on the first dialogue entry. In the second dialogue entry, is the Sequence field set? If so, it wouldn't use the Default Sequence.
Also, please feel free to send an example project to tony (at) pixelcrushers.com any time. I'll be happy to take a look. But I think we should be able to get the final touches done through this forum thread fairly quickly if you prefer.
Re: Trouble with actor overrides
The forums work fine for me! I like the forums because it has the potential to help someone else in the future.
So yes, they are two separate dialogue entries but neither of them have a default sequence set. it only seems to be a problem when he has two dialogue entries in a row. That's the only time in the conversation that he has two consecutive entries and is also the only time he doesn't animate correctly.
So yes, they are two separate dialogue entries but neither of them have a default sequence set. it only seems to be a problem when he has two dialogue entries in a row. That's the only time in the conversation that he has two consecutive entries and is also the only time he doesn't animate correctly.
Re: Trouble with actor overrides
Set the Default Sequence to:
The problem is that "Howdy, stranger" tells the animator to play the Idle state and -- on the same frame -- the next dialogue entry tells the animator to play the TalkingState. Since the animator is asked to transition to both in the same frame, it gets into a race condition and one transition ends up taking precedence, in your case the Idle state.
The second sequencer command -- AnimatorPlay(TalkingState)@0.1 -- ensures that the animator transitions to TalkingState 0.1 seconds later even if the race condition occurs.
If you wanted to simplify the sequence, you could just use:
No one's going to notice a 0.1 second delay at the start of the TalkingState.
Code: Select all
AnimatorPlay(TalkingState);
AnimatorPlay(TalkingState)@0.1;
required AnimatorPlay(Idle)@{{end}}
The second sequencer command -- AnimatorPlay(TalkingState)@0.1 -- ensures that the animator transitions to TalkingState 0.1 seconds later even if the race condition occurs.
If you wanted to simplify the sequence, you could just use:
Code: Select all
AnimatorPlay(TalkingState)@0.1;
required AnimatorPlay(Idle)@{{end}}
Re: Trouble with actor overrides
Worked like a charm!
New issue! I'm having trouble getting the actor override script to work. I get thrown the following when we try to find the second actor involved in the conversation.
ArgumentNullException: Argument cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[UnityEngine.Transform,PixelCrushers.DialogueSystem.OverrideUnityUIDialogueControls].ContainsKey (UnityEngine.Transform key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:474)
PixelCrushers.DialogueSystem.UnityUIDialogueUI.FindActorOverride (UnityEngine.Transform actor) (at Assets/Tools/Dialogue System/Scripts/Supplemental/UI/Dialogue UI/UnityUIDialogueUI.cs:125)
PixelCrushers.DialogueSystem.UnityUIDialogueUI.ShowSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle) (at Assets/Tools/Dialogue System/Scripts/Supplemental/UI/Dialogue UI/UnityUIDialogueUI.cs:184)
PixelCrushers.DialogueSystem.ConversationView.StartSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle, Boolean isPCResponseMenuNext, Boolean isPCAutoResponseNext)
PixelCrushers.DialogueSystem.ConversationController.GotoState (PixelCrushers.DialogueSystem.ConversationState state)
PixelCrushers.DialogueSystem.ConversationController.OnFinishedSubtitle (System.Object sender, System.EventArgs e)
PixelCrushers.DialogueSystem.ConversationView.FinishSubtitle ()
PixelCrushers.DialogueSystem.ConversationView.OnFinishedSubtitle ()
PixelCrushers.DialogueSystem.Sequencer.FinishSequence ()
PixelCrushers.DialogueSystem.Sequencer.Update ()
New issue! I'm having trouble getting the actor override script to work. I get thrown the following when we try to find the second actor involved in the conversation.
ArgumentNullException: Argument cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[UnityEngine.Transform,PixelCrushers.DialogueSystem.OverrideUnityUIDialogueControls].ContainsKey (UnityEngine.Transform key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:474)
PixelCrushers.DialogueSystem.UnityUIDialogueUI.FindActorOverride (UnityEngine.Transform actor) (at Assets/Tools/Dialogue System/Scripts/Supplemental/UI/Dialogue UI/UnityUIDialogueUI.cs:125)
PixelCrushers.DialogueSystem.UnityUIDialogueUI.ShowSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle) (at Assets/Tools/Dialogue System/Scripts/Supplemental/UI/Dialogue UI/UnityUIDialogueUI.cs:184)
PixelCrushers.DialogueSystem.ConversationView.StartSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle, Boolean isPCResponseMenuNext, Boolean isPCAutoResponseNext)
PixelCrushers.DialogueSystem.ConversationController.GotoState (PixelCrushers.DialogueSystem.ConversationState state)
PixelCrushers.DialogueSystem.ConversationController.OnFinishedSubtitle (System.Object sender, System.EventArgs e)
PixelCrushers.DialogueSystem.ConversationView.FinishSubtitle ()
PixelCrushers.DialogueSystem.ConversationView.OnFinishedSubtitle ()
PixelCrushers.DialogueSystem.Sequencer.FinishSequence ()
PixelCrushers.DialogueSystem.Sequencer.Update ()
Re: Trouble with actor overrides
Hi,
I'll fix that error message. Unfortunately the fix just missed the version 1.6.0 release that came out today.
Can you name the "Left Cowboy" GameObject the same as the actor's name in your dialogue database?
When a conversation involves more than the original two actors, the Dialogue System finds them in the scene by searching for a GameObject that has the same name as the actor's name in the database. The error message means it didn't find a matching GameObject.
I'll fix that error message. Unfortunately the fix just missed the version 1.6.0 release that came out today.
Can you name the "Left Cowboy" GameObject the same as the actor's name in your dialogue database?
When a conversation involves more than the original two actors, the Dialogue System finds them in the scene by searching for a GameObject that has the same name as the actor's name in the database. The error message means it didn't find a matching GameObject.