RPG Maker VX Tutorial: Switches
In this article, we'll learn how to use Switches in RPG Maker VX.
Step 1 - RPG Maker VX Tutorial: Switches
First of all, let’s create a chest with 10 gold coins in it.
In order to do this, press F6 on your keyboard to go to the Event submenu.
Once this is done, go ahead and create an event somewhere on your map, doesn’t matter where.
You will be prompted to “New Event ID001" menu:
Click on the right, in the list of Event commands and press Enter to add a command. This will take you to yet another menu where you will choose the actual event.
Step 2 - RPG Maker VX Tutorial: Switches
Now, before actually adding the object to the player’s inventory, you first need to tell the player what he’s getting otherwise he won’t know what was in the chest!
This is very simple however, just select “Show Text" in the Event Commands menu, type in your message and then click “Ok". It’s as simple as that.
Once you’re done, add yet another command.
Step 3 - RPG Maker VX Tutorial: Switches
This will take you back to the Event Commands window. Go ahead and choose “Change Gold" and increase it by 10, just like this:
On you’re done, click “OK" and it will bring you back to the Event window.
Step 4 - RPG Maker VX Tutorial: Switches
Your “List of Event Commands" should now look like this:
What you need to do now is to select some graphic to represent the chest otherwise the player won’t even know it’s there. Click on the “Graphic" box, select !Chest, pick a chest of your liking and click “Ok".
If you left the event that way, the player could repeatedly search the chest for 10 GP until he became a millionaire! We thus need to find a way to get the content of the chest only once.
This is when we’ll actually start messing with the switches.
Let’s add yet another command under “Gold +10" line. Click on Control Switches (under “Game Progression"), click right next to 0001: and go ahead and name your switch. Write a description which represents precisely what the switch is related to. Then click “Ok".
Click on “New Event Page" at the very top:
This will bring you to a new blank, Event Page.
On that page, look on the left hand side. You’ll see the “Conditions" box. Tick the switch box and then add in what you’d like to appear once the chest has been opened:
In Game Result
If you go ahead and test your game, you’ll find that everything is working perfectly!
More Advanced Functions
Now that you have figured out the basics of using switches, let's create a ''Fetch Quest''. A ''Fetch Quest'' is when the hero must bring back an object to some other character. Enjoy!
A Fetch Quest
In this article, we’ll explore more interesting ways to use switches as well as create some new items along the way.
Most RPG players are very familiar with the various quests heroes will undergo during the game. One of the most common quests is the “fetch quest" where the hero must find an object and bring it back to someone (or something).
NOTE: I've put all images in this tutorial in a .pdf file. This is because the images in articles often appear very, very small. You can download the file here.
Let’s imagine that some old man is looking for a (magic?) candle for some reason or another.
First of all, create your old man. Seize the opportunity to practice using switches just like we did last time. Try to have the old man say different dialogues the first and second you talk to him like so:
By now, you should have a pretty good idea as to how to this, but in case you’re still confused, here’s the solution:
In order for the candle to come into play, we need to add it to the database first.
Press F9 and head to the item section. Click on change maximum and set it to a higher number, 25 will do. Type in the name of the item( in this case “candle") as well as a short description (“a candle").
Once you’re done, click “OK" and you’re out of there.
Now, let’s imagine the candle is not in a chest but inside a bush (it could happen…). Go ahead and create some bushes and choose one of them which will have the candle concealed in it.
Just use one of the bushes and create an event on top of it.
As usual, add in some text first (something like “You’ve found a candle!" will do).
To add the item to the inventory of the player is very simple since it’s very similar to adding gold (which we covered in the last tutorial). Add a command under your text command line. In the Party box, click on “Change Item". This will take you to yet another box where you will select the candle (it should be the item #21). Set the constant to one (it should already be at one). Here’s a picture to guide you along the way.
Now of course you want to make sure that the player will only get the candle once. As we’ve already covered this in the previous tutorial, I won’t go into greater detail about this. If you’re confused, just read the previous tutorial.
Before you move on to the next and final step, you need to add one more switch to this event. You need to tell the game that the player now has the candle in his possession otherwise the old man won’t react to it.
On your first page of Event, create another switch (this should be switch #4) and call it “Candle Found". Now the game will take into account that the player has found the candle.
If you’ve done everything correctly, the player should now have a candle in his possession.
Now here comes the (kind of) tricky part, handing the candle to the old man.
Click on your old man event and add another Event Page (page 3).
This time around, have the “Candle Found" switch has a condition. Type in some text, something like “You’ve found my candle!" and remove the candle from the player inventory. In order to do this, all you need to do is to create a new command but choose “decrease" instead of increase in the item box.
Once again, you need to make sure this doesn’t loop so go ahead and create one final switch with some new text (just like you did last time).
This should be your final result:
Testing it Out!
Launch your game and talk to the old man. Go and get the candle (look in your inventory to make sure you have it) and bring the candle to the old man.
Congratulations, you’ve done it!