• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] How can I make the player input text?

  • 4
    Posts
    3
    Years
    • He/Him
    • Seen Apr 7, 2023
    I'm trying to make the player input text and then make the game check if what the player entered was a specific value, a bit like a password, can someone help me with that?
     
    You should check here:
    https://essentialsdocs.fandom.com/wiki/Messages#Entering_text

    You can save the message as they say:
    message = pbMessageFreeText(_INTL("Please enter a message."),
    _INTL("Default message."),
    false, 256, Graphics.width)

    And then save it into a variable:
    pbSet(variable_number, message)

    Now, just use a conditional branch, and check if it matches.

    Thanks for the advice! But might I ask, how do I check for text instead of numbers? Sorry, I am kinda new at this!
     
    This is a text, the function pbMessageFreeText should let the player enter free text.
     
    Oh! I actually have two ways:
    1. Store the wanted text on another variable, another temporary one (or not, if you want to keep this text on a specific variable). On the conditional branch option, you can compare a variable to another one, so this is one way.

    2. Change the code we wrote earlier and use a temporary switch, for example, $game_switches[59] (or any other switch you can change). The next code lines should be:
    wanted_message = "Hello, I'm the wanted message"
    $game_switches[59] = (message == wanted_message)
    And then, of course, the conditional branch should check if the switch is on (true= the same) or not (false= not the same).
     
    Oh! I actually have two ways:
    1. Store the wanted text on another variable, another temporary one (or not, if you want to keep this text on a specific variable). On the conditional branch option, you can compare a variable to another one, so this is one way.

    2. Change the code we wrote earlier and use a temporary switch, for example, $game_switches[59] (or any other switch you can change). The next code lines should be:
    wanted_message = "Hello, I'm the wanted message"
    $game_switches[59] = (message == wanted_message)
    And then, of course, the conditional branch should check if the switch is on (true= the same) or not (false= not the same).

    Oh my god! Thank you so much, man! You're a lifesaver!
     
    Back
    Top