Dialogue System for Unity 2.2.14 Released

Announcements, support questions, and discussion for the Dialogue System.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Dialogue System for Unity 2.2.14 Released

Post by cptscrimshaw »

Thanks Tony!

First part worked fine, though I had to use:

Code: Select all

DialogueManager.Instance.interruptActiveConversations = true;
I do pause the game during the fullscreen conversation, but the animation was already set to unscaled time. I think I may have more information: Whenever the fullscreen conversation ends, it doesn't appear to unpause the game time (i.e., player can't move and nothing else seems to be updating, and the previous bubble dialogue remains on on screen). I tested this by unchecking Pause Game During Conversation in the Dialogue System Trigger. I haven't encountered this anywhere else - it's only when there is the override UI conversation is running and is interrupted by a regular, fullscreen one.

Any ideas? Other info I can provide you with?

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

Re: Dialogue System for Unity 2.2.14 Released

Post by Tony Li »

Thanks for catching the missing 'instance'. I added it to my previous post so it doesn't trip any future readers.

Do both conversations pause the game?

If so, what's happening is that when the first conversation starts it records the current timeScale (1) and sets it to 0.

Then the second conversation starts and records the current timeScale (0).

Then the first conversation ends and sets the timeScale back to its recorded value of 1.

But then the second conversation ends and sets the timeScale back to its recorded value of 0.

Since you're overlapping conversations, untick the Dialogue System Triggers' Pause Game During Conversation checkboxes. Use a Dialogue System Events component or a script on the Dialogue Manager to manage pausing. For example:

PauseDuringConversations.cs

Code: Select all

using UnityEngine;
public class PauseDuringConversations : MonoBehaviour
{
    private int numActiveConversations = 0;
    
    void OnConversationStart(Transform actor)
    {
        numActiveConversations++;
        Time.timeScale = 0;
    }
    
    void OnConversationEnd(Transform actor)
    {
        numActiveConversations--;
        if (numActiveConversations == 0)
        {
            Time.timeScale = 1;
        }
    }
}[code]
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Dialogue System for Unity 2.2.14 Released

Post by cptscrimshaw »

The first conversation doesn't actually pause the game, as the player is meant to walk around when the bubble is above their head (just for small dialogue things that don't directly impact gameplay).

I tried adding Time.timeScale = 1; in OnConversationEnd() and that solved the problem, but the bubble window still remains visible during the entire fullscreen conversation (then fades away when it's over). I originally thought maybe the original conversation never got to the end before the new one started, but put the Debug Level to "info" and the conversation definitely ends.

Anything else to look into?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System for Unity 2.2.14 Released

Post by Tony Li »

Hi,

Try this patch:

DS_BarkPatch_2021-02-01.unitypackage

If your Dialogue Manager's Dialogue Time is set to Realtime (the default), the bark UI will hide when it's due to hide even if Time.timeScale is 0 (e.g., if you've paused the game by using the Dialogue System Trigger's Pause Game During Conversation checkbox).
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Dialogue System for Unity 2.2.14 Released

Post by cptscrimshaw »

That fixed it! You're a gem Tony, thank you.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System for Unity 2.2.14 Released

Post by Tony Li »

Glad to help! :-)
Post Reply