TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Post by mgregoirelds »

Hello, I have a weird problem happening with TextMesh Pro.

When I import an articy xml file within the game and trigger a conversation, it is working fine since the conversation is displayed. However, when I open the Dialogue Database, select my specific dialogue in the Conversations tab and try triggering this conversation in-game, I get the following error:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProTypewriterEffect.PlayText (System.String text) (at Assets/Externals/Dialogue System/Third Party Support/TextMesh Pro/Scripts/Common/TextMeshProTypewriterEffect.cs:223)
PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProSubtitleControls.SetSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle) (at Assets/Externals/Dialogue System/Third Party Support/TextMesh Pro/Scripts/Dialogue UI/TextMeshProSubtitleControls.cs:201)
PixelCrushers.DialogueSystem.AbstractUISubtitleControls.ShowSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle)
PixelCrushers.DialogueSystem.AbstractDialogueUI.SetSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle, Boolean value)
PixelCrushers.DialogueSystem.AbstractDialogueUI.ShowSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle)
PixelCrushers.DialogueSystem.TextMeshPro.TextMeshProDialogueUI.ShowSubtitle (PixelCrushers.DialogueSystem.Subtitle subtitle) (at Assets/Externals/Dialogue System/Third Party Support/TextMesh Pro/Scripts/Dialogue UI/TextMeshProDialogueUI.cs:263)
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 ()
The only thing I did between those two cases is going to see my dialogue within the database. My current workaround is to reimport the xml file and never look at my dialogue through the Dialogue Database.
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Post by Tony Li »

Hi,

I'll check this out today and get back to you. I modified the TMP typewriter effect in 1.7.7.2 to support RPGMaker codes. It's possible there's a bug.
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Post by Tony Li »

Please try this updated package: TextMeshPro_Support_2018-02-16.unitypackage

The error message points to this line of the typewriter script:

Code: Select all

textComponent.text = text;
It means the Text Mesh Pro UGUI component hasn't been assigned to the textComponent variable yet. This variable is assigned in the Awake() method. This suggests that the Awake() method hasn't run yet.

I updated the script so it will automatically find the Text Mesh Pro UGUI component even if Awake() hasn't run yet.

It doesn't explain why this works in the pure articy version but not when you've opened the conversation in the Dialogue Editor window. I wasn't able to reproduce the error. But the updated package should avoid the error entirely.
mgregoirelds
Posts: 106
Joined: Wed Aug 23, 2017 4:10 pm
Location: Canada

Re: TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Post by mgregoirelds »

Hello Tony, I can confirm to you that the fix is working great. Thanks again!
Unity 2022.3.17f1
Dialogue System 2.2.44.1
OpenAI Addon 1.0.12
Post Reply