Page 1 of 1

TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Posted: Fri Feb 16, 2018 12:51 pm
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.

Re: TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Posted: Fri Feb 16, 2018 3:02 pm
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.

Re: TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Posted: Fri Feb 16, 2018 8:25 pm
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.

Re: TextMeshProTypewriterEffect error while looking at conversion in Dialogue Database

Posted: Thu Feb 22, 2018 9:40 pm
by mgregoirelds
Hello Tony, I can confirm to you that the fix is working great. Thanks again!