• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

[Essentials Tutorial] How to create a password system with out adding scripts.

pokemonmasteraaron

The blind Pokémon Master!
323
Posts
13
Years
This tutorial is for Pokémon Essentials RMXP.
There is atleast one script equivilant to this tutorial.
Don't want to add or modify scripts?
Want to have a password system like Pokémon Rumble, and so many more?
Read on!
This isn't the best way, but it is the simplest way, and it is very powerful.
This will be using event commands.
I recommend doing this in a common event if you are going to have multiple places in your game where you can enter passwords.
Now, let's begin.
First, for safety, insert a control variables 001 operation is set. set it to zero.
Next, you are going to insert a show text command.
You need to expand it.
Use Extendtext.exe (it comes with essentials).
Now, copy & paste this in the show text box.
Please enter a password?\ch[1,9,1,2,3,4,5,6,7,8,9,0]
What we're doing is showing them ten options.
0-9.
So, next we need to define conditional branches which contents will be activated when the player hits an option.
Conditional branch: variable 001 is equal to 0.
Conditional branch: variable 001 is equal to 1.
Conditional branch: variable 001 is equal to 2.
Conditional branch: variable 001 is equal to 3.
etc.
etc.
Note that conditional branch: variable 001 is equal to 0 will be activated when the player hits one.
conditional branch: variable 001 is equal to 1, is activated when the player hits two, etc.
So when you have all of this set up, your going to want to copy it all.
Paste it in another common event.
Edit the show text to say something like:
next?\ch[1,9,1,2,3,4,5,6,7,8,9,0]
(remember to extend it again.)
Now cut this from the common event event and paste it at the end of our old common event, nine times, or however many numbers a password will be.
Great, we're done setting up the base.
Now, for the actual password setup.
Make a new variable and call it something like "Master ball code."
Now, at the beginning of the event, where you have control variables 001 set to 0, put a variables 060 (or whatever) master ball code set to 0.
This is to prevent people from entering parts of the correct code over and over until they actually get it (with out actually entering the code).
Now, let's open notepad or whatever.
Anything that can write text, I suppose.
Write your password.
Just make it up.
5999810293
Now, save this document as mypassword.txt or something so you can test out your code.
Starting at the beginning, find a conditional branch that is variable 060 is equal to (one less number than what they have to press).
Than, put a control variables 060 operation plus one
Example
I'm going to find conditional branch: variables 060 is equal to 4 and place control variables 060 plus 1.
Than, I'm going to navigate to the next text and find conditional branch: variables 060 is equal to eight and place control variables 060 plus 1.
Make sure to not place to of the variables on the same set of choices.
What I mean is, make sure to navigate to the next list before placing another control variables.
If so, for example, the player could hit both 5 and nine and get it right, but since we only have ten numbers, the password would be impossible to enter!
Now, at the very end of the event, we are going to place a conditional branch if variables 060 is equal to ten.
If true, put another conditional branch which checks to see if they have already obtained the prise.
Conditional branch: Switch 050 is off, than give them the prise.
In this example, you would give them a master ball
Conditional branch script: Kernel.pbReceiveItem(PBItems::MASTERBALL)
control switches: 050 operation on.
If the switch is on, which would be the false section, put a message like this
text: You have already obtained this prise.
It was a Masterball.
Insert an Exit event processing after the text (this is important!)
In the false for the conditional branch: variables 060 is equal to ten, put nothing at all (also very important!
Do this over and over until you have all the passwords you want.
Note that you don't have to redo the base for every password!
Note the base is the ten choices.
Infact, don't redo them for every password, it wouldn't work.
At the very end of the event, you need to do something like this
play se: buzzer 100 100
text: You have entered an incorrect password!
Questions:
q: Why don't we just put this in the false section of the conditional branch: variables 060 is equal to ten?
a: because if you are going to have multiple passwords, this message would keep desplaying over and over.
Q: Why did we need an exit event processing if the switch was on?
a: Because otherwise, it would look like this to the player
You have already obtained this prise.
It was a Masterball.
You have entered an incorrect password!
Now, does this make sense?
Comments are appreciated!
If you didn't understand something, please tell me so you can use this tutorial to your best advantage.
There is one more section of this thread.
Remember how I said "This isn't the best way, but it is the simplest way, and it is very powerful."?
Why is it not the best way?
One reason, and one reason only.
It's not a normal textbox the player types in, there making choices.
Therefore, you can't backspace!
You have to just finish the code and try again.
If you press X to backup, it will most likely type a nine.
I don't know any way to help you with that.
 
Back
Top