Tutorial 5: Combat

Mar 25, 2011 15:26


Originally published at How I Roll. Please leave any comments there.

In this tutorial, we look at the default RPG Maker XP combat system and how to work with it and tailor it to our game and character’s levels. We will fight the Wharf Rats from the previous tutorial and set up exactly how they should be treated (badly!). At the end of the combat, we will determine any treasure that is dropped and give the player a new skill. This should give you a good idea of how to perform a number of common battle-related actions all in one simple tutorial. Now let’s get started!

Tutorial Time: 10 minutes.

Experience Level: Beginner

Scripting Experience: Not applicable

Source files: Included with RPG Maker XP

The first thing that we must do is edit our player’s stats in the database a little bit. At the onset, the massive amounts of hit points might seem nice, but it will make leveling more difficult and rather annoying in the future. So, go up to the menu and select Tools and Database. Click on the Actors tab and double-click the MaxHP graph. We are going to reset all of the starting values for the main character. Set the values for level 1 as follows:

MaxHP: 20
MaxSP: 20
STR: 18
DEX: 18
AGI: 18
INT: 18

Click on the “Generate Curve” button and set the slider all the way to the left for faster progression. As you test the game, you will want to adjust the curve, but for our purposes, let’s keep it easy.

The next thing that we have to do is create an enemy type for our two hapless Wharf Rats. In the Database, select the Enemies tab. Change the maximum to 34.



Now, double-click on 33. Change the name to Roger. Double-click the Battler graphic box and select “044: Trader01?. Change his stats to represent the following image (don’t want him to start out too hard!). Also change his experience to 5 and gold to 8 (he’s holding out on his buddy).


We an keep the rest of the settings the same. These guys are not magic users. They are idiots on the wharf.

Now double-click 34. Set the name to Steve. Double-click the Battler graphic box and select “025: Cleric01?. Change his stats to represent the following image. Change the experience to 5 and the gold to 2.


Click Apply and OK.

The third step is to create a troop of these Wharf Rats. Troops are basically the way that enemies appear in combat. You can have single enemies or multiple enemies and using troops, you can tailor your game to specific types of battles (read: boss battles) or allow them to occur randomly. Click the Troops tab and change the maximum to 33. Double-click 33.

Set the Name to “Roger and Steve”. In the right-hand list, scroll down to Roger and double-click his name. He will appear in the center of the window. Move him to the left. Now double-click Steve and move him to the right. Now click the “[ED] Battleback…” button. Select “011-PortTown01? as the background.



Click “Battle Test” button. Click on the 2 tab and select the drop-down. Select “(None)”. Do the same for 3 and 4 since the main character does not have anyone with them yet. Click OK.

After a couple of rounds, you will win. This is what we want. You will also notice that you do not get any gold or experience yet. We will now include the loot that the player gets for winning the battle. We will take care of that once we take care of scripting this simple battle sequence.

Double-click the long cinematic event we created in the last tutorial and go down to the end. Double-click the “@>” after “Show Animation: Player, Venom”. On Page 3 of the events, click the “Battle Processing…” button. In the drop-down, select “033: Roger and Steve” and click “Continue even when loser”. Under the “If win…” section, double-click the “@>”. We are going to change their graphic to a “downed” graphic to show that they have lost the battle. Go to the second page of events and click “Set Move Route…” and select “Change graphic…” Select “189-Down01? from the list. Select the third image on the bottom row.



Now do the same thing with the second Wharf Rat, but choose “192-Down04? and the first graphic in the second row.



Now let’s give the player a shield, a sword, and 10 gold (one of them was holding out on the other!). Double-click the “@>” below what you just changed and click the “Change Gold…” event and change the constant value to 10. Click OK.

Now we need to do something if the player fails to win the fight. Luckily, we want to go easy on them (we don’t want them to stop playing the game because they died in the first battle). We’re just going to have Roger say:

Roger: Gaaar! You don’t have any money!

Then we will have them move off to the left of the docks. Double-click the “@>” below the “If lose” condition and create a Show Text event. Add in the text above and click OK. Now add a “Set Move Route” event for each of the Wharf Rats and move them. Turn Wharf Rat 1 to the left, Move left, Move Left, Move up three times and turn him to face left. Now, move Wharf Rat 2 to the left and then have him face right. This will put them up against the net and have them facing each other. Now let’s have them tell the player to bug off if they try to talk to them. Double-click Wharf Rat 1 and add a Show Text event.

Roger: Leave me alone!

Do the same for Wharf Rat 2.

Steve: Get out of here!

Unfortunately, after all this work, I see a problem. Run the game, beat the thugs, and then go and step on the place where the event triggers. Boom. If we step in the event space, it will trigger the event again. This is the kind of debugging that you will have to do constantly as you develop…only it will probably be a lot hairier! Let’s add a conditional statement to the event so that once we beat the Wharf Rats, it will not trigger again.

Double-click the cinematic event and click in the event command list pane. Press Control-A to select the entire script. Right-click and select Cut (Control-X). Double-click on the remaining “@>” and add a conditional Branch event. Select “Self Switch” and leave it on A. Set the next drop-down to “OFF”. All switches start in an OFF state. Once you trigger them, you can set them to an ON state and they will not happen a second time. This is what we need to do in this case (no need to have the Wharf Rats continuously fighting the main character).


Next, right-click on the “@>” just under the start of the branch and select Paste. This will paste the entire script into the branch. Now, go down to the bottom just past the color-coded combat event. Add a “Control Self Switch” event from Page 1. Set “A” to “ON”. This will make sure that we do not trigger the script a second time.


Run the game and test the combat. Right now, the weapon is doing some massive damage and they cannot hit you (your weapon and armor are extremely powerful). You can change the stats in the Database and even things out a bit. Playtest again and again until you get a feel for combat. Give the player a chance to lose, perhaps by upping their attack power to test the “If Lose” event.

This concludes this tutorial and provides a simple taste of the options available for simple combat. The documentation included with RPG Maker XP should be sufficient to explain the particulars of each option in the combat interface. Remember to use F1 for help.

gamedev, rpg maker

Previous post Next post
Up