Page 1 of 1

SetContinueMode Not Working on first dialogue panel

Posted: Tue Jul 26, 2022 6:26 pm
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.

Re: SetContinueMode Not Working on first dialogue panel

Posted: Tue Jul 26, 2022 9:34 pm
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.

Re: SetContinueMode Not Working on first dialogue panel

Posted: Mon Aug 08, 2022 4:21 pm
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.

Re: SetContinueMode Not Working on first dialogue panel

Posted: Mon Aug 08, 2022 5:04 pm
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?

Re: SetContinueMode Not Working on first dialogue panel

Posted: Tue Aug 09, 2022 5:47 pm
by gblekkenhorst
Will do!

They all have their own separate continue buttons.

Re: SetContinueMode Not Working on first dialogue panel

Posted: Sun Aug 14, 2022 10:45 am
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();
        }
    }
}