Home > RGSS Script Reference > Global Variables
Global Variables
$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.
|
|
|