Subtitle showing previous text

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
GarlandChaos
Posts: 18
Joined: Wed Aug 14, 2024 3:06 pm

Subtitle showing previous text

Post by GarlandChaos »

Hi!
I'm facing a problem with subtitle text showing briefly the previous text before the typewriter effect starts displaying the new text.
For some reason, it only occurs with the next conversation after I finished a conversation with a SetDialoguePanel(false) command.
Exemplifying, it's something like this:
  • Conversation 1 finishes with a dialogue entry without text, just some sequence commands and along them a SetDialoguePanel(false). I do this because I play some vfx to hide the speaker and if I don't do this, the subtitle panel from the previous speaker still shows.
  • Conversation 2 starts by showing the player subtitle panel with the text from the last text from Conversation 1 for a second, then clear and start typing the correct text. Let's call this text as "Player A". The conversation follows with the NPC subtitle showing the correct text. Let's call this one "NPC A". The third dialogue entry starts by displaying "Player A" briefly then clear and proceeds to type "Player B". Following, the NPC subtitle start glitching as well, with "NPC A" as the initial text then clearing and typing "NPC B".
Again, if I remove the SetDialoguePanel(false) command from the end of Conversation 1, Conversation 2 plays as normal.
Here are screenshots of my Dialogue UI, NPC UI subtitle panel and Player UI subtitle panel:
custom_dialogue_ui.png
custom_dialogue_ui.png (73.28 KiB) Viewed 191 times
npc_subtitle_panel.png
npc_subtitle_panel.png (73.34 KiB) Viewed 191 times
player_subtitle_panel.png
player_subtitle_panel.png (83.49 KiB) Viewed 191 times
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle showing previous text

Post by Tony Li »

Hi,

Try ticking the subtitle panels' Clear Text On Conversation Start (about 1/3 of the way down the inspector view). And UNtick the typewriter effect's Play On Enable checkbox.
GarlandChaos
Posts: 18
Joined: Wed Aug 14, 2024 3:06 pm

Re: Subtitle showing previous text

Post by GarlandChaos »

I made the changes and it worked for the first two dialogue entries (one from Player and one from NPC) of Conversation 2, but from the third onward it glitched again.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle showing previous text

Post by Tony Li »

The SetDialoguePanel(false) may be preempting the Clear Text On Close. Try adding a ClearSubtitleText() sequencer command.
GarlandChaos
Posts: 18
Joined: Wed Aug 14, 2024 3:06 pm

Re: Subtitle showing previous text

Post by GarlandChaos »

I added a ClearSubtitleText(all) to the same dialogue entry sequence containing the SetDialoguePanel(false). It has the same behaviour on Conversation 2 as my previous comment, only the first two dialogue entries show normally :cry:
GarlandChaos
Posts: 18
Joined: Wed Aug 14, 2024 3:06 pm

Re: Subtitle showing previous text

Post by GarlandChaos »

Update: I added a callback to the OnClosed() Unity Event on both UI Subtitle Panels to force clear the text and it worked. Feels like a hack to me, but works :)
Would be nice to confirm if the SetDialoguePanel() command creates this bug for a future patch maybe
onclosedcallback.png
onclosedcallback.png (9.64 KiB) Viewed 149 times
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle showing previous text

Post by Tony Li »

I'll check that for version 2.2.50.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle showing previous text

Post by Tony Li »

Just checked and added this note to the SetDialoguePanel() command's documentation (queued for update in 2.2.50):
SetDialoguePanel(false) will *not* clear subtitle text. This is so you can call SetDialoguePanel(true)
to show the dialogue UI (and its current text) again.
If you want to clear the text, use ClearSubtitleText():

Code: Select all

ClearSubtitleText();
SetDialoguePanel(false)
GarlandChaos
Posts: 18
Joined: Wed Aug 14, 2024 3:06 pm

Re: Subtitle showing previous text

Post by GarlandChaos »

Tony Li wrote: Tue Nov 05, 2024 3:54 pm Just checked and added this note to the SetDialoguePanel() command's documentation (queued for update in 2.2.50):
SetDialoguePanel(false) will *not* clear subtitle text. This is so you can call SetDialoguePanel(true)
to show the dialogue UI (and its current text) again.
If you want to clear the text, use ClearSubtitleText():

Code: Select all

ClearSubtitleText();
SetDialoguePanel(false)
Thank you for the update!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle showing previous text

Post by Tony Li »

Glad to help!
Post Reply