Okay so what I mean is, in the beginning of the game the player typed in 56454, and later on the game asks for that number to do something, by way of *input_text. I’m really not sure how to go about it and ultimately it’s not super important but I would like some help trying to figure it out.
First, you have to have one variable, either:
*create playerinput ""
in startup.txt or you can have a *temp variable in whatever scene file you are using.
Next:
What is the number?
*input_text playerinput
*if (playerinput="56454")
*goto nextscene
*else
*goto thatotherscene
If the number is set by the player before you need these:
*create playerinput ""
*create playerinput1 ""
then when the check comes:
*input_text playerinput1
*if (playerinput1 = playerinput)
*goto correctnext
*else
*goto wrongnext
EDIT: if you want to give the player multiple, but limited tries, you can make a *temp at the start of the scenefile:
*temp attempts 0
and then:
*label inputthing
*input_text playerinput1
*if (playerinput1 = playerinput)
*goto correctnext
*else
*set attempts +1
*goto wrongnext
*label wrongnext
*if (attempts <3)
This is not correct. Try again.
*goto inputthing
*else
This is not correct. No further attempts possible.
*goto fail
Great solution! Just wanted to add a few refinements that might help make this even more robust:
For case sensitivity issues, you might want to add a lowercase conversion to handle user input variations:
*input_text playerinput1
*set playerinput1 (lowercase(playerinput1))
*if (playerinput1 = playerinput)
Also, if dealing with numeric inputs like your “56454” example, consider using *input_number instead of *input_text for better validation:
*create playerpassword 0
*input_number playerpassword 0 99999
This prevents players from entering non-numeric characters and gives you automatic range validation.
One more enhancement for the multiple attempts system - you could add some variety to the error messages:
*label wrongnext
*if (attempts = 1)
Not quite right. Try again.
*elseif (attempts = 2)
Still incorrect. One more chance.
*else
Sorry, no more attempts allowed.
*goto fail
This makes the experience feel less repetitive for players who struggle with the input. Thanks for sharing the core logic we will be using it on our text generator soon - really helpful for beginners working with player input validation!
