Page 1 of 1

Control Continue button

Posted: Mon Feb 12, 2018 3:14 pm
by mgregoirelds
Hello,

Is there any way to disable being able to hit Continue before a certain event is received by Dialogue System?

I created my own custom sequence command that I use with my dialogues. This custom command is run at every dialogue entry. This command is in fact a IEnumator function that does different stuff based on the dialogue entry (add an item to the inventory, enable hud element, play sound, fade in/out screen...). However, there is nothing in place right now that control the fact that a player can mash all he wants on the controller to use the continue button while the IEnumator state is not completed. What I thought of is to be able, at the end of the IEnumerator coroutine, tell Dialogue System that yes, all elements in the state is run and continue is "reenabled" so the player can move to the next dialogue entry.

Any idea on how I could do that? Thanks!

Re: Control Continue button

Posted: Mon Feb 12, 2018 8:33 pm
by Tony Li
Hello Maxime,

You can use the SetContinueMode() sequencer command. For example:

Code: Select all

SetContinueMode(false);
YourCustomCommand()->Message(Done);
required SetContinueMode(original)@Message(Done)
The sequence above:
  • Disables the continue button at 0:00.
  • Starts YourCustomCommand() at 0:00.
  • When YourCustomCommand() finishes, sends the sequencer message "Done". (This is an arbitrary string. It can be anything.)
  • When the sequencer message "Done" is sent, resets the continue button back to its original state. The "required" keyword ensures that it resets the continue button no matter what.
If you don't want to use sequencer commands, you can control it in a script:

Code: Select all

// Hide continue button:
DialogueManager.DisplaySettings.subtitleSettings.continueButton = DisplaySettings.SubtitleSettings.ContinueButtonMode.Never;
DialogueManager.ConversationView.SetupContinueButton();
...
// Show continue button:
DialogueManager.DisplaySettings.subtitleSettings.continueButton = DisplaySettings.SubtitleSettings.ContinueButtonMode.Always;
DialogueManager.ConversationView.SetupContinueButton();

Re: Control Continue button

Posted: Mon Feb 12, 2018 10:45 pm
by mgregoirelds
Yet again, thanks a lot for the help! This is working great.