I want to prevent Sequence skipping and etc

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
robster21
Posts: 38
Joined: Tue Aug 23, 2022 9:02 am

I want to prevent Sequence skipping and etc

Post 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?
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: I want to prevent Sequence skipping and etc

Post 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
robster21
Posts: 38
Joined: Tue Aug 23, 2022 9:02 am

Re: I want to prevent Sequence skipping and etc

Post 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?
Attachments
OnStartEndEvent.JPG
OnStartEndEvent.JPG (53.88 KiB) Viewed 627 times
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: I want to prevent Sequence skipping and etc

Post 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.
robster21
Posts: 38
Joined: Tue Aug 23, 2022 9:02 am

Re: I want to prevent Sequence skipping and etc

Post 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?
Attachments
OnStartEndEven2t.JPG
OnStartEndEven2t.JPG (40.53 KiB) Viewed 615 times
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: I want to prevent Sequence skipping and etc

Post 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.
Post Reply