Data Schema::Mech - Subject9x/battleMETAL GitHub Wiki
The following is the description for the main Unit variables that must be filled out for any unit to be used in battleMETAL. These values are set in the Unit's ini function, and are called first when a Unit will be spawned in.
void() data_ini_balaket_={
.data_idx = float : unique unit id
.vec_size = float : 1, 2, or 3 - this is an abstract value, used by various parts of the code as a super rough approximation of relative size of the item in-game.
.vec_name = string : name.
.max_health = float : the Center Torso's max health.
.mins = vector : '-X -Y -Z' = X is Left/Right | Y is Up/Down | Z is Forward/Back, negative values are for mins.
.maxs = vector : 'X Y Z' = X is Left/Right | Y is Up/Down | Z is Forward/Back.
.energyMax = float : Max amount of Energy the unit can charge up to.
.energyRate = float : Run every server tic, amount of Energy to increase the current energy by.
.shieldMax = float : Max amount of Shield points the unit can charge their shields up to.
.shieldRate = float : Run every server tic, amount of Shield to increase current Shields by.
.radar_range = float : Range of Unit's ACTIVE radar, PASSIVE is Active / 2. this is in 3D Game Units.
.w_firetime = float : Number of Seconds it takes to acquire a Target Lock onto the selected Target.
.spreadDefault = enum : [AI Only] Base Accuracy rating for the Unit, select 1 of the following-
- ACCURACY_PRIMITVE : really bad accuracy.
- ACCURACY_LOWTECH : mediocre, but workable.
- ACCURACY_SKIRMISH : the 'default'.
- ACCURACY_MARKSMAN : a notch above the default.
- ACCURACY_SNIPER : really good.
used by the AI for inaccuracy.
.data_speed_forward = float : Unit's Forward speed, not 1:1 to Game Units, play around with the value.
.data_speed_strafe = float : Unit's Strafing speed, not 1:1 to Game Units, play around with the value.
.data_speed_backward = float : Unit's Backward speed, not 1:1 to Game Units, play around with the value.
.data_speed_accel = float : Unit's Sprint multiplier.
.ramUpMax = float : Player-only value, how many seconds it takes to charge the Ram Shocks.
.ramCooldown = float : Player-only value, seconds for Ram Shocks to cool off after activation.
.legMoveRate = float : the multiplier for leg-animation playback in the client,
._legRunRate = float : same as legMoveRate but for when the Unit is Sprinting
. client/models/mech_legs.qc
.yaw_speed = float : [AI Only] How quickly can the Unit rotate around its Y-axis.
.turret_yaw_speed = float : [AI Only] How quickly can the Unit's Turret rotate around the Turret's Y-axis.
.ai_angleLimits = vector : [AI Only] the torso-twist max angles, Right-positive(X), Left-negative(Y), Z-value unused.
Mech Piece Data
data_ini_torso_center_( string , float, vector );
- string : path to model.
- float : health amount for this part.
- vector : 3D offset-from-unit-origin for the piece.
data_ini_torso_left_( string , float, vector );
data_ini_torso_right_( string , float, vector );
data_ini_arm_left_( string , float, vector );
data_ini_arm_right_( string , float, vector );
data_ini_legs_( string , float, vector );
Camera entity : Give the 3D offset-from-unit-origin for the Camera object.
ifdef CSQC
data_ini_camera( vector , self.torsoCenter); Client offsets are different from Server offsets
else
data_ini_camera( vector , self.torsoCenter); AI uses the Server offset for Line of Sight calculations
endif
Server Hardpoint Data
Just registers the mech piece on the server. data_ini_unitHardpoint_1( enum, vector, vector, float, bit flags );
- enum : which part to attach this hardpoint to -
- M_TOR_CENTER
- M_TOR_LEFT
- M_TOR_RIGHT
- M_ARM_LEFT
- M_ARM_RIGHT
- vector : 3D offset-from-unit-origin.
- vector : Pitch / Yaw / Roll angle adjustment for weapon in hardpoint.
- float : Weapon Size restriction.
- bit flags : See Game Data - Damage and Effect Types. max of 9 weapon hardpoints allowed.
Client-side Hardpoint Data
It roughly matches how parts are made on the Server, but there's an important difference when adding FL_CLIENT
arm hardpoint.
data_ini_unitHardpoint_1( enum, vector, vector, float, bit flags );
- enum : which part to attach this hardpoint to -
- M_TOR_CENTER
- M_TOR_LEFT
- M_TOR_RIGHT
- M_ARM_LEFT
- M_ARM_RIGHT
- vector : 3D offset-from-unit-origin.
- vector : Pitch / Yaw / Roll angle adjustment for weapon in hardpoint.
- float : Weapon Size restriction.
- bit flags : See Game Data - Damage and Effect Types. max of 9 weapon hardpoints allowed.
note: Client arms can aim up and down, so we bolt the weapons directly to the parent. see client/network/receive_sendent_player.predraw_player_weapon()
HUD data
note: View Bob values are disabled as of Beta 2 v1.0.0
.pitchMax = float : max upward pitch angle for player view.
.pitchMin = **float ** : downward pitch limit, use a negative (-) number.
.weaponmodel = string : path to hud model (replaces the Quake-style weapon model)
.hud_rollangle = string : [float] roll angle of player view when they are strafing Left / Right.
.hud_bob = string : [float] view bobbing amount.
.hud_bob_cycle = string : [float] view bobbing speed.
.hud_bob_up = string; [float] view bobbing adjustment that makes the up/down swing of the bob last longer.
.hud_bob_model = "1"; 1 or 0 (True/False) whether to have the viewmodel bob up-and-down.
.hud_bob_side = "0.09"; [float] bobbing sideways sway amount.
.hud_bob_speed = "6"; [float] view bobbing speed of viewmodel.
UI Data
Used by the CSQC-Menu system for displaying data.
.abbrev = string .description = string : displays fluff text of the unit in the UI menus. use '| |' for line breaks, and the menu will wrap text as well. .icon = string : path to unit image for UI menus.
This next set of data is for the Arming Menu. This gives the offsets for every hardpoint in the hardpoint graph. These values are derived by X/1244 and Y/960 (which is the same way that the responsive UI works in gui_api.qc
)
local entity hardpnt; hardpnt = self.w_slot; hardpnt.uiOffset = '-85 25'; //#1
hardpnt = hardpnt.w_slot; hardpnt.uiOffset = '85 25'; //#2
hardpnt = hardpnt.w_slot; hardpnt.uiOffset = '12 -50';//#3
hardpnt = hardpnt.w_slot; hardpnt.uiOffset = '-50 -18.0';//#4
hardpnt = hardpnt.w_slot; hardpnt.uiOffset = '50 -18.0'; //#5
};