SetContinueMode Not Working on first dialogue panel

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
gblekkenhorst
Posts: 83
Joined: Wed Jun 24, 2020 5:06 pm

SetContinueMode Not Working on first dialogue panel

Post by gblekkenhorst »

I'm using the following to prevent the player from skipping a certain dialogue until an animation is finished.

Code: Select all

 SetContinueMode(false);
required SetContinueMode(true)@5;
Continue()@5
However, it doesn't work the first time a custom dialogue panel is up. For example:

NPC1 - Doesn't work
NPC2 - Doesn't work
NPC1 - Does Work
NPC3 - Doesn't work
NPC3 - Does Work

It seems to just be StContinueMode that isn't executing. Continue() will fire if I wait the 5 seconds.
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetContinueMode Not Working on first dialogue panel

Post by Tony Li »

Hi,

SetContinueMode() will set the continue mode, which controls whether the dialogue UI shows a continue button or not. But if Continue() runs it will always continue, even if you've run SetContinueMode(false). The Continue() command takes precedence.

If that info doesn't help, please provide more details about the custom dialogue panel setup.
gblekkenhorst
Posts: 83
Joined: Wed Jun 24, 2020 5:06 pm

Re: SetContinueMode Not Working on first dialogue panel

Post by gblekkenhorst »

So, we have a lot of NPCs that use the standard NPC subtitle panel, and then a few special NPCs that use custom dialogue panels. We assign them using the Dialogue Actor script.

SetContinueMode and Continue are working as they should, but only the second time a certain panel is called. The continue button is visible and it does not auto continue the first time the panel is called in a scene, even though it is using the same code as the later nodes that do work.
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetContinueMode Not Working on first dialogue panel

Post by Tony Li »

Is the continue button shared across multiple subtitle panels? If so, maybe something is happening there.

I'm not sure what could be going on. Would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?
gblekkenhorst
Posts: 83
Joined: Wed Jun 24, 2020 5:06 pm

Re: SetContinueMode Not Working on first dialogue panel

Post by gblekkenhorst »

Will do!

They all have their own separate continue buttons.
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetContinueMode Not Working on first dialogue panel

Post by Tony Li »

Thanks for sending the repro project. The issue is that ContinueAfterThis() calls DialogueManager.PlaySequence(), which kicks off separate sequences that are not tied to the dialogue entry node's timing. Here's a modified version of the script that handles the continue button without kicking off separate sequences.

SequencerCommandContinueAfterThis .cs

Code: Select all

using System.Collections;
using UnityEngine;

namespace PixelCrushers.DialogueSystem.SequencerCommands
{
    [AddComponentMenu("")] // Hide from menu.
    public class SequencerCommandContinueAfterThis : SequencerCommand
    {

        public IEnumerator Start()
        {
            SetContinueButton(false);
            yield return new WaitForSeconds(GetParameterAsFloat(0));
            SetContinueButton(true);
            DialogueManager.instance.BroadcastMessage("OnConversationContinueAll", SendMessageOptions.DontRequireReceiver);
            Stop();
        }

        private void SetContinueButton(bool always)
        {
            DialogueManager.displaySettings.subtitleSettings.continueButton = always 
                ? DisplaySettings.SubtitleSettings.ContinueButtonMode.Always
                : DisplaySettings.SubtitleSettings.ContinueButtonMode.Never;
            DialogueManager.conversationView.SetupContinueButton();
        }
    }
}
Post Reply