Page 1 of 1

Actor Name Change - Typewriter effect doesn't run

Posted: Mon Feb 14, 2022 1:38 pm
by GreenConure
Hello!

Thank you again for your support last time!

I'm currently running into this issue where sometimes a character's dialogue subtitle doesn't run the typewriter effect. I noticed this happens whenever I change a character's actor name via Actor["Actor"].Display_Name = "Name" but I could be wrong. It currently happens in one conversation where the actor's display name is changed in one node. I pasted the error info below.

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
SetTypewriterForActor.OnBeginTypewriter () (at Assets/Dialogue System Examples/Modify Typewriter Example/SetTypewriterForActor.cs:10)
UnityEngine.Events.InvokableCall.Invoke () (at <0ee480759f3d481d82ada245dc74f9fd>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <0ee480759f3d481d82ada245dc74f9fd>:0)
PixelCrushers.DialogueSystem.UnityUITypewriterEffect+<Play>d__41.MoveNext () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/UnityUITypewriterEffect.cs:242)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <0ee480759f3d481d82ada245dc74f9fd>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.DialogueSystem.UnityUITypewriterEffect:StartTypewriterCoroutine(Int32) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/UnityUITypewriterEffect.cs:228)
PixelCrushers.DialogueSystem.UnityUITypewriterEffect:StartTyping(String, Int32) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/UnityUITypewriterEffect.cs:201)
PixelCrushers.DialogueSystem.TypewriterUtility:StartTyping(UITextField, String, Int32) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TypewriterUtility.cs:46)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:SetSubtitleTextContent(Subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:575)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:SetContent(Subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:543)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:ShowSubtitleNow(Subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:284)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:ShowSubtitle(Subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:270)
PixelCrushers.DialogueSystem.StandardUISubtitleControls:ShowSubtitle(Subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitleControls.cs:420)
PixelCrushers.DialogueSystem.StandardDialogueUI:ShowSubtitleImmediate(Subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:249)
PixelCrushers.DialogueSystem.StandardDialogueUI:ShowSubtitle(Subtitle) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:231)
PixelCrushers.DialogueSystem.ConversationView:StartSubtitle(Subtitle, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:160)
PixelCrushers.DialogueSystem.ConversationController:GotoState(ConversationState) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:212)
PixelCrushers.DialogueSystem.ConversationController:OnFinishedSubtitle(Object, EventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:270)
PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:418)
PixelCrushers.DialogueSystem.ConversationView:HandleContinueButtonClick() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:390)
PixelCrushers.DialogueSystem.ConversationView:OnConversationContinue(IDialogueUI) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:373)
UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinueConversation() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:366)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinue() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:356)
PixelCrushers.DialogueSystem.StandardUIContinueButtonFastForward:OnFastForward() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Effects/StandardUIContinueButtonFastForward.cs:75)
UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
When the actor speaks, it shows the entire dialogue then skips to the next entry after a few seconds. To clarify, it only happens to one specific actor.

Let me know what you think!
Thank you!

Re: Actor Name Change - Typewriter effect doesn't run

Posted: Mon Feb 14, 2022 3:21 pm
by Tony Li
Hi,

Your typewriter's OnBegin() event calls SetTypewriterForActor.OnBeginTypewriter(), which looks up the current actor's "AudioClip" field by Name.

The error is occurring on the line in SetTypewriterForActor that tries to look up the actor by its database name -- which is the Name field, not the Display Name field.

Is something perhaps changing the Name field?

If that doesn't help, can you send a reproduction project to tony (at) pixelcrushers.com?

Re: Actor Name Change - Typewriter effect doesn't run

Posted: Mon Feb 14, 2022 11:56 pm
by GreenConure
Hi!

Thank you for the quick reply! I haven't changed the actor name in any way other than changing the display name. But I was able to get through it by making a duplicate actor and it works well too.

Appreciate your support!

Re: Actor Name Change - Typewriter effect doesn't run

Posted: Tue Feb 15, 2022 8:31 am
by Tony Li
Glad to help! If the problem happens again and you can't use a separate actor, please feel free to send me a repro project.