weapon_smg1

From Valve Developer Community
Jump to: navigation, search
English (en)
W smg1.PNG
class hierarchy
CWeaponSMG1 defined in weapon_smg1.cpp
CHLSelectFireMachineGun
CHLMachineGun
CBaseHLCombatWeapon
CBaseCombatWeapon
CBaseAnimating
CBaseEntity

weapon_smg1 is a point entity available in Half-Life 2 Half-Life 2, Half-Life 2: Episode One Half-Life 2: Episode One, Half-Life 2: Episode Two Half-Life 2: Episode Two, Half-Life 2: Deathmatch Half-Life 2: Deathmatch, and Half-Life 2: Lost Coast Half-Life 2: Lost Coast.

An automatic machine gun based off the Wikipedia icon MP7. When first picked up, the player is given 90 bullets. Up to 270 bullets and three alt-fire grenades can be carried (including 45 loaded into the weapon). A box of bullets can be placed with item_ammo_smg1 or item_ammo_smg1_large, while grenades can be placed with item_ammo_smg1_grenade.

Before it is picked up, the gun also follows all physics rules as if it were a prop_physics.

Placement guide

Stub

This article or section is a stub. You can help by adding to it.

Half-Life 2 Half-Life 2/Half-Life 2: Episode One Half-Life 2: Episode One/Half-Life 2: Episode Two Half-Life 2: Episode Two:

In the main Half-Life 2 series, this weapon is usually best utilized in close to medium ranged firefights. Ammo is frequent in HL2/EP1, as it is the weapon of choice for CP units and soldiers. In EP2, ammo is less frequent as the player should encounter much less combine forces, however rebel establishments like white forest should have bountiful supplies of ammo. In all games, close combat areas should put a balanced emphasis on Shotgun and SMG usage.

Half-Life 2: Deathmatch Half-Life 2: Deathmatch:

Blank image.pngTodo:

Entropy : Zero Entropy : Zero/Entropy : Zero 2 Entropy : Zero 2:

In the Entropy : Zero series, this weapon has been given a significant increase to both damage and recoil, giving a heavier emphasis on close-range fights. Ammo is somewhat frequent, as most rebels use the SMG. The player should have a fair amount of SMG ammunition at all times.

Keyvalues

BaseFadeProp:

Start Fade Dist (fademindist) <float>
Distance at which the entity starts to fade.
End Fade Dist (fademaxdist) <float>
Max fade distance at which the entity is visible.
  • If start fade is <0, the entity will disappear instantly when end fade is hit.
  • If end fade is <0, the entity won't disappear at all. (This is the default behavior.)
The values will scale appropriately if the entity is in a 3D Skybox.
Fade Scale (fadescale) <float>
If you specify so in worldspawn, or if the engine is running below DirectX 8 (DX7 in Source 2006), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, while those greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command $noforcedfade.
Garry's Mod Garry's Mod keyvalues
GMODSandbox:
Allow Physics Gun (gmod_allowphysgun) <boolean> (only in Garry's Mod)
If set, players cannot use Physics Gun on this entity.
Sandbox Tool Whitelist (gmod_allowtools) <string> (only in Garry's Mod)
If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the .lua files of those tools. This also includes the context menu properties!

Flags

  •  [1] : Start Constrained
       Prevents the model from moving.
  •  [2] : Deny player pickup (reserve for NPC)
  •  [4] : Not puntable by Gravity Gun

Outputs

Weapon:

OnNPCPickup
Fires when an NPC picks up this weapon. (!activator is the NPC.)
OnPlayerUse
Fires when the player +uses this weapon. (!activator is the player.)
OnPlayerPickup
Fires when a player picks up this weapon. (!activator is the player.)
OnCacheInteraction
Fires when the player 'proves' they've found this weapon. Fires on: Player Touch, +USE pickup, Physcannon pickup, Physcannon punt.