CBaseCombatWeapon

From Source Entities
Jump to navigation Jump to search

Code classes:

CBaseCombatWeapon is a base code class for all holdable weapon entities in Source. From here, each game typically derives into their own game-specific class.

Flags[edit | edit source]

  • 1: Start constrained - Makes the weapon not move. Bug: Does not work in some games.
  • 2: Deny player pickup (reserve for NPC) (only available in Hl2.png)
  • 4: Not puntable by Gravity Gun (only available in Hl2.png)

Inputs[edit | edit source]

HideWeapon (Not in FGD)
Attempts to make the weapon invisible. It may not disappear completely. Note: L4d2-small.pngJust makes the player take out the weapon again.

Outputs[edit | edit source]

Note: No outputs fire in L4d2-small.png.

OnPlayerUse
Fires when a player +uses this weapon. This doesn't necessarily mean the weapon was actually acquired.
OnPlayerPickup
Fires when a player picks up the weapon and is now able to actually use it as a weapon.
OnNPCPickup
Fires when the weapon is picked up by an NPC.
OnCacheInteraction
Fires when the player somehow proves they have found the weapon. Methods include entering the pickup radius, and punting with the gravity gunHl2.png.