Jump to content

User:MIDIMan/Ringslinger Revolution/Userdata structures

From SRB2 Wiki
To do
Remove "v2.1 nightly" warnings when v2.1 gets released.

This article lists all the userdata types available in Ringslinger Revolution, as well as the variables they contain.

Info Structures

rsrinfo_t

This userdata type represents the properties of a player’s Ringslinger Revolution variables.

Name Type Description/Notes
health integer The player’s current amount of health. When the player is first spawned, this variable is set to RSR.MAX_HEALTH (100 by default).
armor integer The player’s current amount of armor. When the player is first spawned, this variable is set to RSR.MAX_ARMOR (100 by default).
armorPercent fixed_t
Currently only exists in v2.1 nightly.

Determines the percentage of damage to absorb when the player has armor. When the player is first spawned, this variable is set to the armorpercent value defined in RSR.SHIELD_INFO for SH_NONE (FRACUNIT/2 by default).

damagePercent fixed_t
Currently only exists in v2.1 nightly.

Determines the percentage of overall damage received by the player. When the player is first spawned, this variable is set to the damagepercent value defined in RSR.SHIELD_INFO for SH_NONE (FRACUNIT by default).

hurtByEnemy tic_t The player’s enemy hurt timer, or the amount of time left in tics until the player can take damage from enemies and other Object-based hazards.
hurtByMelee tic_t The player’s melee hurt timer, or the amount of time left in tics until the player can take damage from melee attacks done by other players.
hurtByMap tic_t The player’s level geometry hurt timer, or the amount of time left in tics until the player can take damage from level geometry.
attackKnockback boolean Determines whether the player was hurt while attempting to melee attack another player.
hitSound integer Determines what sound to play when the player attacks an opponent (should use RSR.HITSOUND_* constants).
deathFlags integer Determines how player death should be handled (should use RSR.DEATH_* constants).
attackerInfo rsrattackerinfo_t array A table containing the player's attackers and their damage outputs.
attackerTimer tic_t The player's timer for when they have been attacked by another player. If the timer is 0 and the player has been killed by an insta-kill obstacle in the level, points will not be awarded to players who assisted in damaging them.
knockedByAttacker boolean
Removed in v2.1 nightly.

Determines whether the player was knocked off of the level or not.

forceInflictorType enum (MT_*) The Object type of the Object that killed the player while they had a Force Shield.
forceInflictorReflected boolean Determines whether the Object that killed the player has reflected from another player with a Force Shield.
weapons[weaponname] boolean array A table used to determine which weapons the player has in their inventory, where weaponname is an integer expected to be a RSR.WEAPON_* constant. The table itself should not be directly reassigned, but entries in it can be accessed or modified.
ammo[ammoname] integer array A table containing the current amounts for all ammo types for the player, where ammoname is an integer expected to be an RSR.AMMO_* constant. The table itself should not be directly reassigned, but entries in it can be accessed or modified.
readyWeapon integer The player’s currently held weapon (should use RSR.WEAPON_* constants).
pendingWeapon integer The player’s currently pending weapon (should use RSR.WEAPON_* constants).
weaponDelay integer The current cooldown for the player's currently held weapon.
weaponDelayOrig integer The initial cooldown for the player’s currently held weapon.
powerups rsrpowerup_t array A table containing the player's current powerups.
hype integer The player's current "hype" value, for allowing them to transform into their super form.
starpostData rsrstarpostdata_t A table containing the player’s inventory when they pass a starpost. This variable is reset upon level change (unless the map’s level header has Lua.RSRKeepInv = true).
starpostNum integer The saved starpost number for the last checkpoint the player has touched. This is automatically set to the value of the player’s starpostnum if it differs from this variable’s value.
bob integer array A table containing x and y offsets for the player’s weapon on the HUD.
screenFade rsrscreenfade_t A table containing the color, translucency, and timer of the player’s screen fade.
homing integer The player’s homing timer, for CA_HOMINGTHOK. Basically the same as the player’s homing variable, but intended for when the player homes in on another player.
homingThreshold integer The player’s homing threshold. If the player is damaged while they are homing onto another player, this will increase by the damage taken, until a maximum is hit depending on how the player is homing onto the other player (Attraction Shield and/or homing thok).
basicCharge integer The player’s current charge of the Red Ring’s altfire.
basicChargeSound integer Counter for the player’s Charged Shot sound.
basicChargeDontTakeAmmo boolean Determines whether the Charged Shot should take ammo from the player or not.
scatterFlak mobj_t Points to the player’s last Mass Slug ring fired.
bounceMega mobj_t Points to the player’s last Goldburster ring fired.
waspTime tic_t The player's timer for the Homing Ring's altfire.
lastbuttons UINT16 The previous buttons pressed from player_t.cmd.buttons last tic. Mirrors player_t.lastbuttons.
lastexiting tic_t The player’s “exiting” timer from the last tic.
lastemeralds UINT16 The player’s player_t.powers[pw_emeralds] value from the last tic.
lastflag UINT16
Currently only exists in v2.1 nightly. Will be removed when SRB2 v2.2.16 comes out.

The player's gotflag value from the last tic.

useZoom boolean Determines whether the player’s FOV should be zoomed in or not.
fovZoom fixed_t The current value that the player’s fovadd variable should be set to.
critCooldown tic_t
Currently only exists in v2.1 nightly.

The player's cooldown timer for critical healing. If the timer is greater than 0, the player will not be able to receive bonus health from pickups when their health is less than 40.

ehpFlash rsrehpflash_t
Currently only exists in v2.1 nightly.

A table containing the color and timer of the player's EHP (effective hit points) HUD flash.

deathCamPos vector3_t or nil
Currently only exists in v2.1 nightly.

If not nil, this determines the position of the player's camera when they have died. Automatically set when the player is moving faster than RSR.DEATHCAM_SPEED_MAX.

rsrmobjinfo_t

This userdata type represents the properties of an Object type in Ringslinger Revolution.

Name Type Description/Notes
health integer The initial value of the rsrHealth variable for mobj_t.
damage integer The damage value dealt to the player on contact.
knockback fixed_t The knockback scale value dealt to the player on contact. If set to FRACUNIT, scale is 1.0x; If set to 2*FRACUNIT, scale is 2.0x, etc.
nothomable boolean If true, this Object type cannot be homed in on with a Homing Ring.
fulldamage integer The maximum damage dealt to a nearby Object from splash damage.
thrustdamage integer The knockback thrust dealt to the player from splash damage.
aimthrust boolean If true, this makes the Object type’s splash damage thrust the source Object in the direction they are facing. Currently only used by the Explosion Ring’s altfire.
dontreflect boolean If true, this Object type cannot be reflected by a Force Shield.
explosive boolean Determines if this Object type is explosive or not.
railring boolean Determines if this Object type is a rail ring or not.
sparklestate enum (MT_*) The state to use in place of the NiGHTS sparkles when exploding.
poweritem boolean If true, this Object type is a power item that takes 1.5x as long to respawn in Match modes.
nopainstate boolean If true, this prevents the enemy from entering their painstate when enough damage is taken.
painchance integer Makes the enemy enter their painstate in a chance out of 255. This should only be used for Doom-style enemies. Default is -1 (painchance doesn’t trigger painstate).
nosplashsightcheck boolean
Currently only exists in v2.1 nightly.

If true, this skips the sight check when RSR.Explode is used on this Object.

nosplashthrust boolean
Currently only exists in v2.1 nightly.

If true, this prevents the Object from being knocked back by explosions. Always enabled for bosses and monitors.

travelsound enum (sfx_*)
Currently only exists in v2.1 nightly.

Determines the sound to play when the Object type is running RSR.ProjectileTravelSound.

traveltimer tic_t
Currently only exists in v2.1 nightly.

The amount of time between playing the projectile's travelsound in tics.

alertsound enum (sfx_*)
Currently only exists in v2.1 nightly.

Determines the sound to player when the Object type is running RSR.ProjectileAlertSound.

alerttimer tic_t
Currently only exists in v2.1 nightly.

The amount of time between playing the projectile's alertsound in tics.

killfeedIcon string
Currently only exists in v2.1 nightly.

The graphic lump to use for the Object type in the icon killfeed.

killfeedName string
Currently only exists in v2.1 nightly.

The name to use for the Object type in the text killfeed. Unused.

killfeedObituary rsrobituaryinfo_t
Currently only exists in v2.1 nightly.

A table containing death messages to use for the Object type in the text killfeed.

rsrammoinfo_t

This userdata type represents the properties of an ammo type in Ringslinger Revolution.

Name Type Description/Notes
amount integer The amount of ammo to give the player.
maxamount integer The maximum amount of ammo to give the player.
motype enum (MT_*) The Object type used for pickups for this ammo type.

rsrweaponinfo_t

This userdata type represents the properties of a weapon type in Ringslinger Revolution.

Name Type Description/Notes
ammotype enum (AMMO_*) The ammo type to use for the weapon.
ammoamount integer The amount of ammo to give when the weapon is picked up.
ammoalt integer The amount of ammo used for the weapon’s altfire.
altzoom boolean If true, this weapon allows the player to zoom in using altfire.
canbepanel boolean If true, the pickup Object for this weapon can be a panel (gives more ammo to the player).
class integer The “class” of the weapon (must be a number from 1 through 7). Weapons in the same class are ordered based on classpriority.
classpriority integer Determines which weapon gets picked first when selecting a weapon class. Lower numbers give higher priority.
delay integer The recovery time for the weapon after it is fired.
delayspeed integer The recovery time for the weapon after it is fired, while the player has speed shoes.
delayalt integer The recovery time for the weapon’s altfire.
delayaltspeed integer The recovery time for the weapon’s altfire, while the player has speed shoes.
emerald integer The emerald that the weapon needs for its altfire (uses EMERALDn constants).
icon string The name of the graphic to use for the weapon in the weapon bar.
name string
Currently only exists in v2.1 nightly.

The name of the weapon.

namealt string
Currently only exists in v2.1 nightly.

The name of the weapon's altfire.

pickup enum (MT_*) The Object type to use when the player drops their weapon upon death.
powerweapon boolean If true, this prevents the weapon from showing up in the weapon bar if the player has no ammo for it (currently only used by the Rail Ring).
slot integer The “slot” of the weapon in its class. This is automatically set by RSR.AddWeapon.
states rsrweaponstates_t A table containing states for the given weapon.

rsrattackerinfo_t

This userdata type represents the properties of a player's attackers in Ringslinger Revolution.

Name Type Description/Notes
player player_t The player that attacked the victim.
damage integer The total amount of damage dealt to the victim by the player.

rsrpowerupinfo_t

This userdata type represents the properties of a powerup type in Ringslinger Revolution.

Name Type Description/Notes
icon string The icon graphic used for the powerup HUD display.
power integer The power to set for the player’s powers table (uses pw_* constants).
tics tic_t The initial value of the tics variable for rsrpowerup_t.

rsrskininfo_t

This userdata type represents the properties of a skin in Ringslinger Revolution.

Name Type Description/Notes
noweapons boolean If true, this disables Ringslinger Revolution’s weapon system for the current skin.
nodamage boolean If true, this disables Ringslinger Revolution’s player damage system for the current skin.
noenemydamage boolean If true, this disables Ringslinger Revolution’s enemy damage system for the current skin.
meleeicon string Name of the graphic to use for the melee killfeed icon for this character/skin.
hudmodname string Name of the modname used for the character/skin’s HUD in the Custom HUD library. Can be left blank if the character doesn’t have one.

rsrshieldinfo_t

Currently only exists in v2.1 nightly.

This userdata type represents the properties of a shield type in Ringslinger Revolution.

Name Type Description/Notes
icon string The graphic lump to use for the shield's icon.
name string The name of the shield (used for the text killfeed).
obituary string The message to display in the text killfeed when killed by a player with this shield.
meleedamage integer The damage dealt when meleeing a player while using the shield's ability.
armorpercent fixed_t The percentage of damage absorbed by a player's armor.
damagepercent fixed_t The percentage of overall damage dealt to a player.

rsrgametypeinfo_t

Currently only exists in v2.1 nightly.

This userdata type represents the properties of a gametype in Ringslinger Revolution.

Name Type Description/Notes
rsrrules boolean If true, the gametype will use RSR mechanics.
nosuper boolean If true, the gametype will prevent players from using their super form.

rsrobituaryinfo_t

Currently only exists in v2.1 nightly.

This userdata type contains obituary messages for the text killfeed.

Name Type Description/Notes
attacker string The message to display when a player was killed by another player.
hurtself string The message to display when a player killed themself.
solo string The message to display when a player was killed by a projectile without a source (or a dead source).

Miscellaneous

rsrweaponstates_t

This userdata type represents the states of weapon in Ringslinger Revolution.

Name Type Description/Notes
draw string The state that this weapon calls when the weapon is selected.
ready string The idle state for the weapon.
attack string The state that this weapon calls when the player uses the “Fire” button.
attackalt string The state that this weapon calls when the player uses the “Fire Normal” button. Only works if the player has the corresponding emerald for the weapon.

rsrpowerup_t

This userdata type represents a powerup in the player's inventory.

Name Type Description/Notes
powerup integer The powerup in the player’s inventory (uses POWERUP_* constants).
tics tic_t The powerup’s timer. When it reaches zero, the element it is attached to will be removed from this table.
penalty tic_t
Currently only exists in v2.1 nightly.

The time in tics to subtract from the time bonus when addTics is used in RSR.GivePowerup.

rsrstarpostdata_t

This userdata type represents data saved when passing a starpost.

Name Type Description/Notes
ammo[ammoname] integer A table containing the amounts for all ammo types for the player when they last passed a starpost, where ammoname is an integer expected to be an RSR.AMMO_* constant. The table itself should not be directly reassigned, but entries in it can be accessed or modified.
weapons[weaponname] boolean A table used to determine which weapons the player had in their inventory when they last passed a starpost, where weaponname is an integer expected to be a RSR.WEAPON_* constant. The table itself should not be directly reassigned, but entries in it can be accessed or modified.
readyWeapon integer The player’s held weapon when they last passed a starpost (should use RSR.WEAPON_* constants).
shields integer The shield that the player had when they last passed a starpost (uses SH_* constants).

rsrscreenfade_t

This userdata represents a screen fader.

Name Type Description/Notes
tics tic_t The screen fader’s timer. When it reaches zero, the screen fader stops.
origTics tic_t The initial value for the screen fader’s timer.
color tic_t The color of the screen fader (should use a palette index).
strength integer The opacity of the screen fader. Value ranges from 0 to FRACUNIT, where 0 is fully transparent, and FRACUNIT is fully opaque.

rsrehpflash_t

Currently only exists in v2.1 nightly.

This userdata represents an EHP (effective hit points) flasher on the player's HUD.

Name Type Description/Notes
tics tic_t The EHP flasher’s timer. When it reaches zero, the EHP stops flashing.
frequency tic_t Determines how frequent the EHP flash is. Larger values mean slower flashes.
color integer Determines the color of the EHP flash (V_* constants, chat colors only).

rsrkillfeedentry_t

Name Type Description/Notes
victim string The name of the victim/killed player.
inflictor string The name of the graphic lump to use for the inflictor in the icon killfeed.
infReflected boolean If true, the icon killfeed will display a Force Shield icon to signify this inflictor was reflected, and the text killfeed will specify the projectile as reflected.
attacker string The name of the attacker/killing player.
highlight boolean If true, this killfeed entry's background will be white instead of black on the icon killfeed.
skincolor enum (SKINCOLOR_*) The skin color of the attacker, if they exist.
distance integer
Currently only exists in v2.1 nightly.

The distance between the victim and their attacker in meters (56*FRACUNIT per meter).

tics tic_t The timer for the icon killfeed entry to stay on screen.

Vanilla Additions

player_t

Name Type Description/Notes
rsrinfo rsrinfo_t A table containing RSR info for the player.
psprites psprite_t array A table containing the player’s PSprites. See PSprites for more information.
rsrStarpostData rsrstarpostdata_t A copy of the player’s rsrinfo.starpostData, used when the player goes to a non-RSR Special Stage.
rsrPrevSkin integer The player’s previous skin number. Used for automatically toggling the character’s HUD.

mobj_t

Name Type Description/Notes
rsrProjectile boolean If true, this Object uses its Object type’s Damage property for P_DamageMobj.
rsrRealDamage boolean If true, this Object can deal a precise damage value with P_DamageMobj.
rsrDamage integer If set to a number, this Object will deal that amount of damage with P_DamageMobj.
rsrDontThrust boolean If true, this Object won’t cause damaged Objects to be thrusted back.
rsrForceReflected boolean If true, this Object won’t be reflected by a player’s Force Shield. This is automatically set to true when the Object hits a player with a Force Shield.
rsrIsThinker boolean If true, this Object is in the RSR.ENEMY_THINKERS table. This should not be messed with, or it will cause unintended side effects.
rsrEnemyBlink integer If set to a number, this Object will “blink” until its value reaches zero.
rsrHealth integer The current health value of an Object (presumably an enemy) in Ringslinger Revolution gametypes. This is automatically set when the Object first takes damage.
rsrSpawnHealth integer The spawn health value of an Object (presumably an enemy) in Ringslinger Revolution gametypes. This is automatically set when the Object first takes damage.
rsrKilled boolean Determines if the Object is dead. This is automatically set to true when the Object’s rsrHealth variable reaches zero in Ringslinger Revolution gametypes.
rsrGhostTimer integer The Object’s ghost spawning timer. Used by projectiles to spawn a ghost Object behind them.
rsrSoundTimer tic_t
Currently only exists in v2.1 nightly.

Timer for playing a projectile's traveling sound.

rsrAlertTimer tic_t
Currently only exists in v2.1 nightly.

Timer for playing a projectile's alert sound (when homing onto a player).

rsrChargeTravelSound boolean
Currently only exists in v2.1 nightly.

Determines if the Charged Shot should play its travel sound.

rsrIsPanel boolean If true, this Object (presumably a weapon pickup) acts as a panel (gives the player twice as much ammo as a non-panel pickup). This is automatically set to true if the pickup is flagged as a panel in the map.
rsrAmmoAmount integer If set to a number, this overrides how much ammo is given the player when the Object (presumably a weapon pickup) is picked up.
rsrDontRespawn boolean If set to true, this Object doesn’t disappear when collected in co-op.
rsrFloatOffset angle_t The y-offset for the item’s “floating” animation. This affects health, armor, and powerup items, as well as any Object that calls RSR.ItemFloatThinker.
rsrOrigScale fixed_t The scale of the Object when it was spawned. This is currently only used by the Goldburster and Mass Scrambler when spawning smaller projectiles.
rsrBounced integer The bounce counter for the Bounce Ring.
rsrPrevMomX fixed_t The Object’s X momentum in the previous tic.
rsrPrevMomY fixed_t The Object’s Y momentum in the previous tic.
rsrPrevMomZ fixed_t The Object’s Z momentum in the previous tic.
rsrLockOnSound boolean If true, this prevents the Homing Ring from playing the lock on sound more than once.
rsrRailHitList boolean array Table of Objects the Rail Ring has hit.
rsrRailHitCount integer
Currently only exists in v2.1 nightly.

The total number of players pierced through by a Rail Ring.

rsrRailCantPierce boolean
Currently only exists in v2.1 nightly.

If true, this prevents the Rail Ring from piercing through this Object.

rsrStrongBoxIcon mobj_t Points to the icon Object displayed by the strong random monitor.
rsrInfernoFire boolean
Currently only exists in v2.1 nightly.

Used by the player's spindust to check if they have a Flame Shield.

mapheader_t

Name Type Description/Notes
ringslingerrev string If true, the map is a Ringslinger Revolution map.
rsrkeepinv string If true, players will keep their weapons across levels in singleplayer and co-op.
rsrweaponstart string Determines what weapons the player starts with and how much ammo each weapon has.

Format example: Lua.RSRWeaponStart = "WEAPON1:50,WEAPON2:100"

rsrloseinvondeath string If true, players will lose their weapons upon death.
rsrwaves string If true, the map is a “Waves” map.
rsrwavestags string Determines what linedef tags are executed in specific waves in a “Waves” map.
rsrwavescount string
Currently only exists in v2.1 nightly.

Determines how many waves are in a "Waves" map. Default is 3.