Optional Inputs


#1

Hi, new user, first time posting.

During my character creation process I have the required input of the character’s name and an input for a nickname.
I would like to make the nickname optional, ie if the player just presses enter/next the nickname will default to the full character name, but choice script seems to always demand an input.

Is there a way around this other then a prior choice where they pick if they want a nickname or not?

Cheers


#2

Not really, no. *input_text needs something even if just a single character, so the only way to achieve what you want there is to make it optional for the player to decide in advance.


#3

You could probably combine it into a choice with the surname.

*choice surname nickname
__#surname1
____#nickname
______*input_text surname
______*input_text nickname
______*goto next_scene
____#no nickname
______*input_text surname
______*goto next_scene
__surname2
____#nickname
______*input_text surname
______*input_text nickname
______*goto next_scene
____#no nickname
______*input_text surname
______*goto next_scene

Something like that could work.


#4

I would approach it a little differently

And how shall we address you?
*input_text surname
And you you have a nick name you care to go by?
*choice
  #Yes
   *input_text nickname
   *goto next
  #No
   *goto next
*label next
*if (nickname="")
  Surname: ${surname}
  *finish
*else
  Surname: ${surname}
  *line_break
  Nick  Name: ${nickname}
  *finish

Just my thoughts on the matter

*Edit For fun I wanted to see how to add a bit more to it without it being to complex so I have:

And how shall we address you?
*input_text firstname
Do have a middle initial?
*choice
  #Yes
    *input_text middle
    *goto step
  #No
    *goto step
  
*label step
We do require you last name please
*input_text lastname
*if (middle="")
  *set fullname firstname
  *set fullname (firstname& " ")&lastname
  *goto step1
*else
  *set fullname firstname
  *set fullname (firstname& " ")&middle
  *temp name ""
  *set name fullname
  *set fullname (name& " ")&lastname
  *goto step1

*label step1
And do you have a nick name you care to go by?
*choice
  #Yes
   *input_text nickname
   *goto next2
  #No
   *goto next2
 
*label next2
*if (nickname="")
  First name: $!{fullname}
  *finish
*else
  First name: $!{fullname}
  *line_break
  Nick  name: $!{nickname}
  *finish

#5

Thank you all for your input. It’s very useful to know the limitations and I can’t get enough of the examples and sample code!

The community seems great here, thanks again for your time.