So, you’re making your amazing game in RPG Maker and you decide it would be a cool idea to make the player input a password to open a door, or a box, or to make something cool happen. But you’ve searched through all the available functions in the engine and none of them seem to be designed for that. So what now? Fear not. As we have been learning throughout this tutorial series, there is a very cool workaround for that, and I’m going to teach you how to do it.
Disclaimer: I am using the MV version of RPG Maker, so although the logic is very similar in all versions, I’m not sure if this tutorial will work the same way for VX, VX Ace or XP. This tutorial is probably more useful to devs that are already familiar with how RPG Maker works, but if you still consider yourself a beginner regarding this engine, I’ll try to be as clear as I can so you don’t feel lost.
This is my test project, and what we are going to try to do here is to type a password on the computer and, if the password is correct, the door will be unlocked. Let’s begin!



Once you select it, go under Actor and select that blank actor you created. Under Max characters, select the max number of characters your password must have. For example, if your password is “9734”, the max number of characters will be 4; if your password is “castle”, the max number of characters will be 6, and so forth. Then, press “OK” to close the window.

if ($gameActors.actor(actor number).name() == "your password")
{
$gameSwitches.setValue(switch number, true);
}
Actor number: If you’ve paid attention before, you saw that every character we create has a number in front of their names. In the case of our blank character, there’s only the number, and that’s the number we have to put there. My blank character’s number is “0002”, so the number I’ll be putting there is “2”.
Your password: Type here the password you want the player to use, text or numbers (although if you want to use just numbers, the Input Number command is a better and easier option). The password I’m choosing for my project is “Murray”.
Switch number: Just like the actors, switches have numbers attached to them. We need to create a switch to check if the door is locked or unlocked, and that’s what we will be doing in the next step. In my project, I don’t have any switches yet; the switch I’ll create here will be the first one (0001), so I’ll put the number “1” there.
This script is going to turn on a switch if the password is correct. The same switch that is going to unlock the door. My script is looking like this:

Now press “OK” to close it.
5 The next command will be the Conditional Branch command. Select it in the Event Commands window. Then select the Switch option and create a switch called “doorUnlocked”. On the bottom of the window, check the “Create Else Branch” box. It should be looking like this:

Right below this command, create a Control Self Switch command and press “OK” right away. You probably don’t need to make any changes to it.

Now create another Show Text command under the else statement, and type “Nothing happened” in the text box.
Then, right below it, you will want to add the Change Name command. Under Actor select our blank character and then under Name don’t type anything at all; leave it empty and click “OK”.

This command will erase the player’s previous attempt, in case they input the wrong password. If you don’t add this command, the previous attempt will continue on the screen, and the player won’t be able to try again.
The first page of your Password Input event should be looking like this:


On this new page, we create another Show Text command and type “There’s nothing to do here anymore” in it and click “OK”. Now, we can press “Apply” and close the event window.
And don’t forget to place this event on the spot of the map that the character is going to interact with to type the password. In my case, the event is placed upon the computer sprite, since I want the player to type the password after interacting with the computer.
Now go to the second page, and the only thing you need to do there is to check the Switch box and select the “doorUnlocked” switch.
Your door event pages should be looking like this:
And just like that, we’re done! I hope I could help you in any way, and if you have any questions, come talk to me on Twitter, I’d love to help you out! See you later!
Did you enjoy this article? Then consider buying me a coffee! Your support will help me cover site expenses and pay writers to create new blog content.