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.
DialoguePanel Won't Show
Re: DialoguePanel Won't Show
Hi,
How are you stopping the conversation, starting the new one, and changing the UI?
How are you stopping the conversation, starting the new one, and changing the UI?
Re: DialoguePanel Won't Show
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();
}
Re: DialoguePanel Won't Show
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:
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:
I don't know if that will help. If it doesn't, feel free to send a reproduction project to tony (at) pixelcrushers.com.
To change dialogue UIs in the middle of a conversation, set ConversationView.dialogueUI:
Code: Select all
DialogueManager.conversationView.dialogueUI = yourUI as IDialogueUI;
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);
Re: DialoguePanel Won't Show
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!
Re: DialoguePanel Won't Show
Glad to help!