Help - Search - Members - Calendar
Full Version: Event/Script Reference List
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
Helios
I found the original page here:
http://daiambition.web.fc2.com/rgsstop.html

And decided to translate it. It's really helpful to those who are not familiar with scripting but also wanted to do some advanced eventing.

Credit goes to DAIpage.

Basic
CODE
#The basic ones, usually used with variables, like $game_variables[1] == $game_party.gold

$game_actors[1].name
# Return name of actor #1

$game_actors[1].class_id
# Return class id of actor #1

$game_actors[1].class_name
# Return class name of actor #1

$game_actors[1].level
# Return level of actor #1

$game_actors[1].index
# Return party position of actor #1
(Note: first = 0, second = 1, etc)

$game_actors[1].maxhp
# Return max hp of actor #1

$game_actors[1].hp
# Return hp of actor #1

$game_actors[1].maxmp
# Return max mp of actor #1

$game_actors[1].mp
# Return mp of actor #1

$game_actors[1].atk
# Return atk of actor #1

$game_actors[1].def
# Return def of actor #1

$game_actors[1].spi
# Return spi of actor #1

$game_actors[1].agi
# Return agi of actor #1

$game_actors[1].eva
# Return evasion of actor #1

$game_actors[1].cri
# Return critical rate of actor #1

$game_actors[1].odds
# Return attacked odds actor #1

$game_actors[1].weapon_id
# Return weapon id of actor #1

$game_actors[1].armor1_id
# Return armor 1 id (shield) of actor #1

$game_actors[1].armor2_id
# Return armor 2 id (head) of actor #1

$game_actors[1].armor3_id
# Return armor 3 id (body) of actor #1

$game_actors[1].armor4_id
# Return armor 4 id (accessory) of actor #1

$game_party.members[0]
# Return the first party member

(Note: first = 0, second = 1, etc)
$game_party.members[0].id
# Return actor id of the first party member
(Note: first = 0, second = 1, etc)

$game_party.members[0].name
# Return name of the first party member
(Note: first = 0, second = 1, etc)

$game_party.gold
# Return amount of gold owned
  
$game_party.name
# Return name of the party
(By default it will display "[First Party Member]'s Party", you may change this in the script "Vocab")

$game_party.steps
# Return amount of steps walked

$game_party.item_number($data_items[1])
# Return amount of item #1 owned

$game_party.item_number($data_weapons[1])
# Return amount of weapon #1 owned
  
$game_party.item_number($data_armors[1])
# Return amount of armor #1 owned

$game_party.max_level
# Return highest level of the party

$game_party.members.size
# Return size of your party

$game_party.dead_members.size
# Return size of incapacitated members in your party

$game_troop.members[0]
# Return the first enemy

$game_system.save_count
# Return how many time you saved game

$game_system.timer / Graphics.frame_rate
# Return remaining time of timer

Graphics.frame_count /
Graphics.frame_rate
# Return played time

$game_system.save_disabled
# Return if save is disabled
(true = you can NOT save, false = you can save)

$game_message.visible
# Return if any message(dialog) is showing

$game_temp.in_battle
# Return in battle or not

$game_troop.members.size
# Return number of enemies

$game_map.map_id
# Return id of current map

$game_map.width
# Return width of current map

$game_map.height
# Return height of current map


Event Command
CODE
   $game_switches[1] ^= true
     #Invert switch #1
     (If it's ON then turn it OFF, if it's OFF then turn it ON)
  
   $game_self_switches[[1, 2, "A"]]= true
     #Turn ON  self switch A of Map 1, event 2
   (use @map_id for current map id)
  
   $game_self_switches[[1, 2, "A"]] ^= true
     #Invert  self switch A of Map 1, event 2
  
   $game_party.remove_actor(1)
   #Remove actor id #1 from the party.
  
   $game_party.add_actor(1)
     #Add actor id #1 to the party.
  
   $game_party.members[0].atk += 100
     #Increase the first party member's ATK for 100
   (Same for atk,def,spi,agi,maxhp,maxmp,hp,mp)
  
   $game_map.events[1].start
     #Force start event #1
  
   for event in $game_map.events_xy(1, 2)
        event.start
   end
     #Force start the event on coordinate X:1 Y:2
  
   $game_party.gain_gold(100)
     #Gain 100 gold
  
   $game_party.lose_gold(100)
       #Lose 100 gold
  
   for i in [4,6,7,9,11,12]
        $game_map.events[i].erase
     end
   #Temporarily remove event of id 4,6,7,9,11,12
  
    map_id = @map_id
       for event in  $game_map.events.values
       id =  event.id
         if $game_self_switches[[map_id, id,  "A"]] == true
         event.balloon_id  =  1
         end
       end
   #Display balloon 1 for every event on the map with self switch A ON.
   (You may change the contents of this snippet for desired effect)


Conditional Branch Command
CODE
   $game_party.item_number($data_items[1])   ==  $game_variables[2]
   #Number of item #1 = variable #2?
  
   $game_party.item_number($data_items[1])   >=  $game_variables[2]
   #Number of item #1 >= variable #2?
  
   $game_party.item_number($data_items[1])  <=  $game_variables[2]
     #Number of item #1 <= variable #2?
  
   $game_party.actors.size == 1
     #Party size = 1?
  
   $game_party.all_dead?
     #Every party member is incapacitated?
  
   $game_party.gold == $game_variables[1]
   #Amount of gold = variable #1?
   (Same for >= and <=)
  
   $game_party.actors[0].skill_can_use?(2)
   #Can the first party member use skill #2?
  
   $game_actors[1].skills.size == 2
   #Does actor #1 have 2 skills?
   (Same for >= and <=)
  
   $game_actors[1].equippable?($data_weapons[2])
   #Can actor #1 equip weapon #2?
  
   $game_actors[1].equippable?($data_armors[2])
   #Can actor #1 equip armor #2?
  
   $game_switches[1] && $game_switches[2]
     #Is switch#1 and switch#2 both ON?
  
   $game_switches[1] && !$game_switches[2]
     #Is switch#1 ON and switch#2 OFF?
     (Notice the ! before $game_switches[2])
  
   $game_switches[$game_variables[1]] == true
     #Is switch#[variable#1] ON?
   (Use variable to designate a switch)
  
   $game_variables[1] >= 2 && $game_variables[1] <  5
     #Is variable#1 >=2 but <5?
  
   $game_variables[1] % 2 == 1
     #Is variable#1 odd?
  
   $game_map.events[@event_id].direction ==  $game_player.direction
   #Is the current event facing the same direction as the player?
  
   $game_player.moving?
   #Is player moving?
  
   $game_temp.in_battle
   #Is player in battle?
  
   $game_system.timer_working
   #Is the timer ticking?
  
   $game_party.existing_members.size == 1  
   #Is there only one survivor?
  
   $game_message.visible
   #Is the message(dialog) showing?
  
   $game_map.interpreter.running?
   #Is event running?
  
   Input.press?(Input::C)
   #Is C key been pressed?
  
   Input.trigger?(Input::C)
     #Is C key just been pressed? (Not counting press and hold)
  
   Input.repeat?(Input::C)
     #Is C key just been pressed? (Counting press and hold)
  
   $game_map.passable?(1, 2)
     #Is coordinate X:1 Y:2 passable?
  
   $game_player.pos?(0, 0)
     #Is player on coordinate X:1 Y:2?


PS: I'm not so sure about the Input part, any correction would be welcome.
heisenman
Oh a list of things that could be useful for script calls and conditional branches. Neat (:
I use a few that maybe someone might find useful as well.


CODE
$game_message.busy == true/false

I use this not to run certain parallel processes when there's text showing.

CODE
$game_map.screen.weather_type == 1

And this one to check what's the weather like. Compatible with Darkleo/Ccoa weather script.
lilcooldude69
D: this is awesome, i never thought about searching for something like this XD
Isabella8688
QUOTE (Helios @ Feb 26 2012, 08:05 AM) *
I found the original page here:
http://daiambition.web.fc2.com/rgsstop.html

And decided to translate it. It's really helpful to those who are not familiar with scripting but also wanted to do some advanced eventing.

Credit goes to DAIpage.

Basic
CODE
#The basic ones, usually used with variables, like $game_variables[1] == $game_party.gold

$game_actors[1].name
# Return name of actor #1

$game_actors[1].class_id
# Return class id of actor #1

$game_actors[1].class_name
# Return class name of actor #1

$game_actors[1].level
# Return level of actor #1

$game_actors[1].index
# Return party position of actor #1
(Note: first = 0, second = 1, etc)

$game_actors[1].maxhp
# Return max hp of actor #1

$game_actors[1].hp
# Return hp of actor #1

$game_actors[1].maxmp
# Return max mp of actor #1

$game_actors[1].mp
# Return mp of actor #1

$game_actors[1].atk
# Return atk of actor #1

$game_actors[1].def
# Return def of actor #1

$game_actors[1].spi
# Return spi of actor #1

$game_actors[1].agi
# Return agi of actor #1

$game_actors[1].eva
# Return evasion of actor #1

$game_actors[1].cri
# Return critical rate of actor #1

$game_actors[1].odds
# Return attacked odds actor #1

$game_actors[1].weapon_id
# Return weapon id of actor #1

$game_actors[1].armor1_id
# Return armor 1 id (shield) of actor #1

$game_actors[1].armor2_id
# Return armor 2 id (head) of actor #1

$game_actors[1].armor3_id
# Return armor 3 id (body) of actor #1

$game_actors[1].armor4_id
# Return armor 4 id (accessory) of actor #1

$game_party.members[0]
# Return the first party member

(Note: first = 0, second = 1, etc)
$game_party.members[0].id
# Return actor id of the first party member
(Note: first = 0, second = 1, etc)

$game_party.members[0].name
# Return name of the first party member
(Note: first = 0, second = 1, etc)

$game_party.gold
# Return amount of gold owned
  
$game_party.name
# Return name of the party
(By default it will display "[First Party Member]'s Party", you may change this in the script "Vocab")

$game_party.steps
# Return amount of steps walked

$game_party.item_number($data_items[1])
# Return amount of item #1 owned

$game_party.item_number($data_weapons[1])
# Return amount of weapon #1 owned
  
$game_party.item_number($data_armors[1])
# Return amount of armor #1 owned

$game_party.max_level
# Return highest level of the party

$game_party.members.size
# Return size of your party

$game_party.dead_members.size
# Return size of incapacitated members in your party

$game_troop.members[0]
# Return the first enemy

$game_system.save_count
# Return how many time you saved game

$game_system.timer / Graphics.frame_rate
# Return remaining time of timer

Graphics.frame_count /
Graphics.frame_rate
# Return played time

$game_system.save_disabled
# Return if save is disabled
(true = you can NOT save, false = you can save)

$game_message.visible
# Return if any message(dialog) is showing

$game_temp.in_battle
# Return in battle or not

$game_troop.members.size
# Return number of enemies

$game_map.map_id
# Return id of current map

$game_map.width
# Return width of current map

$game_map.height
# Return height of current map


Event Command
CODE
   $game_switches[1] ^= true
     #Invert switch #1
     (If it's ON then turn it OFF, if it's OFF then turn it ON)
  
   $game_self_switches[[1, 2, "A"]]= true
     #Turn ON  self switch A of Map 1, event 2
   (use @map_id for current map id)
  
   $game_self_switches[[1, 2, "A"]] ^= true
     #Invert  self switch A of Map 1, event 2
  
   $game_party.remove_actor(1)
   #Remove actor id #1 from the party.
  
   $game_party.add_actor(1)
     #Add actor id #1 to the party.
  
   $game_party.members[0].atk += 100
     #Increase the first party member's ATK for 100
   (Same for atk,def,spi,agi,maxhp,maxmp,hp,mp)
  
   $game_map.events[1].start
     #Force start event #1
  
   for event in $game_map.events_xy(1, 2)
        event.start
   end
     #Force start the event on coordinate X:1 Y:2
  
   $game_party.gain_gold(100)
     #Gain 100 gold
  
   $game_party.lose_gold(100)
       #Lose 100 gold
  
   for i in [4,6,7,9,11,12]
        $game_map.events[i].erase
     end
   #Temporarily remove event of id 4,6,7,9,11,12
  
    map_id = @map_id
       for event in  $game_map.events.values
       id =  event.id
         if $game_self_switches[[map_id, id,  "A"]] == true
         event.balloon_id  =  1
         end
       end
   #Display balloon 1 for every event on the map with self switch A ON.
   (You may change the contents of this snippet for desired effect)


Conditional Branch Command
CODE
   $game_party.item_number($data_items[1])   ==  $game_variables[2]
   #Number of item #1 = variable #2?
  
   $game_party.item_number($data_items[1])   >=  $game_variables[2]
   #Number of item #1 >= variable #2?
  
   $game_party.item_number($data_items[1])  <=  $game_variables[2]
     #Number of item #1 <= variable #2?
  
   $game_party.actors.size == 1
     #Party size = 1?
  
   $game_party.all_dead?
     #Every party member is incapacitated?
  
   $game_party.gold == $game_variables[1]
   #Amount of gold = variable #1?
   (Same for >= and <=)
  
   $game_party.actors[0].skill_can_use?(2)
   #Can the first party member use skill #2?
  
   $game_actors[1].skills.size == 2
   #Does actor #1 have 2 skills?
   (Same for >= and <=)
  
   $game_actors[1].equippable?($data_weapons[2])
   #Can actor #1 equip weapon #2?
  
   $game_actors[1].equippable?($data_armors[2])
   #Can actor #1 equip armor #2?
  
   $game_switches[1] && $game_switches[2]
     #Is switch#1 and switch#2 both ON?
  
   $game_switches[1] && !$game_switches[2]
     #Is switch#1 ON and switch#2 OFF?
     (Notice the ! before $game_switches[2])
  
   $game_switches[$game_variables[1]] == true
     #Is switch#[variable#1] ON?
   (Use variable to designate a switch)
  
   $game_variables[1] >= 2 && $game_variables[1] <  5
     #Is variable#1 >=2 but <5?
  
   $game_variables[1] % 2 == 1
     #Is variable#1 odd?
  
   $game_map.events[@event_id].direction ==  $game_player.direction
   #Is the current event facing the same direction as the player?
  
   $game_player.moving?
   #Is player moving?
  
   $game_temp.in_battle
   #Is player in battle?
  
   $game_system.timer_working
   #Is the timer ticking?
  
   $game_party.existing_members.size == 1  
   #Is there only one survivor?
  
   $game_message.visible
   #Is the message(dialog) showing?
  
   $game_map.interpreter.running?
   #Is event running?
  
   Input.press?(Input::C)
   #Is C key been pressed?
  
   Input.trigger?(Input::C)
     #Is C key just been pressed? (Not counting press and hold)
  
   Input.repeat?(Input::C)
     #Is C key just been pressed? (Counting press and hold)
  
   $game_map.passable?(1, 2)
     #Is coordinate X:1 Y:2 passable?
  
   $game_player.pos?(0, 0)
     #Is player on coordinate X:1 Y:2?


PS: I'm not so sure about the Input part, any correction would be welcome.


Such a very amazing link!
__________________
Watch John Carter Online Free
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.