Page 1 of 1

[HOWTO] How To: Hide Continue Button Until Typed/End

Posted: Sat Mar 28, 2020 6:48 pm
by Tony Li
This article describes two techniques to hide the continue button until the typewriter effect has finished.

First Method:
This method uses the typewriter effect's UnityEvents. Configure the typewriter effect's OnCharacter() event to disable the continue button GameObject and configure OnEnd() to enable the continue button GameObject:

activateContinueButtonOnEnd.png
activateContinueButtonOnEnd.png (95.31 KiB) Viewed 715 times

Second Method:
This method uses a sequence that listens for the special sequencer message "Typed" that the typewriter sends when it's done.

To hide the continue button until the {{end}} duration is reached (see Cutscene Sequences Tutorials), use these sequencer commands:

Code: Select all

SetContinueMode(false);
SetContinueMode(original)@{{end}}
To hide the continue button until the typewriter effect is done, use these sequencer commands:

Code: Select all

SetContinueMode(false);
SetContinueMode(original)@Message(Typed)
The 'original' keyword tells SetContinueMode() to restore the original continue button mode. This allows it to remember whether the continue button should be shown or not. If you always want to show the continue button at the end, you can use 'true' instead:

Code: Select all

SetContinueMode(false);
SetContinueMode(true)@Message(Typed)

Re: How To: Hide Continue Button Until Typed/End

Posted: Sun Mar 29, 2020 9:16 am
by Tony Li
Here are some screenshots.

First make sure continue button mode is enabled:

Image

(Technically you don't have to do this if you use SetContinueMode(true), since this will force continue button mode to Always.)

Then set the Default Sequence:

Image

If any nodes have their own Sequence commands, include {{default}} so the Sequence also includes the Dialogue Manager's Default Sequence:

Image

Re: How To: Hide Continue Button Until Typed/End

Posted: Mon Apr 13, 2020 3:59 pm
by undecode
Hi, thanks for this. I was trying to implement something similar and this pointed me in the correct path.

Now I have another issue. I want to show the continue button (only the image) if the type effect ended, but make the continue button always active. So when you want to skip the type effect you just press anywhere (I have the actual continue button under a bigger image that covers the whole screen, working like a mask) and it reaches the end. At that moment, the continue image appears and you press again to continue with the conversation.

Is there any way to achieve this?

Thanks!

Re: How To: Hide Continue Button Until Typed/End

Posted: Mon Apr 13, 2020 4:02 pm
by Tony Li
Hi,

In that case, instead of using the SetContinueMode() sequencer command, inspect the typewriter effect itself. Assign the continue button image to the typewriter's OnBegin() and OnEnd() events. Configure OnBegin() to set the image's color - alpha to zero. Configure OnEnd() to set it back to one.

Re: How To: Hide Continue Button Until Typed/End

Posted: Tue Apr 14, 2020 12:30 am
by undecode
The typewritter effect is exactly what I needed.
I ended up using Image.enabled, but alpha should do the trick as well (I just didn't find it ).

Thanks for the quick response!

Re: How To: Hide Continue Button Until Typed/End

Posted: Tue Apr 14, 2020 8:53 am
by Tony Li
Glad to help!