Page 1 of 2

Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Tue Dec 17, 2019 8:20 pm
by hearsedriver
I am experiencing weird behaviour with the Text Mesh Pro Typewriter Effect. It pauses in the midst of a word, re-displays already displayed subtitles and repeats PLAYER subtitles.

Here's a video to make my point clear (2.8MB, German text but effect should be clearly visible): https://www.dropbox.com/s/c1mcqqu6o42z6 ... s.mp4?dl=0

1. The text stops in the second paragraph after "Es tut mir leid," (at ~3 seconds) and then again in the midst of a word, 3rd paragraph, at "Wie kann ich Ihne" (at ~7 seconds).

2. When I select a response, the typewriter effect continues within the previous, already displayed subtitle paragraph (at ~15 seconds) and the PLAYER subtitle is typed twice (at ~17 seconds).

Please advise!

Thanks
Matt

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Tue Dec 17, 2019 8:33 pm
by hearsedriver
After further investigation, it seems that 1. is caused by "pause markers" within the dialogue text, which looks like that:

Code: Select all

"Guten Abend, werter Herr! Herzlich Willkommen im Hotel zur Post! Ich hoffe, Sie hatten eine bequeme Anreise?"\.
"Es tut mir leid, dass wir Sie bei solch einem Wetter begrüßen müssen. Um diese Zeit des Jahres sind Schneestürme leider die Regel."\.
"Wie kann ich Ihnen helfen?"
The delays seem to be shifted, probably due to the changed formatted text in OnConversationLine from this thread?

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Tue Dec 17, 2019 8:49 pm
by hearsedriver
Yeah, after a quick look into TextMeshProTypewriterEffect.cs it seems like tags are not stripped from the text, e.g. StartTyping receives text = "CONCIERGE – <indent=5%>"Guten Abend, werter Herr! ..." with bold NPC name.

My OnConversationLine method looks like this:

Code: Select all

    void OnConversationLine(Subtitle subtitle)
    {
        subtitle.formattedText.text = "<b>" + subtitle.speakerInfo.Name.ToUpper() + "</b> – <indent=5%>" + subtitle.formattedText.text + "</indent>";
    }
It seems as if <b></b> is correctly interpreted/removed, but <indent></indent> remains and causes confusion?

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Tue Dec 17, 2019 9:34 pm
by hearsedriver
Seems like the latter was a red herring, I wasn't aware that Debug.Log interprets <b></b> tags.

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Tue Dec 17, 2019 9:35 pm
by Tony Li
The issue is basically what you thought. This patch should fix it:

DS_TMPTypewriterPatch_2019-12-17.unitypackage

I used this test scene:

DS_TestTMPTypewriterIndent_2019-12-17.unitypackage

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Wed Dec 18, 2019 8:18 am
by hearsedriver
Toni, thanks for the fast response. I have applied the patch and it does fix the first issue, the two pauses in the midst of the text.

It does not fix issues occurring after a response was selected, though. I have recorded another video: https://www.dropbox.com/s/wwk75m371thd7 ... 2.mp4?dl=0

As you can see, once the response was selected, the previous subtitle is partly repeated before the PC subtitle appears, and then the PC subtitle is repeated.

Thanks once again for your great support!

Matt

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Wed Dec 18, 2019 9:40 am
by Tony Li
Hi,

I'll investigate and post another patch today. When accumulating text, the typewriter effect figures out where to skip ahead before starting to type. I'm sure it's having a similar issue with <indent> tags.

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Wed Dec 18, 2019 7:29 pm
by Tony Li
Okay, this patch should allow it to handle Accumulate Text:

DS_TMPTypewriterPatch_2019-12-18.unitypackage

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Wed Dec 18, 2019 9:19 pm
by hearsedriver
Yes! Installed the patch and it's working in my test dialogue!

Thanks, Tony!

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Posted: Wed Dec 18, 2019 9:35 pm
by Tony Li
Glad to help! If you haven't reported the TMP <indent> issue to Unity yet, let me know. I can contact the developer and ask him to put in that fix for m_xAdvance = tag_Indent;