Site News
• Basic Tutorials •
The Database
Graphic Resources
• More Advanced Tutorials •
The Database
Event Systems
• RGSS •
Script Fixes
Script Systems
• Other •
Using RMXP
Mini Tutorials
• Reference •

In this tutorial you will learn...

• How to make a system where you can read paper from an item…
• …Using common events

Hi, and welcome to my Maps, Lists and Paper tutorial! In this tutorial, I will be showing you how to make an item that, when used, shows a piece of paper or a picture, and when you press enter or Esc, it disappears. This may not sound like much, but it is quite handy, and it took me a long time to figure out how to do!

So, what will we need for this tutorial?
ê An item
ê Three common events
ê Two switches
ê A variable

Okay? Let's get going! Find yourself somewhere spacious to work (I.e. a nice blank map) and go into the Database by selecting it from the Tools menu or pressing F9 on your keyboard. Head over to the Items tab, and create a new item called Map or something similar. Choose an icon, if you like, and then make sure that the consumable option is set to No (we don't want to be able to eat our map!), and then press okay; we'll be changing some more things here later. Your page should look like this:

Okay, now you need to get youself a picture that you would like to show when the item is selected from the menu. You could have a quick look on Google images, or you could make your own (which is what I have done). You can download this image, if you like (just click on the thumbnail):

One thing to bear in mind, however: the picture must fit on the screen (which is 640 pixels wide × 480 pixels high) otherwise you'll only see part of the picture. Now we need to import the picture. If you've read my Simple Importing tutorial then you'll be familiar with the process, but if you haven't I'll run through it anyway. Open the materialbase by selecting it from the Tools menu, or pressing F10. Select the pictures category from the left hand list, and then click import, navigating to where you have your picture saved. When you've found it, click open. The materialbase might not give you a preview screen because of the alpha transparency, but don't worry about that.

When we've done that, we need to go into the database and head over to the Common Events tab, where we are going to need three common events. I know that it sounds like a lot, but that's the result of not having pages within common events! Anyway, the first common event is going to be the event that runs when we select our Map item from the item menu. Call the event Paper Item or something similar. Because we're going to be calling this common event from the item, the trigger can stay blank. In the commands, all we're going to do is to turn a switch on, called Paper Show or something like that. This switch will lead to the page that shows our paper and blocks the menu, etc. Your page should look something like this…

Okay, now we need to make the paper appear. Get yourself another common event and in the trigger section, set it to autorun, with the condition switch being the switch that we've just turned on: Paper Show. Now, in this event we need to make the paper show, but we also need to make sure that the player cannot get to the menu whilst it is on the screen. So, the first command in this event is going to be a Disable Menu Access command, which we haven't used before. It is the penultimate item on the first page of event commands. When you click on that, you'll get this box…

This is really easy to use: obviously the enable option enables the menu access (default) and the disable option disallows the player to enter the menu. Bear in mind that there is no way for the player to access the menu if you use the disable command, so make sure that if you disable the menu for some reason, you enable it again when you're finished!

After that, I like to add in a sound effect for some realism. I chose the 046-Book02 sound effect; it sounds like someone flicking a bit of paper open. You don't have to do this, but I think it adds some interest! Next, we need to show the picture. If you've seen my Using Pictures tutorial then you'll be familiar with how to do this, but for those of you who haven't read that yet, we need to insert a Show Picture command, which is on the second page of event commands, at the very top of the second column. When you click on that, you'll get this box:

This allows us to set some options for how we would like to show the picture. As for the number, if you're not using any other pictures, you can leave this as 1, but if you're using other things and you want the map picture to be on top, you need to set the number to something higher. All the other settings we can leave the same for now.

When we've shown the picture, we need to insert a command turning OFF the Paper Show switch to stop the autorun running again, and then add in another command turning another switch ON, called Button Check. Okay? Your second common event page should look like this…

Right. Now we've done that, we need to go to another common event, and set the trigger to autorun again, and the condition switch to Button Check being on. Now, this page will be the check that sees whether the player presses the Esc or the Enter button at all, and if they do, cancel the paper and exit the event processing, taking us back to the beginning when the item is used. So, on this page, we need to have an Input Button Processing command. This command is located on the first page of event commands; the fifth button down. When you click on it, you'll get this…

This command is used to check which button the player has pressed or is pressing. The variable that you can select is the variable that will store the number of the button that is pressed, so you can use it with conditional branches later on (which is what we will be doing). Usually, we would use this in a parallel situation, so that the input is checked and until something happens, the game functions as normal. However, with this system, we want the player not to be able to move while the paper is showing and while the button is being checked, so we can use an autorun setting within the common event and this will lock the player in place. Handy, huh?

So, we need to choose a variable for our button code. Create a new one and call it Button Code or something, and then press OK. After we've done this, we need to put in some commands that check whether the button code is equal to either the code for Escape or Enter, and if it is, cancel the piece of paper and stop the autorun event. So, we're going to insert a conditional branch, making sure that the checkbox at the bottom is unchecked, and insert the following: If variable Button Code is equal to 12, then do something. (In case you're wondering, 12 is the button code for button C, or Enter / Space). At the moment, your event page should look something like the following…

Now, what do we want to happen when the Enter key is pressed? Well, we want the paper to disappear - so, firstly, I like to add in a Play SE sound, playing the sound effect 003-System03, which is the sound effect played by the system when you cancel something. This adds a little realism to the system. After that, we need to erase the picture. The Erase Picture command is on the second page of event commands, fifth down in the second column. When you click on it, you'll get this…

This is where you need to have remembered the picture number! In our case, it's okay to leave it as 1. When we've inserted that command, we're almost done! We just need to re-enable the menu access - otherwise our player won't be able to access the menu! After that, we need to insert a command turning OFF the Paper Button Check switch. This will stop the autorun event and reset the system for the next time that we select the map item from the menu. Now your event should be looking like this…

Well done; we're nearly there! But hang on - didn't I say that we wanted to cancel the paper when we pressed Enter or Escape? If 12 is the button code for Enter, where is the button code for Escape? Well, we haven't quite finished - we just need to add something in quickly. Highlight the whole of your conditional branch by clicking on the blue line of event command where it says 'Conditional Branch', and copy the whole thing. Then, click below where it says 'Branch End', and paste the branch in there. Now, we just need to change one thing. Can you guess what it is? Yup - the value for the Button Code. So, right click on the command and select or Edit, or press the space bar whilst it is highlighted. In the value box for the variable, change the value to 13, which is - yup, the value for the Escape key. Press OK, and you should have an exact duplicate of the branch above, but with a different value for the Button Code variable. Your page should be looking like the following…

Okay. Just before we test out our system, there's one last thing that we need to do. Remember at the beginning I said that we would be changing something on the item page of our map? Well, head back over to the items tab on the database and select the map. You see where it says 'Common Event'? In this drop down, we need to select our first common event: Paper Item. Okay? It should look like this…

Right, that's it; we're ready to test out our system! We'll need a placeholder event to change our items to include a map. In case you don't know how to do this, the Change Items command is on the first page of event commands, sixth down in the second column. When you click on it, you'll get the following…

The item is obviously which item we want to change, and in our case, we'll need to select our map item here. The operand states whether we are increasing or decreasing the item, and we obviously want to increase it. The number below is how many we want to increase or decrease the item by. You can put as many as you like in here, but 1 will suffice!

After that, your system should be working a treat! Well done on following so well. The next tutorial will be on making random battles only happeneing in certain places in a map.

:: << Previous Tutorial ::      :: Home ::      :: Next Tutorial >> ::

RPG Maker XP © 2005 Enterbrain Inc.           © 2004 Xiph. Org Foundation           Ruby © 1993 - 2003 Yukihiro Matsumoto
This site, including images and textual content, were created by and belong to me.
© 2006 - 2011 All rights reserved.

This website and tutorials have all been written in my free time (what there is of it!), and hosting can be rather costly, so any donations are very gratefully received - no matter how small - even if you can spare 50p I would be grateful!