RPG Maker
 

 Username:
 Password:
   Not a member? Register!

Home > Tutorials > RPG Maker VX > Locked Door Eventing

Locked Door Eventing


Simple Locked Door

For my first tutorial, I am going to show you how to create a simple locked door that can be opened by a key or lockpick. The level of this tutorial is beginner, and requires no scripting knowledge.

The first thing you want to do is to create two items; the key that will be used to open the door, and the lockpick that will be used to attempt to unlock the door in the event that the player has not got the key.

Here’s what each item should look like in the database:

*I made a mistake in the Database entry for Lockpick. Consumable should be set to "No".*

picture picture

Once that is done, you need to create ways for the player to access these items. In my example, I simply put each one in a separate treasure chest (using the Quick Event Creation option):

picture

The treasure chest on the left gives the player the key, and the one on the right gives the player the lockpick.

Now for the locked door event.

Create a door event on the map, and choose an appropriate door graphic. Make three event pages. Leave page 1 alone for now. For pages 2 and 3, they should look like this:

picture

picture

That’s just basic door animation stuff.

Okay, switch back to page 1, which should be blank. This is what the left section of the event should look like:

picture

We want the locked door to check whether the key is in the player’s inventory, and then take an action depending on this. Do this through a conditional branch:

picture

picture

Then, add a message saying that your key unlocked the door, and then turn self-switch A on. This hands control over to the door animation thing that we set up earlier:

picture

The next thing we want to do is tell the event what to do if the key is NOT in the player’s inventory. That’s what the “else” thing is for.

Now, when the door can’t find the key in the player’s inventory, we want to look for ANOTHER thing; whether the lockpick is in the player’s inventory. To do this, make another conditional branch under the “else” ' this time, make it check for a lockpick.

picture

Under the conditional branch for the lockpick, make the game ask you a question on whether or not you want to pick the lock. (Obviously, the choices are yes and no)

Under yes, first make a command that creates a random number between 0 and 5 (you can choose other numbers to adjust the odds).

picture

picture

Now, we make yet ANOTHER conditional branch; this time, it checks what number the randomizer spat out. If the number is 1, then have the lockpick be a success; if it’s another number, have the lockpick fail.

picture

picture

Under this conditional branch, write a message saying that the lockpick was a success, and turn self-switch A on. Under the else, just write “lockpick failed”.
Under the “no” choice, no need to write anything. Just leave it blank.

Finally, under the final “else” (which would happen if the player didn’t have the key OR the lockpick) just write a message saying, “the door is locked”.

Here’s what the entire first page should look like when you’re finished:

picture

And that’s it! You’re done! Try messing around with the variables, or try adding different types of lockpicks! For example, a master lockpick might have a 1 in 2 chance of being a success, while an apprentice lockpick only has a 1 in 8 chance. I strongly encourage you to mess around with it yourself!

One more thing. The way I have set it up means that the door stays unlocked whenever you unlock it

DEMO:
http://south.wall.cornerclub.googlepages.com/LockedDoor.rar 
Details
Tutorial: Locked Door Eventing
Date Listed: 2008-07-03
Author: SouthWall
Total Hits: 207


Embed
Short URL:

HTML:

BB Code:



RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the Terms of Use.
©2004 - 2008 RPG RPG Revolution, All Rights Reserved. Contact Us · Privacy Policy · Legal Disclaimer
eXTReMe Tracker