How to stop Continue if waiting for input?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

How to stop Continue if waiting for input?

Post by LilGames »

Hi. We set up our dialogue template to use full-screen click/tap to continue through a conversation (I don't remember which method we used... it's been a while since we did it). Anyways, one of our conversations requests input from the user to get their name. Unfortunately, if the user taps anywhere on the screen, they just skip ahead this name entry. Before I go digging and altering code, is there already a parameter/condition I might be overlooking that would take care of this? (eg: no continue if waiting for text input)

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

Re: How to stop Continue if waiting for input?

Post by Tony Li »

You could make a subclass of SequencerCommandTextInput to do that, or you could just use the SetContinueMode() sequencer command. Example:
  • Dialogue Text: "What's your name?"
  • Sequence

    Code: Select all

    SetContinueMode(false); 
    TextInput(Text Field UI, Name:, playerName)
  • Dialogue Text: "Nice to meet you, [var=playerName]!"
  • Sequence:

    Code: Select all

    SetContinueMode(true)
Side note: If you're asking the player to input their name, you might want to check that the input is valid. See: How To: Read Input From Player During Conversations
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: How to stop Continue if waiting for input?

Post by LilGames »

So it turns out we already have that code in our conversation node and testing now it seems to not continue, so I'll have to go back and ensure this isn't just "user error" (maybe they are tapping the enter button).
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to stop Continue if waiting for input?

Post by Tony Li »

The enter button should accept the text input and cause the TextInput() sequencer command to finish. On your Text Field UI, check the Standard UI Input Field's Accept Key and Accept Button.
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: How to stop Continue if waiting for input?

Post by LilGames »

OK so something is up when playing on Android. Could Dialogue System or it could be a small mod we made to a button that covers the whole screen. Clicking anywhere confirms the text entry. Come to think of it, maybe that's the Android OS sending an "Enter" event from its entry keyboard. HMMM!

I guess players who tap fast impatiently will just have to suffer with the default name. :) :D
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to stop Continue if waiting for input?

Post by Tony Li »

What if you were to set the default to a blank string and use the check in the link above to loop back if it's blank?
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: How to stop Continue if waiting for input?

Post by LilGames »

Ohhh! it never occurred to me to loop back to the entry node.
Post Reply