Dialogue will not start for some reason, details in topic

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Spacepiratehacker54
Posts: 4
Joined: Tue Jun 20, 2023 2:18 pm

Dialogue will not start for some reason, details in topic

Post by Spacepiratehacker54 »

Hi there,
I use a DialogueSystemTrigger component on an empty game object. I start my first dialogue by calling:

Code: Select all

this.GetComponent<DialogueSystemTrigger>().OnUse();
Which works as intended and starts my dialogue using the built in continue button for each line.
Now after the dialogue ends, I want a different dialogue to start on the same object when the player fails in one of my minigames, so I use:

Code: Select all

void PlayerTooFast()
    {
        if (gameRunning)
        {
            this.GetComponent<DialogueSystemTrigger>().conversation = "New Conversation 5";
            this.GetComponent<DialogueSystemTrigger>().OnUse();
            gameRunning = false;
        }
            
    }
In the editor, the first dialogue node after the Start node in "New Conversation 5" turns green as expected, however nothing appears on screen, neither the dialogue nor the continue button, and because of that there is no way for the player to continue playing and the game is stuck.
There are no warnings or errors appearing in the console.

Image

Please ask me if there is anything else you'd like to know.

Kind regards, Kevin
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue will not start for some reason, details in topic

Post by Tony Li »

Hi Kevin,

As a test, please try playing "New Conversation 5" on its own, not as a follow-up conversation to another conversation. On the Dialogue System Trigger, set the Start Conversation action's Conversation dropdown to "New Conversation 5". This will help determine if the issue is with the conversation or with the fact that it's following another conversation.

If it appears properly when started on its own, then maybe something's going on with the dialogue UI. Check if the subtitle panel's text is set to "Oh, you left the ar...". If so, and if it's still not visible, check if the subtitle panel's or dialogue panel's Canvas Group > Alpha is 0 (invisible). Either way, one solution may be to tick the Standard Dialogue UI components' Wait For Close and the subtitle panels' Wait For Open and Wait For Close checkboxes. This will give the show & hide animations time to complete.

Also, I see that all of the nodes in that conversation are assigned to Kira, but Kira is neither the conversation actor nor the conversation conversant. In the Dialogue Editor, you can try selecting Menu > Conversation Properties and then setting the actor or conversant to Kira. This probably won't fix anything on its own, but it may resolve some issues.

BTW, since you're writing code anyway, you can just use DialogueManager.StartConversation() if you like:

Code: Select all

void PlayerTooFast()
{
    if (gameRunning)
    {
        DialogueManager.StartConversation("New Conversation 5"); // Can also pass actor & conversant transforms.
        gameRunning = false;
    }
}
Post Reply