RPG Maker VX Ace

RPG Maker VX Ace

Not enough ratings
Script Call Collection
By Bukk94
Do you need combined conditional branch? Do you need some variables or methods? You're on the right spot!
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hello everyone.
In this guide I tried to collect as much script calls as possible. Sometimes you need complicated conditional branches or use actor's HP variable to change some other stats. And default RPG Maker event tabs are easy to use, but you can't do everything with them. That's why you can call a script (third tab on the end) or use script directly in conditional branch (also last tab).

Here's a lot of useful script calls that will help you to change actor's stats, show messages, set conditions and more. Use right panel for easy navigation.
FAQ
If you have any questions, feel free to ask in comments!

Q: What programming language is used for scripting?
A: Ruby with RGSS3 library extension

Q: What operators can I use?
A: You can use standard operatords from other programming languages
= += -= *= /=
Watch out! Double equals "==" means boolean statement thus the output is true or false

Q: How do I do If statement?
A: Just write "if" and next to it your condition. No brackets. Don't forget to end this statement by "end" command! Check the example
if $game_switches[5] == true #If switch 5 is ON $game_actors[10].change_hp(50, false) #Increase 10th actor's HP by 50 end
Game Controll / Progression
Call common event
$game_temp.reserve_common_event(id)
# id is number of common event

Wait
Wait(n)
# n is number of frames (or seconds, not sure now, sorry)

Control Switches
$game_switches[n] = value
# n is number of Nth switch
# value is boolean statement - true or false. True is ON, false is OFF.

Example of turning on switch No. 5:
$game_switches[5] = true

Control Self-Switch
$game_self_switches[[map, event, 'self_switch']] = value
# Map is either @map_id (for the current map) or map ID. You can find it in Map Properties (right click on the map). Enter value without zeroes! (For instance, Map ID 010 would be 10).
#event is either @event_id (for the current event) or event ID. Again, without zeroes (EV001 would be 1).
#self_switch is 'A', 'B', 'C' or 'D' (must have the single or double quotes)
#value is either true or false

Control Timer
Start Timer
$game_timer.start(sec * Graphics.frame_rate)
#sec is number of seconds to set on timer. You must convert minutes to seconds!

Stop Timer
$game_timer.stop

Control Variables
Set a Value
$game_variables[n] = value
# where n is number of Nth variable
# value is number that will be stored in this variable

For operator references:
# Addition $game_variables[n] += value # Subtraction $game_variables[n] -= value # Multiply $game_variables[n] *= value # Division $game_variables[n] /= value # Modulus $game_variables[n] %= value # String (aka text) $game_variables[n] = "Insert string here!" # Another Variable $game_variables[n] = $game_variables[n] # Variable References $game_variables[$game_variables[n]] = value

Randomize
$game_variables[n] = rand(value)
# n is number of Nth variable
# value is number for generating - 1

Example for Randomize
If you use rand(10) you get a number between 0-9
$game_variables[1] = rand(10)

To have negative values, put something like "*-5 + rand(11)" to get a number between -5 to 5
$game_variables[1] = (-5 + rand(11))


For Game Data References:
Amount of Items in Inventory $game_variables[n] = $game_party.item_number($data_items[n]) # Example Usage: Amount of Potions in Inventory is going to be stored in Variable 1 $game_variables[1] = $game_party.item_number($data_items[1]) # Amount of Weapons in Inventory $game_variables[n] = $game_party.item_number($data_weapons[n]) # Amount of Armors in Inventory $game_variables[n] = $game_party.item_number($data_armors[n]) # Map ID $game_variables[n] = $game_map.map_id # Gold $game_variables[n] = $game_party.gold # Steps $game_variables[n] = $game_party.steps # Playtime $game_variables[n] = $game_system.playtime_s # Frame Count and Frame Rate $game_variables[n] = Graphics.frame_count $game_variables[n] = Graphics.frame_rate # Timer $game_variables[n] = $game_timer.sec # Save Count $game_variables[n] = $game_system.save_count # Battle Count $game_variables[n] = $game_system.battle_count
# where n is number of Nth variable (or an item/weapon/armor on the first three)
Player, Actors & Party
Actors
$game_actors[ID]
# Where ID is the id of the single actor (found in database - F9)

Change HP
$game_actors[ID].hp #Total health $game_actors[ID].change_hp(HP, enable_death)
# HP are value of new HP
# enable_death is true or false
With .hp command, you can permanently increase/decrease actor's HP.
With .change_hp command you can heal/wound the actor.

Example for Single Actor:
actor = $game_actors[ID] if !actor.dead?actor.change_hp(value, enable_death) actor.perform_collapse_effect if actor.dead? end
# enable_death is true or false
# Where ID is the id of the single actor (found in database - F9)

Example for Entire Party
$game_party.members.each { |actor|next if actor.dead?actor.change_hp(value, enable_death)actor.perform_collapse_effect if actor_dead?}
# enable_death is true or false
# Value is the change to make (a positive or negative amount to be added to the current hp)
5 will make someone with HP 10 go to 15
-5 will make someone with HP 10 go to 5 so it's not SETTING the value, but adjusting it.


You need to damage actor for X% of his overal HP? No problem!
$game_variables[1] = ($game_actors[12].hp * 0.05).to_i $game_actors[12].change_hp(-$game_variables[92], false)
In this case, we'll take overall HP of 12th actor and we'll take 5% of it (0.05, you need to divide your percentage /100) and store it into Variable 1. Then we'll call change_hp script and enter "minus Variable 1". That means his HP will be decreased by 5%. If you want to increase it, just leave there a positive value. Second parameter is "enable_death". Which means, if his HP reaches 0 he'll be dead (or GameOver if it's your main character). Enter true / false values.

Change MP
Careful! MP has NOT any method called "change_mp" like HP.
$game_actors[ID].mp $game_party.members.each { |actor| actor.mp += value }
# Where ID is the id of the single actor (found in database - F9)
# Value is a positive or negative amount to be added to the current mp.

Change State
Add State For Single Actor
actor = $game_actors[id]already_dead = actor.dead?actor.add_state(state_id)actor.perform_collapse_effect if actor.dead? and !already_deadactor.result.clear
Remove State For Single Actor
actor = $game_actors[id]actor.remove_state(state_id)actor.result.clear
# Where ID is the id of the single actor (found in database - F9)
# state_id is the id of the state you want to add or remove

Add State For Entire Party
$game_party.members.each { |actor|already_dead = actor.dead?actor.add_state(state_id)actor.perform_collapse_effect if actor.dead? and !already_dead} $game_party.clear_results
Remove State For Entire Party
$game_party.members.each { |actor| actor.remove_state(state_id) } $game_party.clear_results
# state_id is the id of the state you want to add or remove

Recover All
For Single Actor
$game_actors[id].recover_all
# Where ID is the id of the single actor (found in database - F9)

For Entire Party
$game_party.members.each { |actor| actor.recover_all }

Change EXP
$game_actors[id].exp
For Single Actor
$game_actors[id].change_exp(new_exp, show)
# Where ID is the id of the single actor (found in database - F9)

For Entire Party
$game_party.members.each { |actor| actor.change_exp(new_exp, show) }
# Show is boolean statement - true / false - if you want to show level up message and list of new skills if the exp past the current level.
# new_exp is value that you want to SET exp to. If you want to just ADD exp to your actor, use this code:
$game_actors[id].change_exp($game_actors[id].exp + new_exp, show) #or you can use variable to store your actor: actor = $game_actors[id] exp = $game_variables[1] actor.change_exp(actor.exp + exp, true)
Of course, you can use positive or negative value for exp.

Get/Change Level
$game_actors[id].level

For Single Actor
$game_actors[id].change_level(new_level, show)
For Entire Party
$game_party.members.each { |actor| actor.change_level(new_level, show) }
# Where ID is the id of the single actor (found in database - F9)
# show is true or false (as above, for level up and skills messages)
# new_level is the level you want to change them to (not an adjustment)
# If you WANT to make an adjustment, you have to get current level and add a new value to it (similar as above).

Change parameters
For Single Actor
$game_actors[id].add_param(pid, value)
For Entire Party
$game_party.members.each { |actor| actor.add_param(pid, value) }
# Where ID is the id of the single actor (found in database - F9)
# pid is the parameter id (0=MHP, 1=MMP, 2=ATK, 3=DEF, 4=MAT, 5=MDF, 6=AGI, 7=LUK)
# value is the amount to add or subtract

Change skills
For Single Actor
$game_actors[id].learn_skill(sid) $game_actors[id].forget_skill(sid)
For Entire Party
$game_party.members.each { |actor| actor.learn_skill(sid) } $game_party.members.each { |actor| actor.forget_skill(sid) }
# Where ID is the id of the single actor (found in database - F9)
# sid is the id of the skill to learn or forget

Change Equipment
$game_actors[id].change_equip_by_id(slot, equip_id) if $game_actors[id]
# Where ID is the id of the single actor (found in database - F9)
# slot is the slot number (0=weapon, 1=shield, 2=head, 3=body, 4=accessory)
# equip_id is the weapon or armor id

Change name
$game_actors[id].name = "New_Name" if $game_actors[id]
# Where ID is the id of the single actor (found in database - F9)
# New_Name is your new name. Don't forget the " " symbols.

Change nickname
$game_actors[id].nickname = "New_Nickname" if $game_actors[id]
# Where ID is the id of the single actor (found in database - F9)
# New_Nickname is your new nickname. Don't forget the " " symbols.

Change class
$game_actors[id].change_class(cid) if $game_actors[id] and $data_classes[cid]
# Where ID is the id of the single actor (found in database - F9)
# cid is the class id

Party Members Related

Change party member

Add Actor by ID
$game_party.add_actor(actor_id)
Remove Actor by ID
$game_party.remove_actor(actor_id)
Remove Actor by Party Position
partyMem = $game_party.members $game_party.remove_actor(partyMem[memPos].id)
# Where ID is the id of the single actor (found in database - F9)
# memPos - Numerical identifier of actor within current party. 0 = 1st member, 1 = 2nd member, etc

To reference who's in a particular position in the lineup
$game_party.members[index].id
# where index is the position (starting at 0 for the leader)

To reference where someone is in the lineup
$game_actors[id].index
# where id is the actor id

Actor's stats
# Actor Level $game_actors[n].level # Actor HP $game_actors[n].hp # Actor Max HP $game_actors[n].mhp # Actor MP (current) $game_actors[n].mp # Actor Max MP (total) $game_actors[n].mmp # Actor Attack $game_actors[n].atk # Actor Defense $game_actors[n].def # Actor MagAtk $game_actors[n].mat # Actor MagDef $game_actors[n].mdf # Actor Agility $game_actors[n].agi # Actor Luck $game_actors[n].luk # Actor Pharmacology $game_actors[n].pha
# Where n is number of Nth actor.

# Enemy Troop Stats (use this only in battle!)
$game_troop.members[index].stat
# where stat = hp or mp or param(id)
# where id = 0:MHP, 1:MMP, 2:ATK, 3:DEF, 4:MAT, 5:MDF, 6:AGI, 7:LUK
Character
Change Transparency
$game_player.transparent = true/false

Show Player Followers
$game_player.followers.visible = true/false $game_player.refresh

Gather Followers
$game_player.followers.gather


Get Player's gold
$game_party.gold

Show animation
For Player $game_player.animation_id = n For Events $game_map.events[event_id].animation_id = n
# event_id is event ID without zeroes! If your event is EV001, use only 1!
# n is number of animation

Show Balloon icon
# For Player $game_player.balloon_id = n # For Events $game_map.events[event_id].balloon_id = n
# event_id is event ID without zeroes! If your event is EV001, use only 1!
# Top Row is 1 (Exclamation by Default).

Erase event
$game_map.events[event_id].erase
# event_id is event ID without zeroes! If your event is EV001, use only 1!
Message calls
Show Text
$game_message.face_name = 'fName' $game_message.face_index = fIndex $game_message.background = fBG $game_message.position = fPos $game_message.add("Text")
# fName - Name of file containing desired face. Also automatically searches files included in RGSS-RTP. File extensions may be omitted.
# fIndex - Numerical identifier of face (0 is the first face).
# fBG - [0] Normal, [1] Faded, [2] Transparent
# fPos - [0] Top, [1] Middle, [2] Bottom

Show Choises
I don't recommend to use this. Show Choices command is very complicated.
params = [] choices = [] choices.push("choice 1") choices.push("choice 2") params.push(choices) params.push(0/1/2 this part is where you press cancel and which choice to default) setup_choices(params)

Input Number
$game_message.num_input_variable_id = x$game_message.num_input_digits_max = y
Example Usage:
Input a 3 digit number into variable 5
$game_message.num_input_variable_id = 5$game_message.num_input_digits_max = 3

Select Key Item
$game_message.item_choice_variable_id = x
Where x is the Variable ID you want the item number put into.

Show Scrolling Text
$game_message.scroll_mode = true $game_message.scroll_speed = 1 $game_message.scroll_no_fast = false $game_message.add("A long time ago,") $game_message.add("in a galaxy far, far away ...") $game_message.add("") $game_message.add("") $game_message.add("") $game_message.add("...")
Inventory
Change Gold
$game_party.gain_gold(amount) $game_party.lose_gold(amount)
# amount is value or gaining/loosing gold
Alternatively you can use negative values in .game_gold to decrease player's gold.

Change Items
$game_party.gain_item($data_items[n], amount) $game_party.lose_item($data_items[n], amount)
# n is Nth item (found in database - F9 - items)
# amout is value of gaining/loosing items (to give 5 potions for instance)

Change weapons
$game_party.gain_item($data_weapons[n], amount) $game_party.lose_item($data_weapons[n], amount)
# n is Nth weapon (found in database - F9 - items)
# amout is value of gaining/loosing weapons (to give 5 swords for instance)

Change armor
$game_party.gain_item($data_armors[n], amount) $game_party.lose_item($data_armors[n], amount)
# n is Nth armor (found in database - F9 - armor)
# amout is value of gaining/loosing items (to give 5 steel armors for instance)

Check if item is in inventory
$game_party.items.include?($data_items[item_id])
# item_id is ID of item that you are checking (if it's in the inventory)
Movement
Transfer player
$game_temp.fade_type = fade $game_player.reserve_transfer(map_id, x, y, direction)
# map_id is ID of transfering map. Enter number without zeroes! (If your map have ID 001, enter just 1).
# X / Y are coordinates (you can find them in right bottom corner
# Fade/Fade Style = [0; Default, Black], [1] White, [2] None
# For direction: [0; Default, Retain], [2] Down, [4] Left, [8] Up, [6] Right

Set Player and event location
Move Event to new X and new Y Position
$game_map.events[id].moveto(new_x, new_y)
# id is event ID. If you have event id EV001, enter just 1!
# new_x and new_y are two coordinates

Move Player to new X and new Y Position
$game_player.moveto(x, y)
# X and Y are again coordinates

Move route
These are pretty comples scripts, avoid it if possible.
move_route = RPG::MoveRoute.new move_route.repeat = value

# value is boolean statement - true / false . if you want to repeat the action, type true.

This means the event will skip the move route if it's not possible
move_route.skippable = true

For Turning events
# For events $game_map.events[eventid].set_direction(n) # For players $game_player.set_direction(n)
#Direction n = [2]Down [4]Left [6]Right [8]Up

Changing Event 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).


Set vehicle location
$game_map.vehicles[n].set_location(map_id, x, y)
# n = [0] boat, [1] ship, [2] airship

To Refer Game Vehicles
$game_map.vehicles[n] $game_map.vehicles[n].x $game_map.vehicles[n].y
# n = [0] boat, [1] ship, [2] airship

Get on/off vehicle
$game_player.get_on_off_vehicle = true/false

Scroll map
$game_map.start_scroll(direction, distance, speed)
# Direction = [2]Down [4]Left [6]Right [8]Up
# Distance = How many tiles you want it to scroll
# Speed = [1]8x Slower [2]4x Slower [3]2x Slower [4]Normal [5]2x Faster [6]4x Faster
if this script doesn't work, add this BEFORE it:
Fiber.yield while $game_map.scrolling?
Picture and Weather
Show Picture
screen.pictures[index].show(file_name, position, x, y, x_zoom, y_zoom, opacity, blend type)
# index is number of picture (You can use whatever you want, you'll need it for erase)
# file_name is name of the file in graphics. Enter the name in double quotes "Name.png"
# position = [0] Top Left, [1] = Center
# X / Y are coordinates
# X_zoom, Y_zoom are zoom coordinates
# opacity is value of opacity. 0 - 100 (100 fully visible)
# blend type = [0] Normal, [1] Add, [2] Sub

Move Picture
screen.pictures[n].move(position, x, y, x zoom, y zoom, opacity, blend type, wait)
# parameteres are same as above
# wait is true/false

Rotate Picture
screen.pictures[n].rotate(x)
# n is number of your picture selected in Show picture
# x is rotation angle

Tint Picture
screen.pictures[n].start_tone_change(Tone.new(R, G, B, O), wait)
# n is number of your picture selected in Show picture
# wait is time of waiting
You can adjust the tone. This uses RGB channels with values 0 - 255.
first is RED, seconds is GREEN, third is BLUE channel and the last one is opacity (0 - 100). 100 is maximum visible, 0 is invisible.
If you have troubles with RGB channels, check some paint programs like photoshop.
Do NOT exceed 255 value.

Erase Picture
screen.pictures[n].erase
# n is number of your picture selected in Show picture

Set Weather Effects
$game_map.screen.change_weather(type, power, duration)
# type = :none, :rain, :storm, or :snow
# power = Intensity of weather. If weather type is none (:none), set power (target value of intensity) to 0 to represent gradual stopping of rain, but only in this case.
# duration= Specified time to fade weather in or out.
Music and sound
Play BGM/ME/BGS/SE
RPG::BGM.new("BGM Name", volume, pitch).play RPG::ME.new("ME Name", volume, pitch).play RPG::BGS.new("BGS Name", volume, pitch).play RPG::SE.new("SE Name", volume, pitch).play

# Alternative Script Calls
Audio.bgm_play(fName, volume, pitch, pos) Audio.bgs_play(fName, volume, pitch, pos) Audio.me_play(fName, volume, pitch) Audio.se_play(fName, volume, pitch)
# fName Name of file containing desired sound file. Also automatically searches files included in RGSS-RTP. File extensions may be omitted.
# volume [100; Default - Max:100, Min:0] Volume of sound.
OPTIONAL # pitch [100; Default - Max:500, Min:1] Pitch of sound.
OPTIONAL # pos Position of sound file.
OPTIONAL# Play Map BGM (Does not Save Position)

$game_map.autoplay # Play Battle Music BattleManager.play_battle_bgm # Play Battle Victory Music BattleManager.play_battle_end_me


Saving BGM/BGS
# Save BGM $game_system.save_bgm # Save BGM and BGS BattleManager.save_bgm_and_bgs

Replay BGM/BGS
# Replay BGM $game_system.replay_bgm # Replay BGM and BGS BattleManager.replay_bgm_and_bgs

Fade BGM/BGS/ME
RPG::BGM.fade(seconds * 1000) RPG::BGS.fade(seconds * 1000) RPG::ME.fade(seconds * 1000) # Alternative Script Calls Audio.bgm_fade(time) Audio.bgs_fade(time) Audio.me_fade(time)
# time = Number of milliseconds (1000 is equal to 1 second)

Stop BGM/BGS/ME
RPG::BGM.stop RPG::BGS.stop RPG::ME.stop # Alternative Script Calls Audio.bgm_stop Audio.bgs_stop Audio.me_stop Audio.se_stop
Screen Effects
Fade Out Screen
Fiber.yield while $game_message.visiblescreen.start_fadeout(time) wait(time)
# time is in miliseconds (1 s = 1000 ms)

Fade In Screen
Fiber.yield while $game_message.visiblescreen.start_fadein(time) wait(time)

Tint Screen
tone = Tone.new(R,G,B,Opacity) $game_map.screen.start_tone_change(tone, duration) wait(time)
# duration is how long it will take to tint the screen.
You can adjust the tone. This uses RGB channels with values 0 - 255.
First is RED, seconds is GREEN, third is BLUE channel and the last one is opacity (0 - 100). 100 is maximum visible, 0 is invisible.
If you have troubles with RGB channels, check some paint programs like photoshop.
Do NOT exceed 255 value.

Flash Screen
color = Color.new(R,G,B,Opacity) screen.start_flash(color, time)
# color is new Color, create in the code, using RGB.
# t is time value
Example:
screen.start_flash(Color.new(255,255,25,100), 6)

Shake Screen
$game_map.screen.start_shake(power, speed, duration)
# power is intensity of shaking
# speed is speed of shaking
# duration specifies time for shaking to occur (shaking)
Map
Map Display Name
$game_map.display_name

Map ID
$game_map.map_id

Change Map Display Name Visibility
$game_map.name_display = true/false

Change Tileset
$game_map.change_tileset(n)
# n is Nth tileset in Database

Change Battleback
$game_map.change_battleback("battleback1", "battleback2")
Battleback is made of 2 separate images, so you need to enter both. Don't forget write their name into double quotes.

Change Parallax Back
$game_map.change_parallax("graphicname", Loop Horizontal, Loop Vertical, HScroll, VScroll)
# Loop Horizontal and Loop Vertical are boolean statement - true/false
# HScroll, VScroll are numbers
Don't forget write parallax name into double quotes.

Example:
$game_map.change_parallax("BlueSky", true, true, 0, 0)

Check Location
# X and Y's $game_player.x $game_player.y $game_map.events[n].x $game_map.events[n].y # n = Event ID # Check Terrain Tag $game_map.terrain_tag(x, y) $game_player.terrain_tag $game_map.events[event_id].terrain_tag # Check Region ID $game_map.region_id(x, y) $game_player.region_id == n $game_map.events[event_id].region_id == n # Check Map Name and Map ID $game_map.name $game_map.map_id # Check if Event is Near Player $game_map.events[n].near_the_player? #This return true or false
# Distance for detection is 20 squares.
# n = Event/region ID
Scene Control
Battle Processing
BattleManager.setup(troop_id, esc, loose) BattleManager.event_proc = Proc.new {|n|@branch[@indent] = n } $game_player.make_encounter_count SceneManager.call(Scene_Battle) Fiber.yield
# troop_id is number of Nth troop in database (you can use variables)
# esc = true/false if escape enabled
# lose = true/false if continue when lose

Example Script Call
BattleManager.setup(1, true, true) BattleManager.event_proc = Proc.new {|n|@branch[@indent] = n } $game_player.make_encounter_countSceneManager.call(Scene_Battle) Fiber.yield

Shop Processing
goods = [[type, id, price_override_flag, price]] SceneManager.call(Scene_Shop) SceneManager.scene.prepare(goods, true)

Example Script Call
goods = [[0,1,1,25],[0,2,0]] SceneManager.call(Scene_Shop) SceneManager.scene.prepare(goods, true) # You can also use a loop to add the elements to the array: goods = [] for id in 1..20 goods.push([0, id, 0]) end

Name Input Processing
SceneManager.call(Scene_Name) SceneManager.scene.prepare(actor_id, chars) Fiber.yield
# Actor ID is Actor ID
# Chars are how many characters long the name can be.


Open Save/Load/Exit/Game Over/Scenes
I do not recommend messing much with these scene call because I can make conflicts between your scripts and the scripts that are you using in Script Editor. Use these only if you're experience and you know what are you doing.
SceneManager.call(Scene_Save) SceneManager.call(Scene_Load) SceneManager.exit SceneManager.call(Scene_Gameover) SceneManager.call(scene)
# scene = Scene to load. (example - SceneManager.call(Scene_Skill) )
# Scene_Menu, Scene_Item, Scene_Skill, Scene_Status, Scene_Title, Scene_Save, Scene_Load, Scene_Name, Scene_Debug, etc.
Playtime
Playtime
Playtime can be counter using frame counts. Following script will return string or playtime as
00h 00m 00s. You can change format as you like.
playtime = sprintf("%02dh %02dm %02ds", (Graphics.frame_count / 60**2) / 60, Graphics.frame_count / 60**2 % 60, Graphics.frame_count / 60 % 60)
Miscellanous
Input Commands
Input.trigger?(:A) Input.repeat?(:A) Input.press?(:A)
# Change A to your desired key, refer to F1 when you testplay and see the keys (not every key on keyboard is accessible in RPG Maker).

Screen Clean Up
Clear Fade/Tone/Flash/Shake/Weather/Pictures
$game_map.screen.clea $game_map.screen.clear_tone $game_map.screen.clear_shake $game_map.screen.clear_weather $game_map.screen.clear_pictures

Player Equipment
Change an actor's equipment.
$game_actors[1].change_equip(n, $data_weapons[x])
# Change n with one of the following:# 0 = weapon, 1 = shield, 2 = headgear, 3 = body-gear (armor), 4 = accessory
# x is Nth item in database

# Check Conditional Branch: if [Actor] has [Weapon] Equipped
$game_actors[actor id].weapons.include?($data_weapons[weapon id]) 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

Currency unit set
$data_system.currency_unit

Movement Commands
game_player.moving? $game_player.dash? $game_player.jumping? $game_map.events[event_id].moving? $game_map.events[event_id].jumping? $game_map.passable?(X, Y, D) $game_player.passable?(x, y, d) $game_map.events[event_id].passable?(x, y, d)
# $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.

Q: I want to check the position of Player and compare with the position at side of Events.
Variable [6] = Position X Player
# Variable [7] = Position Y Player
# Variable [8] = Position X Event
# Variable [9] = Position Y Even
If you only want them to be beside the event (positions 1 or 3), use this:
$game_variables[7] == $game_variables[9] and ($game_variables[6] - $game_variables[8]).abs == 1
which says if the y value is the same and there is a difference of 1 between the x values Note: abs = absolute value

If you want them to be on any of the 4 numbered tiles, use this:
($game_variables[6] - $game_variables[8]).abs + ($game_variables[7] - $game_variables[9]).abs == 1
which says there is a difference of 1 between the x values OR a difference of 1 between the y values # It is comparing the difference between the x position of the player and the tile of interest. Using abs lets me take one away from the other in any order and still end up with a positive number - it doesn't matter which has the # higher or lower x value. Then it does the same with the y position of the player and the tile of interest. Then it adds them together (+ means plus, not and). So if the sum of the x distance and the y distance between the two tiles is 1, it means the player is on a tile that is directly touching the tile of interest (and not corner-ways, as then the sum of the numbers would be 2)

Follower Move Route Option
$game_player.followers[n].force_move_route(move_route)
# 0 for first after actor, 1 for second after actor, etc.
2 Comments
RainbowBlade Feb 13, 2022 @ 1:09am 
I have some calls I've found.
In place of $game_party.members[0]...
$game_party.leader

With self switches, if for the same map, the map id can be omitted entirely.
For setting, and for checking via conditional branch.
$game_self_switches[[event, 'self_switch']] = value
$game_self_switches[[event, 'self_switch']] == value

wait(n) is actually msecs; 1,000 is equiv. of one second.

(see fadeout_all)

exit
(this works too)

Conditional Branch:
$game_party.members[0].equips[2] && $game_party.members[0].equips[2].is_a?(RPG::Armor)
That checks if the party member index has anything in that equip slot and if the equip is (according to the database) some kind of armor. Killo Zapit helped me with that one.

:papyruswacky:
Bukk94  [author] Feb 1, 2017 @ 4:07am 
I'm glad I could help you with this guide. But it's still missing some calls :P