mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-25 06:15:30 +03:00
Page:
Base Weapon
Pages
Base Animating
Base Combat Character
Base Entity
Base NPC
Base Weapon
Convar Lookup
Debug Commands
Drawing entities in specific view IDs
Entity List
Enum Reference
Filters
Frequently Asked Questions (FAQ)
Gameplay Changes
Graphical Changes
Home
How Mapbase can be used in specific settings
I O System Changes
Introduction to Mapbase
List of Modified Source Files
Map Compilers
Map Specific Scripts
Mapbase Credits
Mapbase Disclaimers
Mapbase Multi Tool
Mapbase Setup Troubleshooting
Media Resources
Modding with Mapbase
Prefabs and workarounds obsoleted by Mapbase
Projected textures
RPC Integration (Discord, etc.)
Reviewing Mapbase pull requests
Setting up Mapbase
Shader Changes
Skyboxes
Using Git with Mapbase
Using Mapbase Content
Using VScript as a HL2 mapper
VScript Basic Entity Code Tutorial
VScript Basic IO Tutorial
VScript Filters
VScript VScriptProxy
VScript in Mapbase
Wildcards and Matchers
math_lightpattern
2
Base Weapon
Blixibon edited this page 2019-11-02 17:25:33 -05:00
Table of Contents
This page lists changes to CBaseCombatWeapon
, which every weapon derives from. This means every weapon in the game technically possesses these changes, although some changes might only be relevant to a specific group of them.
Some I/O were already possible through other, more complicated means (e.g. keyvalues changed with AddOutput).
Inputs
- SetAmmo1
<integer>
- Sets the weapon's currently loaded primary ammo. - SetAmmo2
<integer>
- Sets the weapon's currently loaded secondary ammo. - GiveDefaultAmmo
<void>
- Resets the weapon's loaded ammo to "default", which is usually the max.
- EnablePlayerPickup
<void>
- Enables player pickup if it was disabled before. - DisablePlayerPickup
<void>
- Disables player pickup if it was enabled before. - EnableNPCPickup
<void>
- Enables NPC pickup if it was disabled before. - DisableNPCPickup
<void>
- Disables NPC pickup if it was enabled before.
- BreakConstraint
<void>
- If the weapon was set to start constrained, this input breaks its constraint.
- ForcePrimaryFire
<void>
- Forces the weapon to trigger its primary attack one time. This is supported on most guns, although implementation is weapon-specific and may function differently from weapon to weapon. - ForceSecondaryFire
<void>
- Forces the weapon to trigger its secondary attack one time. This is supported on most guns, although implementation is weapon-specific and may function differently from weapon to weapon.
Outputs
- OnDropped
<void>
- Fires when dropped by a NPC or player, passing the dropper as the activator.
KeyValues
- Ammo 1
<integer>
- Sets the weapon's currently loaded primary ammo. Requires the "Preserve ammo" spawnflag to function. - Ammo 2
<integer>
- Sets the weapon's currently loaded secondary ammo. Requires the "Preserve ammo" spawnflag to function.
Spawnflags
- Deny NPC pickup
8
- Prevents NPCs from automatically picking up a weapon. - Preserve ammo values when picked up
16
- Prevents the weapon from resetting its ammo values before being spawned, picked up, dropped, etc.
NPC/player interaction with weapons
Mapbase adds a bunch of weapon-related I/O/KV to NPCs and players, covered on the Base NPC and Base Player for NPC or player-specific changes and Base Combat Character for changes used by both types.
- Something Index
- Something special
- Something else