Jump to content

User:MIDIMan/Ringslinger Revolution/Global variables

From SRB2 Wiki

This is a list of all pre-defined global variables and tables that are accessible in Ringslinger Revolution.

Please note that all variables must be accessed with the RSR namespace. For example to use MAX_HEALTH, it must be written as RSR.MAX_HEALTH to get the value of the variable.

Variables

This is a list of all non-table global variables.

Name Variable type Description
MAX_HEALTH number Maximum health that a player can have with normal health pickups (100).
MAX_ARMOR number Maximum armor that a player can have with normal armor pickups (100).
TRIGGER_HYPE number Minimum hype needed to turn super (1750).
MAX_HEALTH_BONUS number Maximum health that a player can have with bonus health pickups (200).
MAX_ARMOR_BONUS number Maximum armor that a player can have with bonus armor pickups (200).
MAX_HYPE number Maximum hype that a player can have (3000).
CRIT_EHP number Amount of effective hit points (health + armor) the player can go down to before activating critical healing (40).
SUPERCRIT_EHP number Amount of effective hit points (health + armor) the player can go down to before activating the critical healing cooldown (25).
CRIT_COOLDOWN number The cooldown time for critical healing when the player is at SUPERCRIT_EHP effective hit points and they heal above that amount (7*TICRATE).
CURRENT_BOSS mobj_t The currently active boss in the map.

Tables

This is a list of all global variables that are tables.

Name Array type Usage Description
GAMETYPE_INFO rsrgametypeinfo_t GAMETYPE_INFO[GT_NAME] This table is used to look up RSR-specfic info for a gametype, where GT_NAME is an integer that is expected to be the GT_* constant for the gametype in question.

Whole entries for GAMETYPE_INFO[] can be recreated from scratch if needed (see Userdata structures). It is recommended to use RSR.AddGametype to add RSR-specific info to the gametype (see Functions).

MOBJ_INFO rsrmobjinfo_t MOBJ_INFO[MT_NAME] This table is used to look up or modify attributes for a specific Object type, where MT_NAME is an integer that is expected to be the MT_* constant for the Object type in question. Example usage:
RSR.MOBJ_INFO[MT_RSR_PROJECTILE_RAIL].railring = true
local crawlaHealth = RSR.MOBJ_INFO[MT_BLUECRAWLA].health
Whole entires from MOBJ_INFO[] can be recreated from scratch if needed (see Userdata structures).
KILLFEED_DMG_INFO table KILLFEED_DMG_INFO[DMG_NAME] Converts a damage type number to a table corresponding to information used for the damage type in the killfeed. DMG_NAME is an integer that is expected to be the DMG_* constant for the damage type number in question. Each table can contain the following variables:
  • icon is a string denoting the graphic to use for the damagetype's icon in the killfeed.
  • obituaryMobj is a rsrobituaryinfo_t containing killfeed messages for when the player is killed by an Object-based hazard.
  • obituarySector is a rsrobituaryinfo_t containing killfeed messages for when the player is killed by a sector-based hazard (lasers, lava, etc.).
  • obituary is a rsrobituaryinfo_t containing killfeed messages for when the player is killed by any type of hazard.
POWERUP_INFO rsrpowerupinfo_t POWERUP_INFO[RSR.POWERUP_NAME] This table is used to look up or modify attributes for a specific powerup, where RSR.POWERUP_NAME is an integer that is expected to be the RSR.POWERUP_* constant for the powerup in question.

Whole entries for POWERUP_INFO[] can be recreated from scratch if needed (see Userdata structures).

SKIN_INFO rsrskininfo_t SKIN_INFO["skinname"] This table is used to look up and modify attributes for a specific skin, where skinname is the skin’s name attribute. See Userdata structures#rsrskininfo_t for more information.
AMMO_INFO rsrammoinfo_t AMMO_INFO[RSR.AMMO_NAME] This table is used to look up and modify attributes for a specific ammo type, where RSR.AMMO_NAME is an integer that is expected to be the AMMO_* constant for the ammo type in question.

Whole entries for AMMO_INFO[] can be recreated from scratch if needed (see Userdata structures).

WEAPON_INFO rsrweaponinfo_t WEAPON_INFO[RSR.WEAPON_NAME] This table is used to look up and modify attributes for a specific weapon type, where RSR.WEAPON_NAME is an integer that is expected to be the WEAPON_* constant for the ammo type in question.

Whole entries for WEAPON_INFO[] can be recreated from scratch if needed (see Userdata structures).