weaponbox

From Valve Developer Community
Jump to navigation Jump to search
Source Engine ( Half-Life: Source | Black Mesa )
Edit Tabs
C++ Class hierarchy
CWeaponBox
↳CBaseEntity
C++ weapons.cpp

weaponbox is a point entity available in all GoldSrc GoldSrc games except Ricochet Ricochet. It is a capsule with ammo and weapons inside of it. It can be found in Deathmatch or in the chapter "Xen" and beyond it. However, it does not respawn in multiplayer.
The vanilla FGD entry for this entity has no keyvalues listed. Turn off SmartEdit and add the weapon/ammo name as the key and the amount as the value for it to work as intended.

List of the supported ammunition types:

Half-Life Half-Life, Half-Life: Opposing Force Half-Life: Opposing Force, Half-Life: Blue Shift Half-Life: Blue Shift
  • 9mm
  • buckshot
  • 357
  • ARgrenades
  • Hand Grenade
  • Trip Mine
  • bolts
  • uranium
  • Satchel Charge
  • Hornets
  • rockets
  • Snarks
  • Penguins (only in Half-Life: Opposing Force)
  • 556 (only in Half-Life: Opposing Force)
  • 762 (only in Half-Life: Opposing Force)
  • spores (only in Half-Life: Opposing Force)
  • shock (only in Half-Life: Opposing Force)
Deathmatch Classic Deathmatch Classic
  • shells
  • nails
  • rockets
  • cells
Warning.pngWarning: Make sure you capitalize the string exactly as showcased above, or else it won't work!

Improved FGD code

The following FGD entry, which only works in J.A.C.K. J.A.C.K. (due to needing quoted keyvalues), will allow setting ammo without using SmartEdit.

Todo: SmartEdit names
Half-Life Half-Life
@PointClass size(-16 -16 0, 16 16 64) color(0 128 0) studio("models/w_weaponbox.mdl") base(Targetname,Angles,Appearflags,RenderFields) = weaponbox : "Weapon/Ammo Container."
[
	357(integer)
	9mm(integer)
	ARgrenades(integer)
	bolts(integer)
	buckshot(integer)
	"Hand Grenade"(integer)
	Hornets(integer)
	"Satchel Charge"(integer)
	Snarks(integer)
	"Trip Mine"(integer)
	uranium(integer)
]
Half-Life: Opposing Force Half-Life: Opposing Force
@PointClass size(-16 -16 0, 16 16 64) color(0 128 0) studio("models/w_weaponbox.mdl") base(Targetname,Angles,Appearflags,RenderFields) = weaponbox : "Weapon/Ammo Container."
[
	357(integer)
	9mm(integer)
	ARgrenades(integer)
	bolts(integer)
	buckshot(integer)
	"Hand Grenade"(integer)
	Hornets(integer)
	"Satchel Charge"(integer)
	Snarks(integer)
	"Trip Mine"(integer)
	uranium(integer)
	Penguins(integer)
	556(integer)
	762(integer)
	spores(integer)
	shock(integer)
]
Deathmatch Classic Deathmatch Classic
@PointClass size(-16 -16 0, 16 16 64) color(0 128 0) studio("models/w_weaponbox.mdl") base(Targetname,Angles,Appearflags,RenderFields) = weaponbox : "Weapon/Ammo Container."
[
	shells(integer)
	nails(integer)
	rockets(integer)
	cells(integer)
]

External links