weapon

🚧 This article is a stub. You can help expand it by submitting content in pull requests or issues in this wiki's source repo.

Weapons are most commonly seen as the wieldable items dropped by enemies and found in the environment. However, they are also used for items like the CTF flag, oddball, and weapons attached to vehicles.

Weapons are intended to fire instances of the projectile tag, but they can technically reference any object (spawning bipeds, for example). Thrown grenades are not a type of weapon, but rather a projectile referenced by globals

Structure and fields #

This tag inherits fields from item which are not shown here. See the parent's page for more information. The following information is unique to the weapon tag.

Field Type Comments
weapon flags bitfield(32)
Flag Mask Comments
vertical heat display 0x1
mutually exclusive triggers 0x2
attacks automatically on bump 0x4
must be readied 0x8
doesn't count toward maximum 0x10
aim assists only when zoomed 0x20
prevents grenade throwing 0x40
must be picked up 0x80
holds triggers when dropped 0x100
prevents melee attack 0x200
detonates when dropped 0x400
cannot fire at maximum age 0x800
secondary trigger overrides grenades 0x1000
obsolete does not depower active camo in multilplayer 0x2000
enables integrated night vision 0x4000
ais use weapon melee damage 0x8000
label char[32]
secondary trigger mode enum
Option Value Comments
normal 0x0
slaved to primary 0x1
inhibits primary 0x2
loads alterate ammunition 0x3
loads multiple primary ammunition 0x4
maximum alternate shots loaded u16
weapon a in enum
Option Value Comments
none 0x0
heat 0x1
primary ammunition 0x2
secondary ammunition 0x3
primary rate of fire 0x4
secondary rate of fire 0x5
ready 0x6
primary ejection port 0x7
secondary ejection port 0x8
overheated 0x9
primary charged 0xa
secondary charged 0xb
illumination 0xc
age 0xd
integrated light 0xe
primary firing 0xf
secondary firing 0x10
primary firing on 0x11
secondary firing on 0x12
weapon b in enum
Option Value Comments
none 0x0
heat 0x1
primary ammunition 0x2
secondary ammunition 0x3
primary rate of fire 0x4
secondary rate of fire 0x5
ready 0x6
primary ejection port 0x7
secondary ejection port 0x8
overheated 0x9
primary charged 0xa
secondary charged 0xb
illumination 0xc
age 0xd
integrated light 0xe
primary firing 0xf
secondary firing 0x10
primary firing on 0x11
secondary firing on 0x12
weapon c in enum
Option Value Comments
none 0x0
heat 0x1
primary ammunition 0x2
secondary ammunition 0x3
primary rate of fire 0x4
secondary rate of fire 0x5
ready 0x6
primary ejection port 0x7
secondary ejection port 0x8
overheated 0x9
primary charged 0xa
secondary charged 0xb
illumination 0xc
age 0xd
integrated light 0xe
primary firing 0xf
secondary firing 0x10
primary firing on 0x11
secondary firing on 0x12
weapon d in enum
Option Value Comments
none 0x0
heat 0x1
primary ammunition 0x2
secondary ammunition 0x3
primary rate of fire 0x4
secondary rate of fire 0x5
ready 0x6
primary ejection port 0x7
secondary ejection port 0x8
overheated 0x9
primary charged 0xa
secondary charged 0xb
illumination 0xc
age 0xd
integrated light 0xe
primary firing 0xf
secondary firing 0x10
primary firing on 0x11
secondary firing on 0x12
ready time f32
heat recovery threshold Fraction: f32
  • Maximum: 1
overheated threshold Fraction: f32
  • Maximum: 1
heat detonation threshold Fraction: f32
  • Maximum: 1
heat detonation fraction Fraction: f32
  • Maximum: 1
heat loss per second Fraction: f32
  • Maximum: 1
heat illumination Fraction: f32
  • Maximum: 1
pad(16)
pad(8)
near reticle range f32 (world units)
far reticle range f32 (world units)
intersection reticle range f32
pad(2)
magnification levels u16
magnification range f32 (world units) (min & max)
autoaim angle Angle: f32
autoaim range f32 (world units)
magnetism angle Angle: f32
magnetism range f32 (world units)
deviation angle Angle: f32
pad(4)
movement penalized enum
Option Value Comments
always 0x0
when zoomed 0x1
when zoomed or reloading 0x2
pad(2)
forward movement penalty Fraction: f32
sideways movement penalty Fraction: f32
pad(4)
minimum target range f32
looking time modifier f32
pad(4)
light power on time f32 (seconds)
light power off time f32 (seconds)
age heat recovery penalty f32
age rate of fire penalty f32
age misfire start Fraction: f32
  • Maximum: 1
age misfire chance Fraction: f32
  • Maximum: 1
pad(12)
pad(4)
pad(12)
active camo ding f32
active camo regrowth rate f32
pad(12)
pad(2)
weapon type enum
Option Value Comments
undefined 0x0
shotgun 0x1
needler 0x2
plasma pistol 0x3
plasma rifle 0x4
more predicted resources Block?
PredictedResource
magazines Block?
Field Type Comments
flags bitfield(32)
Flag Mask Comments
wastes rounds when reloaded 0x1
every round must be chambered 0x2
rounds recharged u16
rounds total initial u16
rounds total maximum u16
rounds loaded maximum u16
pad(8)
reload time f32
rounds reloaded u16
pad(2)
chamber time f32
pad(8)
pad(16)
pad(12)
magazine objects Block?
Field Type Comments
rounds u16
pad(10)
triggers Block?
Field Type Comments
flags bitfield(32)
Flag Mask Comments
tracks fired projectile 0x1
random firing effects 0x2
can fire with partial ammo 0x4
does not repeat automatically 0x8
locks in on off state 0x10
projectiles use weapon origin 0x20
sticks when dropped 0x40
ejects during chamber 0x80
discharging spews 0x100
analog rate of fire 0x200
use error when unzoomed 0x400
projectile vector cannot be adjusted 0x800
projectiles have identical error 0x1000
projectile is client side only 0x2000
rounds per second f32 (min & max)
acceleration time f32
deceleration time f32
blurred rate of fire Fraction: f32
pad(8)
magazine Index (magazines)
rounds per shot u16
minimum rounds loaded u16
rounds between tracers u16
pad(6)
firing noise enum
Option Value Comments
silent 0x0
medium 0x1
loud 0x2
shout 0x3
quiet 0x4
error f32 (min & max)
error acceleration time f32
error deceleration time f32
pad(8)
charging time f32
charged time f32
overcharged action enum
Option Value Comments
none 0x0
explode 0x1
discharge 0x2
pad(2)
charged illumination f32
spew time f32
distribution function enum
Option Value Comments
point 0x0
horizontal fan 0x1
projectiles per shot u16
distribution angle f32
pad(4)
minimum error Angle: f32
error angle Angle: f32 (min & max)
first person offset
Point3D
  • x: f32
  • y: f32
  • z: f32
pad(4)
ejection port recovery time f32
illumination recovery time f32
pad(12)
heat generated per round Fraction: f32
  • Maximum: 1
age generated per round Fraction: f32
  • Maximum: 1
pad(4)
overload time f32 (seconds)
pad(8)
pad(32)
illumination recovery rate f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
ejection port recovery rate f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
firing acceleration rate f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
firing deceleration rate f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
error acceleration rate f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
error deceleration rate f32 (little endian?)
  • Only set when the tag is compiled into a map cache.
firing effects Block?
Field Type Comments
shot count lower bound u16
shot count upper bound u16
pad(32)

This information was partially generated using Invader tag definitions.

Acknowledgements

Thanks to the following individuals for their research or contributions to this topic:

  • Kavawuvi (Invader tag definitions)
  • MosesOfEgypt (Tag structure research)