DialoguePanel Won't Show

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Reznik
Posts: 18
Joined: Sat Apr 24, 2021 9:21 am

DialoguePanel Won't Show

Post by Reznik »

I can't seem to get the DialoguePanel to show in one particular situation where I'm stopping a conversation and starting a new one and then changing the UI used.

Even with code in the sequence commands as follows, the DialoguePanel Animator Shows it looping the Start state and the associated canvas group is stuck on alpha 0:

//me trying to force it to open
SetDialoguePanel(true, immediate);
OpenPanel(0, open);

I'm not sure why this is happening, but when i use a link to jump past the first conversation (the one i stop to start the second one) and only run the second conversation, it works as expected.
User avatar
Tony Li
Posts: 20771
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialoguePanel Won't Show

Post by Tony Li »

Hi,

How are you stopping the conversation, starting the new one, and changing the UI?
Reznik
Posts: 18
Joined: Sat Apr 24, 2021 9:21 am

Re: DialoguePanel Won't Show

Post by Reznik »

Hi, through sequence commands:

Code: Select all

//ChangeConversation
 public void Start()
        {
            // Get the values of the parameters:
            uiEntry = GetParameter(3);
            convoID = GetParameterAsInt(2);
            actor = GetSubject(0);
            conversant = GetSubject(1);
            convoTitle = GetParameter(4);
            bool overrideBG = GetParameterAsBool(5, false);

            DialogueManager.StopConversation();
            SceneFunctions.SetCutscene(true);
            GameObject uiObj = GlobalFunctions.FindObject(GameObject.Find("Dialogue Manager").transform.Find("Canvas").gameObject, uiEntry);
            uiObj.SetActive(true);
            DialogueManager.UseDialogueUI(uiObj);

            if (uiEntry == "VN Template Standard Dialogue UI" || overrideBG)
            {
                SceneFunctions.CullCharacterLayer();
                GameObject otherGui = GlobalFunctions.FindObject(GameObject.Find("Dialogue Manager").transform.Find("Canvas").gameObject, "Letterbox Template Standard Dialogue UI");
                otherGui.SetActive(false);
            }
            else
            {
                SceneFunctions.CullCharacterLayer(false);
                GameObject otherGui = GlobalFunctions.FindObject(GameObject.Find("Dialogue Manager").transform.Find("Canvas").gameObject, "VN Template Standard Dialogue UI");
                otherGui.SetActive(false);
            }

            DialogueManager.StartConversation(convoTitle, actor, conversant, convoID);
            Stop();
            
        }

Code: Select all

//ChangeUI
public void Start()
        {
            // Get the values of the parameters:
            uiEntry = GetParameter(1);
            convoID = GetParameterAsInt(0);

            string title = DialogueManager.LastConversationStarted;

            DialogueManager.StopConversation();
            SceneFunctions.SetCutscene(true);

            GameObject uiObj = GlobalFunctions.FindObject(GameObject.Find("Dialogue Manager").transform.Find("Canvas").gameObject, uiEntry);
            uiObj.SetActive(true);

            if (uiEntry == "VN Template Standard Dialogue UI")
            {
                SceneFunctions.CullCharacterLayer();
                
                GameObject otherGui = GlobalFunctions.FindObject(GameObject.Find("Dialogue Manager").transform.Find("Canvas").gameObject, "Letterbox Template Standard Dialogue UI");
                otherGui.SetActive(false);
            }
            else
            {
                SceneFunctions.CullCharacterLayer(false);

                GameObject otherGui = GlobalFunctions.FindObject(GameObject.Find("Dialogue Manager").transform.Find("Canvas").gameObject, "VN Template Standard Dialogue UI");
                otherGui.SetActive(false);
            }

            DialogueManager.UseDialogueUI(uiObj);
            DialogueManager.StartConversation(title, DialogueManager.CurrentActor, DialogueManager.CurrentConversant, convoID);
            Stop();

        }

User avatar
Tony Li
Posts: 20771
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialoguePanel Won't Show

Post by Tony Li »

You can access the Dialogue Manager with DialogueManager.instance and the default canvas with DialogueManager.displaySettings.defaultCanvas. You don't have to use GameObject.Find().

To change dialogue UIs in the middle of a conversation, set ConversationView.dialogueUI:

Code: Select all

DialogueManager.conversationView.dialogueUI = yourUI as IDialogueUI;
You may need to access DialogueManager.activeConversations if you're starting a conversation while another is active.

Or you can set DialogueManager.interruptActiveConversations to true. Then you don't have to stop the conversation. Just do something like:

Code: Select all

DialogueManager.UseDialogueUI(uiObj);
DialogueManager.StartConversation(convoTitle, actor, conversant, convoID);
I don't know if that will help. If it doesn't, feel free to send a reproduction project to tony (at) pixelcrushers.com.
Reznik
Posts: 18
Joined: Sat Apr 24, 2021 9:21 am

Re: DialoguePanel Won't Show

Post by Reznik »

Thanks, not sure why what I had worked before but stopped. Anyway, i made some of your suggested changes to simplify my sequencer functions and it seems to have resolved it. Appreciate it!
User avatar
Tony Li
Posts: 20771
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialoguePanel Won't Show

Post by Tony Li »

Glad to help!
Post Reply