Submit Your Article Guild Wars 2 Forum RPG Maker VX.com
 
RPG Maker
 

 Username:
 Password:
   Not a member? Register!



Home > RGSS Script Reference > Global Variables

Global Variables


This page covers the global variables you will find in the RGSS standard classes. Each variable's name, type, and function are listed.


$DEBUG
Type: Boolean
Function: This flag is set during test play, and not set otherwise. If you want something to only happen during test play, you should test for this flag and place the relevent code within that conditional.


$BTEST
Type: Boolean
Function: This flag is set during a battle test, and not set otherwise. Not particularly useful, since only part of the game data is loaded during a battle test.


$scene
Type: Scene_xxxx object
Function: This variable holds the current "scene" being processed by the engine. For instance, while the map is displayed, this variable will hold a Scene_Map object.


$game_temp
Type: Game_Temp object
Function: This object holds data that will only be used temporarily, and is then discarded. Examples include the text of the next message to be shown and flags that tell the game that a specific scene is being callled.


$game_system
Type: Game_System object
Function: This object holds system data that can be modified during gameplay. This includes data not in the $data_system object (described below), such as the current position of the message window, where the main menu/save menu/encounters are enabled or disabled, and the number of times the player has saved.


$game_switches
Type: Game_Switches object
Function: This object holds the values of the 5000 game switches. A switch that is OFF in the game is represented as false in scripts, while a switch that is ON is represented as true.


$game_variables
Type: Game_Variables object
Function: This object holds the values of the 5000 game variables. The values are represented in scripts exactly the same way as they are in the editor, as integers.


$game_self_switches
Type: Game_Self_Switches object
Function: This object holds the values of the 4 local switches in each event. In scripts, these values are represented as a hash table with the map ID/event number/switch letter as the keys and a boolean as the value.


$game_screen
Type: Game_Screen object
Function: This object holds data associated with the screen that isn't map-relative, such as weather information and screen effects such as shaking.


$game_actors
Type: Game_Actors object
Function: This object holds information about the characters. Some of it is loaded from the database, while some of it changes within the game, such as the character's current HP and SP, and current equipment.


$game_party
Type: Game_Party object
Function: This object holds information about the characters currently in the party. The party is comprised of Game_Actor objects, so the same information as described in the box above this one can be referenced, but this object allows for referencing by relative position within the party as opposed to by absolute ID number in the database.


$game_troop
Type: Game_Troop object
Function: This object holds information about the enemy group currently being fought by the party (this object is nil if the party isn't in battle). It contains information that varies throughout the battle, such as each enemy's HP, SP, and current stats.


$game_map
Type: Game_Map object
Function: This object holds information about the currently-loaded map, such as the passability of its tiles, the current panorama, the current fog, and which part of the map is being displayed onscreen.


$game_player
Type: Game_Player object
Function: This object holds information about the sprite you control. This object inherits from Game_Character, so all the relevant information that's tracked can be found in this class.


$data_actors
Type: Array of RPG::Actor objects (Read Only)
Function: This array holds the data for the various heros in your game. You can reference individual characteristics of each hero by referencing a specific property of the RPG::Actor object.

Syntax
@
@@
$
alias
[array index]
attr_accessor
attr_reader
attr_writer
class
def
do
ensure
for
if
[iterator]
key => value
new
next
nil
redo
require
return
rescue
self
super
undef
unless
until
while
yield

Classes
Arrow_Actor
Arrow_Base
Arrow_Enemy
Game_Actor
Game_Actors
Game_BattleAct
Game_Battler
Game_Character
Game_Common
Game_Enemy
Game_Event
Game_Map
Game_Party
Game_Picture
Game_Player
Game_Screen
Game_SlfSwitch
Game_Switches
Game_System
Game_Troop
Game_Variables
Interpreter
Scene_Debug
Scene_End
Scene_Equip
Scene_File
Scene_Gameover
Scene_Item
Scene_Load
Scene_Map
Scene_Menu
Scene_Name
Scene_Save
Scene_Shop
Scene_Skill
Scene_Status
Scene_Title
Sprite_Battler
Sprite_Character
Sprite_Picture
Sprite_Timer
Spriteset_Battle
Spriteset_Map
Window_Base
Window_Battleresult
Window_Battlestatus
Window_Command
Window_DebugLeft
Window_DebugRight
Window_EquipItem
Window_EquipLeft
Window_EquipRight
Window_Gold
Window_Help
Window_InputNumb
Window_Item
Window_MenuStatus
Window_Message
Window_NameEdit
Window_NameInput
Window_PartyCom
Window_PlayTime
Window_SaveFile
Window_Selectable
Window_ShopBuy
Window_ShopCom
Window_ShopNum
Window_ShopSell
Window_ShopStatus
Window_Skill
Window_SkillStatus
Window_Status
Window_Steps
Window_Target

Other
Class Hierarchy
Global Variables


RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

RPG RPG Revolution is an Privacy Policy and Legal