Fan Games

A guide to beginning Pokémon fangame development in RMXP

An overview of the basic principles of fangame design using the Pokémon Essentials mod for RPG Maker XP.

Scripting

You may have noticed that when listing useful event commands, we skipped over the buttons for modifying switches, variables, and self switches. That wasn’t an accident. Many of RPG Maker’s features can be used via scripting as well as through an event command, and the former tends to be a lot more versatile, so we go with that.

Manipulating RMXP’s Game Variables

Setting Variables

pbSet(id, value)
Example: pbSet(1, "hello PC Daily readers")
Sets game variable 1 to the value "hello PC Daily readers"

Takes an id (the number of the game variable as an integer), and a value to set the variable to.

Reading Variables

pbGet(id)
Example: pbGet(1)
Returns the value of game variable 1.

Takes an id (the number of the game variable as an integer), and returns the value of the corresponding game variable, or nil if the variable is undefined.

Setting Switches

$game_switches[id] = value
Example: $game_switches[5] = true
Sets game switch 5 to true.

Takes the id (the number of the game switch as an integer) and sets it to the specified true/false value.

Reading Switches

$game_switches[id]
Example: $game_switches[5]
Returns the value of game switch 5.

Takes an id (the number of the game switch as an integer) and returns the corresponding true/false value.

Setting Self Switches

pbSetSelfSwitch(event, switch, value)
Example: pbSetSelfSwitch(1, "A", true)
Sets self switch A of event #1 to true.

Takes the id of an event on the map, the self switch to use (“A”, “B”, “C”, or “D” as strings), and a true/false value.

Script Editor

Press F11 to open the script editor! In here you’ll see the massive list of scripts that make Pokémon Essentials tick. These scripts are written in Ruby Game Scripting System, a version of the Ruby programming language designed specifically for game programming.

Intermediate or advanced knowledge of Ruby is not required to make progress with Pokémon Essentials, but it’s certainly useful and will allow you to customize your game and add features to a far greater extent. At absolute minimum, you’ll need a basic understanding of Ruby (and programming concepts more generally) in order to make any headway, so have a look through the following resources:

Tutorialspoint Ruby Tutorial

LaunchSchool Ruby Tutorial

Ruby Documentation