Jun 5, 2014
Reaction score
First Language
Primarily Uses
You can cut and paste this into a doc to have a quick reference;

Event Action Script Call Equivalents
Conditional Branch
if #something
Show Picture
screen.pictures[index].show(file_name, upperleft/center, x, y, x zoom, y zoom, opacity, blend type)
Move Picture
screen.pictures[n].move(0/1 (top left or center), x, y, zoom1, zoom2, opacity, blend type (0,1, 2), wait)
Picture Tone
screen.pictures[n].start_tone_change(Tone.new(0, 0, 0, 0), wait)
Move Event
move_route = RPG::MoveRoute.new
move_route.repeat = false
move_route.skippable = true
m = RPG::MoveCommand.new
m.code = 45 #The List of M Code can be found over Game_Character, this current m.code is call script
m.parameters = ["script call here"]
Transfer Event Location
$game_map.events[id].moveto(new_x, new_y)
Transfer Player
$game_player.reserve_transfer(map_id, x, y, direction)
Screen Tint
t = Tone.new(red,green,blue, gray)
screen.start_tone_change(t, duration)
Shake Screen
@params = []
@params[0] = power or $game_variables[x]
@params[1] = speed or $game_variables[y]
@params[2] = duration or $game_variables[z]
Note: (Neonblack and Fomar0153 found this glitch!)
The shake screen has an option in the editor where you can add a "wait" or not. But the glitch involves that it will wait no matter what. But it will only wait a number of frames equal to whatever the speed is set to the default option. For example, the setting is 5 power, 5 speed, 60 frames, and wait. It will wait for 5 frames, no matter what.
Call Common Event:
RPG::SE.new("SE Name", volume, pitch).play
RPG::ME.new("ME Name", volume, pitch).play
RPG::BGS.new("BGS Name", volume, pitch).play
RPG::BGM.new("BGM Name", volume, pitch).play
Show Text:
Gain/lose Item:
$game_party.gain_item($data_items[id], amount)
$game_party.lose_item($data_items[id], amount)
(For weapons/armor use $data_weapons or $data_armors in place of $data_items.)

Gather Followers:
Change Player Followers:
$game_player.followers.visible = true or false
Erase Event:
Some conditional script calls to add to Celianna's:
Button pressing
Remove Actor
Add Actor
Remove Party Member from position (where x = party position. 0 = 1st member, 1 = 2nd member, etc.)
m = $game_party.members
If you ever wanted to add every item/skills/weapons for debugging purpose (or something else?) it can be kind of tedious to add them all if you have alot. This small script call will help immensely:
$data_items.each { |i|
next if i.nil? or i.name == ""
$game_party.gain_item(i, 99)
Of course, if you want you can change $data_items to $data_weapons or something else and the amount you want.

When checking for input triggers/pressing you can actually shorten that a bit:
There is no need to write Input::CTRL anymore.

To get the leader of the party you can do this:
Gain/lose gold:
Check for current max gold:
Get map id and name:
To correct the screen shake bug thing do the following at Game_Interpreter:
def command_225
screen.start_shake(@params[0], @params[1], @params[2])
wait(@params[2]) if @params[2]
Now it will wait the right amount of frames and not 5. 
$game_player.region_id == n
$game_map.events[event_id].region_id == n
Show Choices
params = []
choices = []
choices.push("choice 1")
choices.push("choice 2")
params.push(0/1/2 this part is where you press cancel and which choice to default)
It is pretty easy to fake the When [**] command (402).
The definition is just

command_skip if @branch[@indent] != @params[0]
Where @params stores the choice number for that specific branch (0, 1, 2, ... )

So all you have to do is replace @params[0] with an integer

if @branch[@indent] == 0
# branch for first choice
elsif @branch[@indent] == 1
# branch for second choice
Editor line continuation
$game_variables[12] = ($game_variables[6] ==
$game_variables[10]) && ($game_variables[7] == $game_variables[11]) &&
($game_variables[8] == $game_variables[10]) &&
($game_variables[9] == $game_variables[11])
change the text dialog background:
$game_message.background = 1 #0 = default blue, 1 = dim, 2 = transparent
Equip weapon
the 0 value in the above code snippet can have the following values:
0 = weapon
1 = shield
2 = headgear
3 = body-gear (armor)
4 = accessory
Transfer player
$game_player.reserve_transfer(map_id, x, y, $game_player.direction)
$game_player.followers.visible = true or false 
Audio.se_play(name, volume, pitch)
Is Weapon Equipped?
$game_actors[actor id].weapons.include?($data_weapons[weapon id])
Access self switches
$game_self_switches[[mapid, eventid, 'A']] = true

Make sure you use [[...]] and not just [...] 
Get Currency Unit
For any equipment, you can use this:
  right_hand = $game_actors[actor_id].equips[0]
  left_hand = $game_actors[actor_id].equips[1]
To get the items. Replace the index in equips for the item you're looking for (0 = right hand, 1 = left hand, 2 = head, 3 = body, 4 = accessory, provided you're not using any scripts that change that).
You can check their types with:
  if right_hand.is_a?(RPG::Weapon)
    # do something
  elsif right_hand.is_a?(RPG::Armor)
   # do something else
Or get their properties with with
  # etc..
 i.e. if you want to check if you have a Prinny Gun equipped on your first weapon slot: 
  right_hand = $game_actors[actor_id].equips[0]
  if !right_hand.nil? && right_hand.name.eql?("Prinny Gun")
    # Do something
You don't even need to keep track of the IDs, really (unless you want to, for some reason). If there's no way to not have a weapon equipped in your game, you can also take out the ".nil?" check.
Showing a text box with pure script
$game_message.position = X
0 -Top
1- Middle
2- Bottom

$game_message.background = X
0 - Normal
1 - Faded
2 - Transparent
$game_message.face_name = 'Actor1' <- Name of the graphic plate
$game_message.face_index = 0 <- Position in the plate of the face you are using.
$game_message.face_name = 'Actor1'
$game_message.face_index = 0
$game_message.background = 2
$game_message.position = 0
$game_player.passable?(x, y, d) and $game_map.events[event_id].passable?(x, y, d)

are extensions to this that do a little more detailed checking.

$game_map.passable? only tells you whether you can leave one tile in the direction of the other. The player and event versions take it further and tell you if you can leave that tile in the direction of the other AND if you can enter the other tile from the tile you're on now (for example, if you are facing right and the tile in front of you is the edge of a cliff that is higher than you - $game_map.passable? would tell you that you CAN step right from the current tile. But $game_player.passable? would tell you that you could not move onto the next tile from the left). It also looks to see if there is an event on your target tile which would stop you going there, but $game_map.passable? would not tell you that. 
Check HP
You can check an actor's current hp with:
Or the leader's current hp:
Or a member of the party:
Check Items
Here's the script from Game_Interpreter that places the quantity of an item into a variable:
So you'd just change param1 to the item id you're interested in, and add your condition around it:
if $game_party.item_number($data_items[32]) == 15
Checking how many of a particular type of weapon or armor is very similar:
Access Event by Name
# Code by Filip H.F. "FiXato" Slagter
# Place this under Materials and above Main Process and before any scripts that would make use of it.
# Allows you to also use Game Switch *names* instead of just IDs in $game_switches[] calls.
class Game_Switches
# Overload the [] method so we can also call switches by their name, for instance:
# $game_switches['my switch']
alias_method :find_by_name, :[]
def [](switch)
switch_id = (switch.kind_of?(String) ? $data_system.switches.find_index(switch) : switch)
# Overload the []= method so we can also set switches by their name, for instance
# $game_switches['my switch'] = true
alias_method :set_by_name, :[]=
def []=(switch,value)
switch_id = (switch.kind_of?(String) ? $data_system.switches.find_index(switch) : switch)
set_by_name(switch_id, value)

  • Recover All for your entire party:
@params = [0, 0]
Show a named animation (in this case 'Sleep') for the player and wait for it to end:
animation_name = 'Sleep'
animation_id = $data_animations.find_index{|ani|ani && ani.name == animation_name}
@params = [-1, animation_id, true]
2 = down, 4 = left, 6 = right, 8 = up.
Event Ballon
$game_map.events[eventid].balloon_id = # where # is the row of the balloon spritesheet you want to show (I think the top row is 1, not 0), and eventid is the id of the event
Player Facing

2 = down
4 = left
6 = right
8 = up 
If ActorX or ActorY is in party
$game_party.members.include?($game_actors[X]) or $game_party.members.include?($game_actors[Y])
$game_party.members.any? {|a| [X,Y].include?(a.id)}
Change Actor Graphic
actor.set_graphic(character_name, character_index, face_name, face_index)
Use Item
Show Battle Animation
Show Battle Animation:

  • @enemy_index = 0
  • @animation_id = 1
  • iterate_enemy_index(@enemy_index) do |e|
  • e.animation_id = @animation_id if e.alive?
  • end
That will show a battle animation. 
Shop Processing
# goods = [[type, id, price_override_flag(, price)]] Ex:
goods = [[0,1,1,25],[0,2,0]]
SceneManager.scene.prepare(goods, true)
goods = []
for id in 1..20
goods.push([0, id, 0])
SceneManager.scene.prepare(goods, true)
Store Actor Level
$game_variables[x] = $game_actors[id].level
Control Weather
$game_map.screen.change_weather(type, power, duration)
where type is :none, :rain, :storm, or :snow, and power and duration are what you would have set the sliders to on the box.

followed by Wait X Frames if you want it to halt processing until the weather is set. 
Move Set Route -> Change Graphic
$game_map.events[id].set_graphic("character_name", character_index)
id is the id of the event you want to change.
"character_name" is the name of the graphic file you want to change to (make sure to keep the quotation marks).
character_index is the index on the character sheet (it starts counting at 0).

Last edited by a moderator:


Global Moderators
Global Mod
Mar 2, 2012
Reaction score
First Language
Primarily Uses
Thanks for the reference list. I'm going to tag this as RGSS3 and move it over to Learning Ruby and RGSSx as it is a better fit.


Jun 5, 2014
Reaction score
First Language
Primarily Uses
That page has them all in separate spoilers. This way it is easier to cut and paste. 


Global Moderators
Global Mod
Mar 2, 2012
Reaction score
First Language
Primarily Uses
The spoilers group them into logical sections according to the event tab and section where they appear. How is it making it difficult to cut and paste?

THIS page presents everything as a single wall of text with no breaks or logical divisions. This way it is harder to find what you are looking for.

Latest Threads

Latest Profile Posts

Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v
Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)
Just for the record you CAN use the "Exclude unused files" successfully to trim a project down seriously even if you're doing calls to various assets via plugins and such. BUT you need to do a full playtest of pretty much every option to ensure you did get every one of those other assets added in. Then I dumped the assets into a fresh copy of the project and yay it was like 400 Meg......

Forum statistics

Latest member