Niche problem with Stopping a conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Cynical-C
Posts: 5
Joined: Fri Jun 30, 2023 12:55 pm

Niche problem with Stopping a conversation

Post by Cynical-C »

I discovered a very specific bug that I'm pretty sure is unintentional behavior. My game allows the player to reset to a previous time period from the pause menu. When this happens, I call StopAllConversations on the dialogue manager. If the player pauses while the subtitle panel is opening and then StopAllConversations is called before the subtitle starts, the subtitle gets "stored" and then is executed the next time I talk to any NPC or I wait 5 seconds. This is because of the coroutine StartTypingWhenFocused waiting for the panel state to be open or 5 seconds to pass. When the dialogue is stopped the panel never reaches the Open state. So the next time the panel reaches the open state (in this case after I restart and then talk to someone else within 5 seconds) it executes the right NPC dialogue which is then immediately overwritten by the stored dialogue. I managed to fix it by including a yield break in the while loop that executes if the panelstate is set to closed.

Not sure if it's just because of my particular setup, but thought the devs should know. Maybe StopAllConversations could also cancel subtitle based coroutines or something.
User avatar
Tony Li
Posts: 23272
Joined: Thu Jul 18, 2013 1:27 pm

Re: Niche problem with Stopping a conversation

Post by Tony Li »

Good catch! I'll fix that in the next update and provide a patch here by the end of the weekend.
User avatar
Tony Li
Posts: 23272
Joined: Thu Jul 18, 2013 1:27 pm

Re: Niche problem with Stopping a conversation

Post by Tony Li »

Post Reply