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

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

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

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

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

Post 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
undecode
Posts: 25
Joined: Mon Apr 13, 2020 3:53 pm

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

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

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

Post 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.
undecode
Posts: 25
Joined: Mon Apr 13, 2020 3:53 pm

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

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

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

Post by Tony Li »

Glad to help!
Post Reply