Page 1 of 1

I want to prevent Sequence skipping and etc

Posted: Fri Aug 26, 2022 10:15 am
by robster21
01.
While the Sequence is running, the Sequence skips when I click the Continue button.
I want to prevent this.



02.
At the end of the Conversation, Pressing the button continuously and quickly, Then the END Node's Sequence doesn't work that contain Delay(); command.

The Sequence in the END Node is:
Delay(0.5)->Message("DelayEnd"); Camera(original,,1)@Message(DelayEnd);
(The Camera moves to its original position after 0.5 seconds later.)

When I press the Continue button(continuously and quickly) at the end of the Conversation, then the Conversation ends without moving the camera.

How can we solve this problem?

Re: I want to prevent Sequence skipping and etc

Posted: Fri Aug 26, 2022 10:45 am
by Tony Li
Hi,

One solution is to turn off the continue button. Set the Dialogue Manager's Display Settings > Subtitle Settings > Continue Button dropdown to Never.

Alternatively, you can use the SetContinueMode() sequencer command. Example:

Code: Select all

SetContinueMode(false); // Turn off continue button.
AnimatorPlayWait(Dance)->Message(Done);
SetContinueMode(true)@Message(Done)
Alternatively, you can tick the Dialogue Manager's Subtitle Settings > Inform Sequence Start And End. Then, assuming your dialogue UI is in the Dialogue Manager's hierarchy, add a Dialogue System Events. Configure the OnSequenceStart() UnityEvent to make the continue button non-interactable and OnSequenceEnd() to make it interactable.


BTW, you can simplify this sequence:

Code: Select all

Delay(0.5)->Message("DelayEnd"); Camera(original,,1)@Message(DelayEnd);
to:

Code: Select all

Camera(original,,1)@0.5

Re: I want to prevent Sequence skipping and etc

Posted: Fri Aug 26, 2022 11:09 pm
by robster21
Thank you, it's mostly worked out!
However, I failed to control using with Unity Event.

Which Game Object and Component can be used to control Continue Mode in On Sequence Start/End Event?

Re: I want to prevent Sequence skipping and etc

Posted: Sat Aug 27, 2022 8:03 am
by Tony Li
Hi,

You can't control the Dialogue Manager's Subtitle Settings > Continue Button mode in a UnityEvent, but you can directly set the continue button's Button component > Interactable checkbox.

Re: I want to prevent Sequence skipping and etc

Posted: Sat Aug 27, 2022 9:41 am
by robster21
I set the Continue Button's Interactable to false in the On Sequence Start Event.
But when the Conversation starts, it becomes true (the same thing happens with SetActive)
What should I do?

Re: I want to prevent Sequence skipping and etc

Posted: Sat Aug 27, 2022 12:40 pm
by Tony Li
Ah, it's getting caught up in the order of events. Better to use SetContinueMode(false) in the Sequence. If you don't want to set the dialogue entry's Sequence or the Dialogue Manager's Default Sequence to this, you can use a small script on the Dialogue Manager. Something like:

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;
public class NoContinueDuringSequence : MonoBehaviour
{
    void OnConversationLine(Subtitle subtitle)
    {
        subtitle.sequence = "SetContinueMode(false); " + subtitle.sequence;        
    }
    
    void OnSequenceEnd(Transform actor) // Assumes Subtitle Settings > Inform Sequence Start And End is ticked.
    {
        DialogueManager.PlaySequence("SetContinueMode(true)");
    }
}
Note: I just typed that into the reply; I haven't tested it, so it might have typos.