Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Eventing]Simple Locked Door + Simple Lockpicking (RMVX), Comes with Game Demo!!
SouthWall
post Jul 2 2008, 10:16 PM
Post #1


Level 7
Group Icon

Group: Member
Posts: 97
Type: Event Designer
RM Skill: Skilled




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. It'll also help you understand switches and conditional branches.

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".



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):



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:





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:



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:





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:



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.



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).





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.

*if you want, you can make it so you "break" the lockpick if you fail. Simply add a command under "else" removing 1 lockpick from the player's inventory*





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:



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.

GAME DEMO


Questions, comments? Reply here.

This post has been edited by SouthWall: Jul 22 2008, 10:53 PM


__________________________
Go to the top of the page
 
+Quote Post
   
SouthWall
post Jul 13 2008, 04:24 AM
Post #2


Level 7
Group Icon

Group: Member
Posts: 97
Type: Event Designer
RM Skill: Skilled




Questions, comments? Anything I need to improve?


__________________________
Go to the top of the page
 
+Quote Post
   
-konakona-
post Jul 13 2008, 04:29 AM
Post #3


Level 8
Group Icon

Group: Revolutionary
Posts: 130
Type: Artist
RM Skill: Skilled




nice tutorial, I'll definitely use it!


__________________________

Go to the top of the page
 
+Quote Post
   
bleachx
post Jul 13 2008, 05:59 AM
Post #4


Level 4
Group Icon

Group: Member
Posts: 50
Type: None
RM Skill: Skilled




Good tutorial , i didn't know these at all...
Go to the top of the page
 
+Quote Post
   
SouthWall
post Jul 19 2008, 11:14 PM
Post #5


Level 7
Group Icon

Group: Member
Posts: 97
Type: Event Designer
RM Skill: Skilled




Thanks guys! I'll try to make another one relating to variables soon.


__________________________
Go to the top of the page
 
+Quote Post
   
m0nsterb0y
post Jul 21 2008, 01:53 PM
Post #6


Level Higher than Yours
Group Icon

Group: Revolutionary
Posts: 140
Type: Developer
RM Skill: Skilled




You see, that just totally explained conditional branches to me, and I wasn't even looking for that tut. Thanks tongue.gif


__________________________
PLEASE JOIN THE RRR COMMUNITY GAME PROJECT!

HELP CREATE A GREAT MINIGAME COLLECTION!


[Show/Hide] Epilepsy ala Darth Leper:
Go to the top of the page
 
+Quote Post
   
SouthWall
post Jul 21 2008, 11:52 PM
Post #7


Level 7
Group Icon

Group: Member
Posts: 97
Type: Event Designer
RM Skill: Skilled




QUOTE (m0nsterb0y @ Jul 22 2008, 07:15 AM) *
You see, that just totally explained conditional branches to me, and I wasn't even looking for that tut. Thanks tongue.gif


Cool! I edited the opening to my tutorial so it says that it involves switches and conditional branches. Thanks for the feedback!


__________________________
Go to the top of the page
 
+Quote Post
   
Paper
post Jul 22 2008, 09:00 PM
Post #8


Level 3
Group Icon

Group: Member
Posts: 38
Type: Event Designer
RM Skill: Beginner




lol this is such a simple feature to do but you explained it very well XD Good job for your first tutorial!


__________________________
Go to the top of the page
 
+Quote Post
   
SouthWall
post Jul 22 2008, 10:56 PM
Post #9


Level 7
Group Icon

Group: Member
Posts: 97
Type: Event Designer
RM Skill: Skilled




QUOTE (Paper @ Jul 23 2008, 02:22 PM) *
lol this is such a simple feature to do but you explained it very well XD Good job for your first tutorial!


Thanks! I'm still learning. It just goes to show that eventing is a very powerful tool, eh?


__________________________
Go to the top of the page
 
+Quote Post
   
Ninjuit
post Jul 23 2008, 04:31 PM
Post #10


Just your friendly neighborhood Ninjuit.
Group Icon

Group: +Gold Member
Posts: 1,456
Type: Artist
RM Skill: Beginner




LMAO! I was thinking of doing this. And you just reminded me!!!! Nice tutorial by the way!!!


__________________________

Logo by the one and only Darkling05.
Come on over to http://project-cas.blogspot.com where my dreams are your desire :D

Go to the top of the page
 
+Quote Post
   
SouthWall
post Jul 25 2008, 06:53 PM
Post #11


Level 7
Group Icon

Group: Member
Posts: 97
Type: Event Designer
RM Skill: Skilled




QUOTE (ninjuit @ Jul 24 2008, 09:53 AM) *
LMAO! I was thinking of doing this. And you just reminded me!!!! Nice tutorial by the way!!!


Thanks. The other tutorials might not come for a while, as I'll be busy with studies.


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th May 2013 - 10:27 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker