Page 1 of 1

Skip Button

Posted: Tue Feb 23, 2021 8:06 am
by Niroan
Hello

I have made a button inside my Dialogue UI.
Its just called SKIP BUTTON and is right next to Continue Button.

This is the code:

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PixelCrushers.DialogueSystem;
using UnityEngine.UI;

public class SkipDialogueGameObject : MonoBehaviour
{
    //public GameObject DialogueUI;

    public void SkipDialogueFunction()
    {
        DialogueLua.SetVariable("ConversationIsOver", true);
        DialogueManager.instance.StopConversation();
       // DialogueUI.SetActive(false);
    }
}
But this makes all my other conversations not triggering?
I have several Conversations that trigger when enemies are killed.

How can i make this work? I JUST want to make a button so user can skip to end of conversation :)

Re: Skip Button

Posted: Tue Feb 23, 2021 8:22 am
by Tony Li
Hi,

DialogueManager.instance.StopConversation() stops active conversations. It won't affect the starting of future conversations. Does it have something to do with "ConversationIsOver" variable? Is this variable preventing future conversations from starting?

Side note: You can use DialogueManager.StopConversation(), It's the same as DialogueManager.instance.StopConversation() but shorter.

Re: Skip Button

Posted: Tue Feb 23, 2021 11:47 am
by Niroan
Tony Li wrote: Tue Feb 23, 2021 8:22 am Hi,

DialogueManager.instance.StopConversation() stops active conversations. It won't affect the starting of future conversations. Does it have something to do with "ConversationIsOver" variable? Is this variable preventing future conversations from starting?

Side note: You can use DialogueManager.StopConversation(), It's the same as DialogueManager.instance.StopConversation() but shorter.
Hmm, but will this make the current dialogue to disappear and game will then start? I have pause when conversations is running. The Variable is variable im just using it for a courouting that is waiting for it to be true before i turn on the UI for rest of game :)

But when i use StopConversation in the buttom then the minions that have triggers is not displaying Dialogue UI its only pausing the game?

What could cause this?

Re: Skip Button

Posted: Tue Feb 23, 2021 1:12 pm
by Tony Li
I'm sorry; I don't understand.

When you call DialogueManager.StopConversation(), it will stop the active conversation. If a Dialogue System Trigger started the conversation, the Dialogue System Trigger will unpause the game.

If that information doesn't help, can you please post a screenshot, picture, or diagram to clarify the problem?