Weird Text Mesh Pro Typewriter Effect behaviour

Announcements, support questions, and discussion for the Dialogue System.
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Weird Text Mesh Pro Typewriter Effect behaviour

Post 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
Last edited by hearsedriver on Tue Dec 17, 2019 8:34 pm, edited 1 time in total.
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post 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?
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post 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?
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post by hearsedriver »

Seems like the latter was a red herring, I wasn't aware that Debug.Log interprets <b></b> tags.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post 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
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post 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
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post 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.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post by Tony Li »

Okay, this patch should allow it to handle Accumulate Text:

DS_TMPTypewriterPatch_2019-12-18.unitypackage
hearsedriver
Posts: 19
Joined: Tue Dec 17, 2019 6:16 am

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post by hearsedriver »

Yes! Installed the patch and it's working in my test dialogue!

Thanks, Tony!
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Weird Text Mesh Pro Typewriter Effect behaviour

Post 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;
Post Reply