Password in Events

Password in Events

Pokémon Essentials Version
v16.2 ➖
What's this?
In Pokèmon Black2 and White2 you're given several passwords at some point during the game, for you to introduce in order to open a door and progress through the game. We are going to do just that.

Related
Text input settings controlled by the player
Allowing the player to change text input (keyboard or classic), instead of having it hardcoded.

Show me the goods!
Not much to show here.


Alright, what do I do?
I have baked a very simple method, for you to place above Main, in a new script section if you please.

Code:
def passCheck(password,helptext="What's the password?",minlength=0,maxlength=8,casesensitive=false)
  code=pbEnterText(helptext,minlength,maxlength)
  if code==password || (casesensitive==false && code.downcase==password.downcase)
	return true
  else
	return false
  end
end

In order to use this, create a Conditional Branch inside an event, with a script as as a condition. Such script should be "passCheck("password")", where "password" is the password the player has to input and get right. The password is case-senstive. You can use aditional fields to modify the help message ("What's the password?", min. and max. length of password, and if it should be case-sensitive (true meaning it won't accept "leDyBa", false meaning it will accept "leDyBa", and false by default).
An example of the full conditional with the additional fields:
Code:
passCheck("Ledyba","What Pokémon am I thinking of?",0,8,false)

Example Event


Design Notes
You could do this at a control panel for a door, as it asks you for a code to open the door.

You could also do some sort of "Mystery Gift" with this if you don't want to use Essentials' system, and just hide the passwords from the players until you decide to release the magic words.

Be creative!
Credits

Please credit if used to:

Mr. Gela

Please do not redistribute this anywhere resource anywhere else. If you wish to share this, link to this site.


Por favor da créditos si lo utilizas a:
Mr. Gela

Por favor no redistribuyas este recurso en ningún otro lugar. Si quieres compartir esto, utiliza un enlace a este sitio.
Author
Mr. Gela
Views
177
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Mr. Gela

Top