Skip to content

Weapon files

Aranud edited this page May 4, 2020 · 3 revisions

Weapon File

Legend of tags
field removed
field changed
field added

Weapon file scope structure

weaponDef {
	// This basically fills out weaponInfo_t
	client {
		standModel            ""
		droppedAnglesHack     
		pickupModel           ""
		pickupSound           ""
		weaponConfig          ""
		handsModel            ""
		flashDlightColor      R G B
		flashSound            "" *OR* X ""
		flashEchoSound        "" *OR* X ""
		lastShotSound         "" *OR* X ""
		readySound            ""
		firingSound           ""
		overheatSound         ""
		reloadSound           ""
		reloadFastSound       ""
		spinupSound           ""
		spindownSound         ""
		switchSound           ""
		noAmmoSound           ""
		weaponIcon            ""
		weaponIconScale       X
		weaponSelectedIcon    ""
		weaponSimpleIcon	  ""
		weaponSimpleIconScale X Y
		weaponCardIcon        ""
		weaponCardScale       X Y
		weaponCardPointS      X Y
		weaponCardPointT      X Y
		missileModel          ""
		missileSound          ""
		missileFallSound      "" *OR* X ""
		missileBounceSound {
			default "" *OR* X ""
			far     "" *OR* X ""
			wood    "" *OR* X ""
			metal   "" *OR* X ""
			roof    "" *OR* X ""
			gravel  "" *OR* X ""
			glass   "" *OR* X ""
			snow    "" *OR* X ""
			water   "" *OR* X ""
			flash   "" *OR* X ""
			carpet  "" *OR* X ""
		}
		missileTrailFunc    ""
		missileDlight       X Y Z
		missileDlightColor  R G B 
		ejectBrassFunc      ""
		ejectBrassOffset    X Y Z
		fireRecoil          P Y R
		adjustLean          P Y R
		modModel            X ""
		impactSound {
			default "" *OR* X ""
			far     "" *OR* X ""
			wood    "" *OR* X ""
			metal   "" *OR* X ""
			roof    "" *OR* X ""
			gravel  "" *OR* X ""
			glass   "" *OR* X ""
			snow    "" *OR* X ""
			water   "" *OR* X ""
			flash   "" *OR* X ""
			carpet  "" *OR* X ""
		}
		impactMark {
			default ""
			far     ""
			wood    ""
			metal   ""
			roof    ""
			gravel  ""
			glass   ""
			snow    ""
			water   ""
			flesh   ""
			carpet ""
		}
		firstPerson {
			model       ""
			flashModel  ""
			skin        ""
			axisskin    ""
			alliedskin  ""
			// weapon building
			// the parts are numbered because there are some hardcoded references for some weapons to certain parts
			weaponLink {
				part X {
					tag         ""
					model       ""
					skin        ""
					axisskis    ""
					alliedskin  ""
				}
			}
		}
		thirdPerson  {
			model       ""
			flashModel  ""
			skin        ""
			axisskis    ""
			alliedskin  ""
			// weapon building
			// the parts are numbered because there are some hardcoded references for some weapons to certain parts
			weaponLink {
				part X {
					tag         ""
					model       ""
					skin        ""
					axisskis    ""
					alliedskin  ""
				}
			}
		}
	}
}

client scope

standModel

Description Model for Weapon pickup 'stand'
Input Parameters Path to model (*.mdc ; *.md3)
Parameters type String
Scope weaponDef -client

droppedAnglesHack

Description Hack to modify the model angle when dropped. If this field is present, the hack is activate to modify drop angle by 90°
Input Parameters None
Parameters type None
Scope weaponDef -client

pickupModel

Description Model for Weapon pickup
Input Parameters Path to model file (*.mdc ; *.md3)
Parameters type String
Scope weaponDef -client

pickupSound

Description Sound played on pickup weapon
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

weaponConfig

Description Weapon configuration file containing animation setting
Input Parameters Path to configuratio file (*.cfg)
Parameters type String
Scope weaponDef -client

handsModel

Description Hands model used to hold weapon
Input Parameters Path to model (*.mdc ; *.md3)
Parameters type String
Scope weaponDef -client

flashDlightColor

Description Color of the flash on weapon fired
Input Parameters RGB color (r: red g: green b: blue) values as number represention x y z ranged [0-255]
Parameters type Float Vector 3 (x y z)
Scope weaponDef -client

flashSound

Description Weapon flash sounds on weapon fired. Supports up to 5 sounds
Input Parameters Path to sound file (*.wav)
OR
Number of flash sounds [1-5] + Path to sound files without extension (auto increment file name number [sound1.wav - sound5.wav])
Parameters type String OR Integer String
Scope weaponDef -client

flashEchoSound

Description Weapon flash echo sounds on weapon fired at far distance. Supports up to 5 sounds
Input Parameters Path to sound file (*.wav)
OR
Number of flash sounds [1-5] + Path to sound files without extension (auto increment file name number [sound1.wav - sound5.wav])
Parameters type String OR Integer String
Scope weaponDef -client

lastShotSound

Description Weapon last shot sounds on last ammunition fired. Supports up to 5 sounds
Input Parameters Path to sound file (*.wav)
OR
Number of flash sounds [1-5] + Path to sound files without extension (auto increment file name number [sound1.wav - sound5.wav])
Parameters type String OR Integer String
Scope weaponDef -client

readySound

Description An ambient sound the weapon makes when it's not firing
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

firingSound

{TODO} no weapons seem to use this, basically it's a replacement hum for readysound, but then when firing
Description Weapon firing sounds ... but not really
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

overheatSound

Description Weapon overheat sound
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

RealoadSound

Description Weapon overheat sound
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

reloadFastSound

Description Weapon reload fast sound. Some weapons have fast reloads due to the skill system
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

spinupSound

Description Weapon spinup sound. Started when fire button goes down, and stepped on when the first fire event happens
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

spindownSound

Description Weapon spindown sound. Called if spinup is running but player doesn't follow through and fire
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

switchSound

Description Weapon switch sound. Play an additional switch sound on top of default one
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

noAmmoSound

Description Weapon no ammo sound. Weapon is out of ammo
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

weaponIcon

Description Weapon icon used in HUD
Input Parameters Path to image file (*.tga)
Parameters type String
Scope weaponDef -client

weaponIconScale

Description Weapon icon scale. Multiplier coefficient
Input Parameters Scale number. Don't use number <= 0
Parameters type Integer
Scope weaponDef -client

weaponSelectedIcon

Description Highlight selected weapon icon used in HUD
Input Parameters Path to image file (*.tga)
Parameters type String
Scope weaponDef -client

weaponSimpleIcon

Description Simple weapon icon used to replace model weapon for pickup with "cg_simpleIcon 1"
Input Parameters Path to image file (*.tga)
Parameters type String
Scope weaponDef -client

weaponSimpleIconScale

Description Simple weapon icon scale
Input Parameters Width and height values x y
Parameters type Float Vector 2 (x, y)
Scope weaponDef -client

weaponCardIcon

Description Weapon card icon used in limbo panel
Input Parameters Path to image file (*.tga)
Parameters type String
Scope weaponDef -client

weaponCardScale

Description Weapon card scale used to scale the weapon icon from limbo panel in width and height
Input Parameters Width and height values x y
Parameters type Float Vector 2 (x, y)
Scope weaponDef -client

weaponCardPointS

Description Weapon card Point S. Coordinate of the starting points of the icon from limbo panel
Input Parameters 2D coordinate points values x y
Parameters type Float Vector 2 (x, y)
Scope weaponDef -client

weaponCardPointT

Description Weapon card Point S. Coordinate of the ending points of the icon from limbo panel
Input Parameters 2D coordinate points values x y
Parameters type Float Vector 2 (x, y)
Scope weaponDef -client

missileModel

Description Weapon missile model
Input Parameters Path to model file (*.md3 ; *.mdc)
Parameters type String
Scope weaponDef -client

missileSound

Description Weapon missile sound
Input Parameters Path to sound file (*.wav)
Parameters type String
Scope weaponDef -client

missileFallSound

Description sound effect for spotter round, had to do this as half-second bomb warning
Input Parameters Path to sound file (*.wav)
OR
Number of falling sounds [1-5] + Path to sound files without extension (auto increment file name number [sound1.wav - sound5.wav])
Parameters type String OR Integer String
Scope weaponDef -client

missileBounceSound

Description bouncing sound when a grenade hit a surface
Input Parameters Surface value [default, far, wood, metal, roof, gravel, glass, snow, water, flesh, carpet] + path to sound file (*.wav)
OR
Surface value [default, far, wood, metal, roof, gravel, glass, snow, water, flesh] + number of boucing sounds [1-5] + Path to sound files without extension (auto increment file name number [sound1.wav - sound5.wav])
Parameters type String String OR String Integer String
Parameters type String
Scope weaponDef -client

missileTrailFunc

Description Weapon trail function. Used to call internal function to drawn trail effect
Input Parameters Supports "GrenadeTrail", "RocketTrail", "PyroSmokeTrail" and "DynamiteTrail" (we REALLY want a particle system for this)
Parameters type String
Scope weaponDef -client

missileDlight

Description Weapon Dynamic light, radius light effect
Input Parameters Radius value
Parameters type Float
Scope weaponDef -client

missileDlightColor

Description Color of the missile dynamic light on missile fired
Input Parameters RGB color values as number represention r g b (r: red g: green b: blue) ranged [0-255]
Parameters type Float Vector 3 (r g b)
Scope weaponDef -client

ejectBrassFunc

Description Ejection brass function, used to call intenral function to drawn ejected brass
Input Parameters supports "MachineGunEjectBrass" and "PanzerFaustEjectBrass"
Parameters type String
Scope weaponDef -client

ejectBrassOffset

Description Starting offset point of ejected brass in third person view
Input Parameters 3D coordinate points x y z
Parameters type Float Vector 3 (x y z)
Scope weaponDef -client

fireRecoil

Description Offset value for weapon model kick back while firing
Input Parameters 3D coordinate points for pitch yaw and roll
Parameters type Float Vector 3 (pitch yaw roll)
Scope weaponDef -client

adjustLean

Description Adjust weapon position in first person view while leaning
Input Parameters 3D coordinate points for pitch yaw and roll
Parameters type Float Vector 3 (pitch yaw roll)
Scope weaponDef -client

modModel

Description Models used on top of the weapon model
Input Parameters Model Index + Path to model file (*.md3; *.mdc)
Parameters type Integer String
Scope weaponDef -client

impactSoundRange

Description Maximum range the impact sound can be heared relative to the player position
Input Parameters Range value
Parameters type Integer
Scope weaponDef -client

impactSoundRange

Description Maximum range the impact sound can be heared relative to the player position
Input Parameters Range value
Parameters type Integer
Scope weaponDef -client

impactFunction

Description Impact effect used to draw mark
Input Parameters supports "MeleeImpact", "BulletImpact", "SmallExplosionImpact", "BigExplosionImpact", "MapMortarImpact" and "DynamiteExplosionImpact"
Parameters type String
Scope weaponDef -client

impactSoundVolume

Description Initial volume on hit impact
Input Parameters Volume value range [0-255]
Parameters type Integer
Scope weaponDef -client

impactMarkRadius

Description Radius used to scale impact mark
Input Parameters Radius value
Parameters type Integer
Scope weaponDef -client

impactSound scope

impactSound

Description Define a sounds list depending of surface impacted. Each surface supports up to 5 hits sounds. Available surface are the following :
default when no sound are available for a specific surface
far echo on impact at far distance
wood impact on wood
metal impact on metal
roof impact on roof
gravel impact on gravel
glass impact on glass
snow impact on snow
water impact under water
flesh impact on player
carpet impact on carpet
Input Parameters Surface value [default, far, wood, metal, roof, gravel, glass, snow, water, flesh, carpet] + path to sound file (*.wav)
OR
Surface value [default, far, wood, metal, roof, gravel, glass, snow, water, flesh] + number of impact sounds [1-5] + Path to sound files without extension (auto increment file name number [sound1.wav - sound5.wav])
Parameters type String String OR String Integer String
Scope weaponDef -client -impactSound

impactMark scope

impactMark

Description Define a model list depending of surface impacted. Each surface supports 1 hits mark. Available surface are the following :
default when no mark are available for a specific surface
wood impact on wood
metal impact on metal
roof impact on roof
gravel impact on gravel
glass impact on glass
snow impact on snow
water impact under water
flesh impact on player
carpet impact on carpet
Input Parameters Surface value [default, far, wood, metal, roof, gravel, glass, snow, water, flesh, carpet] + path to shader file (*.tga)
Parameters type String String
Scope weaponDef -client -impactMark

firstPerson scope

model

Description Weapon model in first person view
Input Parameters Path to model (*.mdc ; *.md3)
Parameters type String
Scope weaponDef -client -firstPerson

flashmodel

Description Flash weapon model in first person view
Input Parameters Path to model (*.mdc ; *.md3)
Parameters type String
Scope weaponDef -client -firstPerson

skin

Description The skin of the model in first person view
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -firstPerson -

axisskin

Description The axis skin of the model in first person view
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -firstPerson -

alliesskin

Description The allies skin of the model in first person view
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -firstPerson -

weaponLink scope

part

Description Contain tag, model and skin ressource for additionnal part of the weapon model. Supports up to 6 part
Input Parameters Number of part [0 - 5]
Parameters type Integer
Scope weaponDef -client -firstPerson -weaponLink

part scope

tag

Description Name of the additional part
Input Parameters Tag name
Parameters type String
Scope weaponDef -client -firstPerson -weaponLink -part

model

Description The model of the additional part
Input Parameters Path to the model file (*.md3; *.mdc)
Parameters type String
Scope weaponDef -client -firstPerson -weaponLink -part

skin

Description The skin of the additional part
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -firstPerson -weaponLink -part

axisskin

Description The axis skin of the additional part
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -firstPerson -weaponLink -part

alliesskin

Description The allies skin of the additional part
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -firstPerson -weaponLink -part

thirdPerson scope

model

Description Weapon model in third person view
Input Parameters Path to model (*.mdc ; *.md3)
Parameters type String
Scope weaponDef -client -thirdPerson

flashmodel

Description Flash weapon model in third person view
Input Parameters Path to model (*.mdc ; *.md3)
Parameters type String
Scope weaponDef -client -thirdPerson

skin

Description The skin of the model in third person view
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -thirdPerson -

axisskin

Description The axis skin of the model in third person view
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -thirdPerson -

alliesskin

Description The allies skin of the model in third person view
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -thirdPerson -

weaponLink scope

part

Description Contain tag, model and skin ressource for additionnal part of the weapon model. Supports up to 6 part
Input Parameters Number of part [0 - 5]
Parameters type Integer
Scope weaponDef -client -thirdPerson -weaponLink

part scope

tag

Description Name of the additional part
Input Parameters Tag name
Parameters type String
Scope weaponDef -client -thirdPerson -weaponLink -part

model

Description The model of the additional part
Input Parameters Path to the model file (*.md3; *.mdc)
Parameters type String
Scope weaponDef -client -thirdPerson -weaponLink -part

skin

Description The skin of the additional part
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -thirdPerson -weaponLink -part

axisskin

Description The axis skin of the additional part
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -thirdPerson -weaponLink -part

alliesskin

Description The allies skin of the additional part
Input Parameters Path to the skin file (*.skin)
Parameters type String
Scope weaponDef -client -thirdPerson -weaponLink -part

Clone this wiki locally