Don't show continue button until typewriter effect ends

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ronia13
Posts: 1
Joined: Sat Aug 27, 2022 3:14 pm

Don't show continue button until typewriter effect ends

Post by Ronia13 »

Hi!

I'm making a dialogue with a typewritter, a continue button and responses after NPC text. I would like to use the continue button but I don't want the player to be able to skip the typewriter effect.
I have been looking througt the forum but can't find any solution. I tried to activate and deactivate button's GameObject in typewritter OnBegin and OnEnd events but doesn't work.

Also if it's posible, I would like to revert this behaviour. I want the player to be able to skip the typewritter effect after the first run.

Thanks in advance
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Don't show continue button until typewriter effect ends

Post by Tony Li »

Hi,

Use the typewriter's OnCharacter() event to deactivate the continue button. Still use OnEnd() to reactivate it.
Ronia13 wrote: Sun Aug 28, 2022 4:50 pmAlso if it's possible, I would like to revert this behaviour. I want the player to be able to skip the typewritter effect after the first run.
That's a little complicated. The Dialogue System has a feature called SimStatus that keeps track of whether each dialogue entry node has been displayed or not. But it sets SimStatus to "WasDisplayed" just before showing the text. So you can't hook into the text-showing method to decide whether or not to show the continue button.

You could implement some kind of parallel system.

Alternatively, it might be simpler to allow skipping if the conversation has been played before. See this post for an example of how to know whether a conversation has played before. You can write a script that checks of the conversation has played before. If so, add events to the typewriter's OnCharacter() and OnEnd() UnityEvents; if not, clear those UnityEvents.
Post Reply