Weird Text Mesh Pro Typewriter Effect behaviour
-
- Posts: 19
- Joined: Tue Dec 17, 2019 6:16 am
Weird Text Mesh Pro Typewriter Effect behaviour
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
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.
-
- Posts: 19
- Joined: Tue Dec 17, 2019 6:16 am
Re: Weird Text Mesh Pro Typewriter Effect behaviour
After further investigation, it seems that 1. is caused by "pause markers" within the dialogue text, which looks like that:
The delays seem to be shifted, probably due to the changed formatted text in OnConversationLine from this thread?
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?"
-
- Posts: 19
- Joined: Tue Dec 17, 2019 6:16 am
Re: Weird Text Mesh Pro Typewriter Effect behaviour
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:
It seems as if <b></b> is correctly interpreted/removed, but <indent></indent> remains and causes confusion?
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>";
}
-
- Posts: 19
- Joined: Tue Dec 17, 2019 6:16 am
Re: Weird Text Mesh Pro Typewriter Effect behaviour
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
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
DS_TMPTypewriterPatch_2019-12-17.unitypackage
I used this test scene:
DS_TestTMPTypewriterIndent_2019-12-17.unitypackage
-
- Posts: 19
- Joined: Tue Dec 17, 2019 6:16 am
Re: Weird Text Mesh Pro Typewriter Effect behaviour
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
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
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.
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
Okay, this patch should allow it to handle Accumulate Text:
DS_TMPTypewriterPatch_2019-12-18.unitypackage
DS_TMPTypewriterPatch_2019-12-18.unitypackage
-
- Posts: 19
- Joined: Tue Dec 17, 2019 6:16 am
Re: Weird Text Mesh Pro Typewriter Effect behaviour
Yes! Installed the patch and it's working in my test dialogue!
Thanks, Tony!
Thanks, Tony!
Re: Weird Text Mesh Pro Typewriter Effect behaviour
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;