RPG Maker Programming

From Charas Project

Programming in RPG Maker is what can make or break a game. While no one really knows how much trouble you have gone into, they appreciate the effects. Obviously, the most complex and exciting systems in RPG Maker take the longest to make and are the most tedious to make and test, however, the results are worth it. Here is a list of all of the programming commands in RPG Maker 2003 (the only difference from 2000 is that 2003 has a couple extra commands and some are slightly differently named) and descriptions of each.

Page 1:

1. Show Message- Needs very little explanation, it displays a message box. For all you people new to RPG Maker, it has no word wrap and the line limits are about 5/8-3/4 of the way across the line.

  • NOTES: -When you edit a message it will automatically add an extra line, so if you press enter, sometimes it won't let you go down to the last line.
              -There are tags that you can use in your messages, a full list of these are in the help file. A couple of the more common ones are \

[#] which displays the name of the character with the number of whatever you replace # with and \\v[#] which displays the value of a variable with the specified number.

2. Message Style- This allows you to edit the display options for the messages, such as transparency, location, and other properties.

3. Select Face- This will select a face graphic to display to the right or left of the messages. This does reduce how many characters you can have in your messages, so be careful. If it will be displayed on the right side you can choose to flip it horizontally to make it face the message correctly.

4. Show Choice- This presents a menu with up to four choices for the character to choose from. On the left side you name the choices, and on the right side, there is what is called the "Cancel Case." The numbers are which selection will be chosen if the player presses escape. It is a good idea to make your last choice "Cancel" but if you can't fit it, you should choose the "Add Case" button, which will create a separate set of events to occur should the player press escape.

  • NOTES: -Be careful where you put the commands for each case. They should go in the space directly under the case itself, not the entire command.

5. Input Number- This allows the player to enter in a number with a specified number of digits. This number is then stored in a variable which can be checked later. This can be used for passcodes on doors as well as many other things.

6. Change Switch- Switches are very powerful, and often, very overused, items in RPG Maker. Essentially they are off and on switches that can be set to control different things, such as keeping a chest opened so that a character can't get the same item twice. The options are Switch Name, and the state that you will set the switch to. On and Off are self-explanatory. The third option, "Toggle On/Off" is there to for things like levers. Basically, if the switch is on, it will turn it off, and if it is off, it will turn it on.

7. Change Variable- Variables are extremely useful components in games. They are stored numbers that can be manipulated. The reason these are so useful is because they can be used in messages, to show levels or money, or for positioning pictures. Here are the options:

-Choose Variable: This is the variable you will edit. "One" is to select the variable you want, range will allow you to do the same operation to a range of variables (such as from 1 to 20), and "Variabl" is to select the number of the variable to edit based on the number stored in another variable, while confusing, this has its merits. -Set: This is to select the operation that you will do on the variable. + and - are obvious, * is multiply, / is divide, and mod is short for modulus. It returns the remainder of the value in the variable divided by the specified value.

    *NOTE: RPG Maker does NOT support decimals. The MOD option can be used to keep track of remainders to prevent glitches that occur when the number should reach a whole number but is x amount of numbers away instead.

-Operand: This is where you specify the number. Set, is simply a set number. The two variables are for adding variables together. The first is to use the specified variable instead of a fixed number. The second is to add the value of the variable with the number given by the value stored in the variable that you specify (confusing, but if you experiment it should become clear). Random will "randomly" select a number between the two numbers specified (the word randomly is in quotes because a computer cannot select a truly random number and there is a chance that the same numbers will be selected each time you test it). Item lets you use the number of a specified item that are equipped or owned. Hero gives you the option to use different game related variables, such as exp, hp, mp, etc. Event gives you access to information relating to the different environmental variables on the map and some generic ones (hero, ship, etc). Map ID is the map that the event is on, x and y coordinates are the PIXEL coordinates of the event on the map, to get these to be the tile coordinates, divide the number by 16 (each tile is 16x16 pixels). Facing is the direction that the event is facing (1=down, 2=left, 3=right, 4=up), screen x and screen y give the coordinate on the screen of the event. The difference between these and the Map X and Y is that the map x and y is always changing when the event moves, the screen x and y coordinates don't if the event is moving the same direction and speed as the map is scrolling. The last option, OTHERS is pretty self explanatory with the exception of one: MIDI Ticks. This returns the position (in milliseconds) of the current song playing.

8. Timer Operations- This option is pretty simple. You simply Set, start or stop, either of the 2 timers. They can be set to exact times or variables.

9. Change Gold Held- Again, self explanatory. Adds or removes a set amount or an amount referenced from a variable of gold from the player.

10. Add Item- Lets you give or remove items from the players inventory. The item can be fixed or based on a variable.

11. Change Party- Lets you add or remove people from the player's party. Again this can be fixed or referenced from a variable.

12-15. Change (EXP, Level, Ability, Skill)- All of these are pretty much the exact same. Give or take away exp, a skill, a level, or an ability based off of something fixed or referenced from a variable.

16. Change Equipment- Allows you to equip/unequip an item to all party members or a specific person.

17-18. Change HP/MP- Allows you to add/subtract hp/mp from the player.

19. Change Condition- Allows you to add/cancel a condition that can affect one or all party members. For instance, you can kill one party member by afflicting them with the Death condition or poison them.

20. Full Recovery- Restores all HP, MP, and Stat changes to one or all party members. This is usually used when making items such as tents that completely heal your character.

21. Take Damage- Simulates an attack on a character using values that are given. The difference between this and change HP is that this isn't a set damage number, it instead calculates the damage based on attack strength and defenses.

22-26. These are self explanatory and I will just list them: Change Hero Name, Change Hero Degree, Change Hero Walk GFX (graphics), Change Hero Face, Change Vehicle GFX.

27. Change System BGM- Allows you to change the music associated with different game situations, such as battles and game over. The interface is simple, choose the subject then choose the song.

28. Change System SE- Allows you to change the sound effects associated with different actions, such as cursor movement. Just like before, you select the subject then the sound effect.

29. Set System Graphic- The system graphic basically defines the colors that the game will use as well as the menu styles.

30. Change Screen Transition- This allows you to change the way that the screen erases/appears during map changes and battle sequences.

Page 2

1. Start Combat- Starts a battle with the given characteristics. The escape case gives you three options: Don't escape, meaning it isn't allowed, Stop event, meaning that the event will not continue if you are successful at escaping, and Add Case, which allows you to customize what happens should the player escape.

2. Call Shop- Opens a shop window in which the player can buy and sell goods. Simply select what you want to be in the shop and click add.

3. Call inn- Opens an inn window, asking the player if they want to sleep at the inn.

  • NOTE: If the gold price is 0, there is no display of the message.

4. Enter Hero Name- Allows the player to select the players name. WARNING! THIS FUNCTION DOES NOT YET WORK!! There is a patch somewhere that makes it work, but it still contained many bugs and isn't worth it.

5. Teleport- Moves the player to a new map facing the direction specified at the bottom of the command window.

6. Memorize Place- This will store the hero's current map and tile coordinates in 3 variables.

7. Goto Memorized Place- Brings the hero to the memorized place. WARNING!! If the location is not valid the game will close.

8. Ride Vehicle/Dismount- This makes the hero ride the vehicle that he is standing on. If the player is currently riding the vehicle, they will dismount it.

  • NOTE: This command does NOTHING if the player is not ON TOP OF the vehicle.

9. Setup Vehicle Place- This allows you to set the map and coordinates of a vehicle.

10. Set event place- Changes the location of the Event on the map.

11. Swap two events- Switches the locations of 2 events on the map.

12. Set Terrain ID- Changes the terrain ID of the selected tile. Terrain ID's control what monsters you fight, the backgrounds of those battles and the effects of walking on it.

13. Set Event ID- Not exactly sure what this does or what it is for.

14-15. Erase/Show Screen- Erases/Shows the screen w/ the given transition. Good for using when you need to teleport but you need other things to be setup before the screen is shown.

16. Set Screen Tone- Will set the primary color for the screen, such as all reds or all greens. The last slider is general fade. If it is all the way down, the screen will be displayed in gray scale.

17. Flash Screen- Like Set Screen Tone except that it changes the screen back.

18. Shake Screen- Self Explanatory

19. Pan Screen- Will make the map scroll regardless of player movement. When the fix option is selected, the screen will not scroll when the hero moves.

20. Call Weather Effect- Begins the selected weather effect. These are active both inside and out of battle.

21. Show Picture- Displays a picture on the screen. The image number must not be in use otherwise it will overwrite the previous image. Transparency allows you to make the image fade from top to bottom, bottom to top, or just a general transparency. In additional effects you can change the pictures tones and begin ripple effects and rotation.

22. Move Picture- Identical to Show picture except it doesn't ask for the image to be selected and there is a spot to specify time. This command makes the selected picture move to the selected location in the specified time.

23. Erase Picture- Removes the picture.

24. Show battle animation- Displays a battle animation at a given location. Optional selections are Apply to full screen and wait until done.

25. Set Hero Transparency- Will show/hide the hero.

26. Flash Event- Will make the selected event flash a selected color.

27. Move Event- Will make a specified event move, change graphics, jump, etc. Phasing mode allows the event to walk over all tiles, regardless of whether or not they are passable.

  • NOTE- THERE IS NO COMMAND TO WAIT UNTIL THE MOTION IS DONE!! To make the game wait for the event to finish moving, you will have to guess and check with the wait command.

28. Move All- Not sure

29. Stop All- Stops everything.

30. Wait- This halts the event for the specified amount of time (given in 1/10 of a second). When used in most events, the game will completely stop. However, in a Parallel Process, only the event is halted, not the rest of the game.

  • NOTE: Sometimes, a Parallel process event will cause the game to skip and lag. To fix this, at the end of the event, put a Wait command for 0.0 seconds.

Page 3:

1. Play BGM- Plays a specified Back Ground Music file (midi).

  • NOTE: The song will continuously loop and replaces the currently playing midi.

2. Fade Out BGM- Self explanatory

3. Memorize BGM- Stores the bgm that is currently playing.

4. Play memorized BGM- Plays the song stored using the Memorize BGM command

5. Play Sound Effect- Plays a sound effect. Unlike Play BGM, this will not loop.

6. Play Movie-Plays a selected avi file with the given dimensions at the specified location on the screen.

7. Enter Password- Suspends the event until a key is pressed. If it is checked, the key's corresponding value (the numbers next to the names) will be stored in the selected variable.

8. Change Chipset- Changes the map's chipset.

9. Change Parallax BG- Changes the panorama that will be displayed for the background of the map (denoted by the chip in the bottom right corner of the tile section window of the first layer).

10. Encounter Rate- Changes the number of steps between random battles.

11. Change Chip- Will replace a certain chip with another chip from the same chipset.

12. Set Teleport Place- Sets the map and coordinates for teleport spells.

13. Disable Teleport- Prevents the player from using teleport spells

14. Set escape place- Sets the location where the player will go if they use an escape item or spell.

15. Disable Escape- (Dis)allows the player from using escape spells.

16. Call Save Menu- Opens the save menu. Used for custom menus and save points mainly.

17. Disable Save- Self explanatory

18. Call Menu- Opens the menu

19. Disable Menu- Self Explanatory

20. Fork Condition (also called conditional branch)- The single most useful command in RPG Maker. This lets you put logic into your game. For instance, to program the idea "If the player has the key, then open the door," you would use a fork condition, and select item then choose player has it. There are too many options within the Fork Condition menu to list them all but an easy way to think of it is as an If...Then statement. The fork checks to see if something is true and then executes the code within the command (before the end case). There is an optional ELSE IF checkbox, which allows you to put code in for if the statement is false. For example, "If the player has the key, then open the door, but if he doesn't have the key (else if) then tell him to go get the key." I hope this makes sense. The best way to learn how to use these is by experimentation.

21. Label- A section in the event's code that you will jump to using the GOTO Label command.

22. Goto Label- Goes to the selected label in the event's code.

  • NOTE ON LABELS: They cannot be shared between two events. So one event can't use a goto label command to activate a different event that has the label number.

23. Cycle- This is a general loop. The code within this loop will continuously repeat until you use the Break Cycle command.

24. Break Cycle-Exits the cycle and goes to the next line of code after the end of the cycle.

25. Stop Parallel Events- Self explanatory

26. Clear Timer- Clears the time in a timer

27. Call event- Activates the selected event. This can be a common event or a regular event on the map.

28. Comment- These are notes to people who read the code. They are ignored by RPG Maker and the computer. They are only used to clarify what different parts of the code are for.

29. Game Over-Goes to the Game over screen

30. Go to title Screen- Goes to the title screen

Page 4

1. Change Class- Changes the a character's class to a new one.

2. Change Battle Commands- Changes the different options that the specified character has during battle.


Common events are blocks of code that are used many times and do the same thing each time, such as calling a custom menu. They should be kept generic enough through variables that they can be used anywhere. They can be set to be called, or parallel process with or without an activation switch.

It is a good idea to figure out what you want to do exactly in English before jumping straight into the programming. This will help you collect your thoughts and think through the process.

RPG Maker was meant to make basic RPG's. While this doesn't mean it is impossible to do anything unorthodox for RPG's, it does mean it will be much harder than normal to accomplish difficult systems. When doing something that it doesn't normally allow, your job as the programmer is to use the commands to bend the rules to do what you want.

Variables and Switches should be used sparingly, but don't hold back from using them. Keep them organized with clear names otherwise they will become messy and hard to understand.

If some code isn't working, go through line by line and say what each should do, then try to figure out if something else needs to go there.

Personal tools