Shooting anything in abstract form

From Source Entities
Jump to navigation Jump to search

This tutorial will show you how to shoot almost anything.

Half-Life 2/Portal 1[edit | edit source]

Bullets[edit | edit source]

Make an env_gunfire and use this table as a reference for the settings for each weapon. Since env_gunfire won't do damage, the damage should be done with a trigger_hurt.

Weapon Tracer Shoot Sound Refire rate Notes
357 Tracer Weapon_357.Single 0.75 30 damage
Airboat Gun AirboatGunTracer Airboat.FireGunLoop 0.01-0.02
Alyx Gun Tracer weapons\alyx_gun\alyx_gun_fire5.wav 0.09-0.11
AR2 AR2Tracer Weapon_AR2.NPC_Single 0.09-0.11
Dropship/Gunship GunshipTracer NPC_CombineGunship.CannonSound 0.10-0.11
Helicopter HelicopterTracer NPC_AttackHelicopter.FireGun 0.10-0.11
Pistol Tracer Weapon_Pistol.NPC_Single 0.12 Manual, 0.49-0.51 Auto
Shotgun Tracer Weapon_Shotgun.NPC_Single 0.88 Single, 1.05 Double Single shot is 7 bullets
SMG Tracer Weapon_SMG1.NPC_Single 0.07-0.08
Sniper Rifle StriderTracer NPC_Sniper.FireBullet 40 damage
Strider Minigun StriderTracer NPC_Strider.FireMinigun 0.21 Does 15 damage in HL2, but 5 in Episodic
Tau cannon GaussTracer weapons\gauss\fire1.wav 0.20-0.22 Auto Damage can go up to 250 depending on distance and charge amount
Turret (Aperture) AR2Tracer NPC_FloorTurret.Shoot 0.09-0.10 Same damage as combine turrets (4), but shoots two bullets at once
Turret (Combine) AR2Tracer NPC_FloorTurret.Shoot 0.10-0.11

Tip: You can create a second env_gunfire and use some extra tracers to make impact effects. Might look weird if shots aren't accurate.

  • AirboatGunImpact
  • BloodImpact
  • cball_bounce
  • cball_explode
  • GlassImpact
  • HelicopterImpact
  • StunstickImpact(Hl2.pngHalf-Life 2: Deathmatch)
  • WaterSurfaceExplosion

Make muzzle effects with env_muzzleflash.

Projectiles[edit | edit source]

  1. Make an entity from the list below and name it projectile (or whatever you want).
  2. Make a point_template, name it template and set Template 1 to projectile.
  3. Make an env_entity_maker, and configure it however is needed for your projectile and use case (i.e. fire a crossbow bolt when a button is pressed).
Projectile Classname Notes
Bugbait npc_grenade_bugbait Does not require antlion_allied global.
Chopper Bomb grenade_helicopter
Crossbow Bolt crossbow_bolt Play the sound Weapon_Crossbow.Single when it fires. Projectile speed is 2500 units/second.
Grenade npc_grenade_frag Must be sent SetTimer after spawning. Default time is 3.
Magnusson Device weapon_striderbuster Does no damage except physics, won't attach to striders unless hit by gravity gun.
S.L.A.M. npc_satchel Since it isn't controlled by a player, can't be set off unless shot or sent its Explode input. Does no damage if set off by damage.

Tip: Energy balls spawned in this way will appear unusually small. See point_combine_ball_launcher.

Gravity Gun[edit | edit source]

Note: Tutorial assumes the map is for Episode 2. In base HL2, the ambient_generics refuse to play the sounds, and instead crash the game. If you really want to make the map in base HL2 (not likely!), change the sounds to their raw files.

Punting[edit | edit source]

Making a fake gravity gun punt is actually not terribly complex, though this setup is not quite 1-to-1. If the gravity gun-like object you're making is able to move, remember to parent all the triggers, visual effects, etc. to whatever the moving part is.

Make a trigger_push over the area an object should have to be in to get punted. It should be very thin. Set these properties:

  • Name: gg_push
  • Start Disabled: Yes
  • Push Direction: Depends on how you have the gun positioned
  • Speed of Push: 30000

Set the flags how you wish, you'll probably want Physics Objects checked.

Make a trigger_multiple inside the trigger_push. Name it gg_checkforpuntables. Set the same flags, and make these outputs:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnNotTouchinggg_dryfirePlaySound0.00No
OnNotTouchinggg_dryfireStopSound0.10No
OnTouchinggg_puntTrigger0.00No
OnTouchinggg_disconnectClearParent0.00No
OnNotTouchinggg_heldobjectClearParent0.00No

Make a logic_relay, name it gg_punt, set these outputs:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnTriggergg_pushEnable0.00No
OnTriggergg_pushDisable0.05No
OnTriggergg_puntsoundPlaySound0.00No
OnTriggergg_puntsoundStopSound0.50No
OnTriggergg_punting_beamTurnOn0.00No
OnTriggergg_punting_beamTurnOff0.04No
OnTriggergg_holdingSetValue00.00No
OnTriggergg_holdsoundStopSound0.00No
OnTrigger!selfFireUser10.50No

The last output won't do anything except temporarily disable the relay, to act as a refire rate. You can adjust the rate by changing the delay. Make sure Allow fast retrigger is NOT checked! Any other special effects you want should be activated from OnTrigger.

Now for the flashy bits! Make an env_laser where you want the punting beam to come from. Make sure it isn't in anything solid. Give it these settings (adjust as you wish, adapted from the Ep2 intro):

  • Name: gg_punting_beam
  • Brightness: 255
  • Beam Color: 254 235 169
  • Amount of noise: 10
  • Sprite Name: sprites/yellowlaser1.spr
  • Texture Scroll Rate: 2
  • Frames per 10 seconds: 10
  • Target of Laser: gg_laser_end
  • Damage / second: 0

Make an info_target and name it gg_laser_end. Place it however is necessary so that the laser will point in the direction you want to punt objects.

Make an ambient_generic close to the gun and set these properties:

  • Name: gg_puntsound
  • Sound Name: Weapon_PhysCannon.Launch

Make another ambient_generic closeby and set these properties:

  • Name: gg_dryfire
  • Sound Name: Weapon_PhysCannon.DryFire

The gun is now fully ready to punt anything in its way. It will push multiple objects at once, but there's no perfect solution to that. When the time is right, send the TouchTest input to gg_checkforpuntables.

Grabbing[edit | edit source]

Note: If you don't want to implement grabbing (dropping is pretty broken due to parenting bugs) you can ignore this whole section and delete the incomplete IO from the punting section.

Make a trigger_push similar to the first one, but bigger and longer. If you want to be accurate to the real gun, make it about 900 units long. Set these properties:

  • Name: gg_pull
  • Start Disabled: Yes
  • Filter Name: gg_nottooheavy
  • Push Direction: (opposite of gg_push)
  • Speed of Push: 4000
My OutputTarget EntityTarget InputParameterDelayOnly Once
OnNotTouching (Not in FGD)gg_grabfailPlaySound0.00No

Make a filter_activator_mass_greater and set these:

  • Name: gg_nottooheavy
  • Filter Mass: 250
  • Filter mode: Disallow

Make a small trigger_teleport at the front of the gun:

  • Name: gg_grab
  • Start Disabled: Yes
  • Filter Name: gg_nottooheavy
  • Remote Destination: gg_holdspot
My OutputTarget EntityTarget InputParameterDelayOnly Once
OnStartTouchAll!selfDisable0.00No
OnStartTouchAllgg_pullDisable0.00No
OnStartTouchAll!activatorAddOutputtargetname gg_heldobject0.00No
OnStartTouchAllgg_holdsoundPlaySound0.00No
OnStartTouchAllgg_grabsoundPlaySound0.00No
OnStartTouchAllgg_holdingSetValue10.00No
OnStartTouchAll!activatorSetParentgg_grab0.00No

Any grab-related effects, like beams, should be activated here from OnStartTouchAll.

Make an info_target near the front of the gun, but a bit farther away than gg_grab. Name it gg_holdspot.

If your gun can move around, you need to make the next three entities so that this info_target moves with it:

  • Two more info_targets. We'll call them move_dummy1 and move_dummy2.
  • A logic_measure_movement with these settings:
  • Entity to Measure: move_dummy1
  • Measure Reference: move_dummy2
  • Entity to Move: gg_holdspot
  • Movement Reference: (moving part of gun)

Move the info_targets so that they have the same distance between each other, and gg_holdspot and the moving part of the gun.

Make a logic_branch:

  • Name: gg_holding
  • Initial Value: 0
My OutputTarget EntityTarget InputParameterDelayOnly Once
OnFalsegg_trytograbTrigger0.00No
OnTruegg_dropTrigger0.00No

Make a logic_relay named gg_trytograb and set these:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnTriggergg_pullEnable0.00No
OnTriggergg_grabEnable0.00No
OnTriggergg_pullDisable3.00No
OnTriggergg_grabDisable3.00No
OnTriggergg_pullTouchTest0.01No

Any trying-to-grab effects should be activated here from OnTrigger. Make sure Allow fast retrigger is NOT checked.

Make a logic_relay named gg_drop and set these:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnTriggergg_dropsoundPlaySound0.00No
OnTriggergg_heldobjectClearParent0.00No
OnTriggergg_holdingSetValue00.00No
OnTriggergg_holdsoundStopSound0.00No
OnTriggergg_nudge_hackExplode0.01No

Any dropping effects should be activated here from OnTrigger.

Make an env_physexplosion:

  • Name: gg_nudge_hack
  • Magnitude: 1
  • Clamp Radius: 100000
  • Limit to Entity: gg_heldobject

Flags: No Damage, Test LOS

To finish, a few sounds. Make an ambient_generic.

  • Name: gg_grabfail
  • Sound Name: Weapon_PhysCannon.TooHeavy

Another ambient_generic.

  • Name: gg_holdsound
  • Sound Name: Weapon_PhysCannon.HoldSound

And another.

  • Name: gg_grabsound
  • Sound Name: Weapon_PhysCannon.Pickup

Last one.

  • Name: gg_dropsound
  • Sound Name: Weapon_PhysCannon.Drop

That's everything. When you want to grab and drop stuff, send the Test input to gg_holding. The gun will try to grab objects for up to three seconds before giving up. Unfortunately, when the object is being held and it moves a large distance, it will teleport back to the spot it was grabbed at, and launch itself from there. Moving held objects long distances will obviously not look good. There seems to not be any good solution to this.

Portals[edit | edit source]

weapon_portalgun has inputs for firing portals even when the gun isn't being held. Also see prop_portal.

Strider cannon[edit | edit source]

As with the gravity gun, this setup is not exactly how the real thing works or looks, but it's close.

Make an info_target where you want the gun to shoot. Name it cannon_target.

Make a crossbow_bolt (Not in FGD) and name it cannon_projectile. The specific location of it in Hammer won't matter.

Make an env_sprite:

  • Name: cannon_pinch
  • Render Mode: Additive
  • Sprite Name: effects/strider_pinch_dudv.vmt
  • Scale: .6

Another sprite:

  • Name: cannon_flash
  • Render Mode: Additive
  • Sprite Name: effects/blueblackflash.vmt
  • Scale: 1

And one more:

  • Name: cannon_warp
  • Render Mode: Additive
  • Parent: cannon_projectile
  • Sprite Name: effects/strider_bulge_dudv.vmt
  • Scale: 1.3

Place the first two at the front of the laser's source. Place cannon_warp at the same spot as cannon_projectile.

Make an env_laser on the front of the gun:

  • Name: cannon_laser1
  • Target of Laser: cannon_target
  • Brightness: 255
  • Sprite Name: sprites/bluelaser1.vmt
  • Damage / second: 0

Make another env_laser where cannon_projectile is.

  • Name: cannon_laser2
  • Target of Laser: cannon_target
  • Parent: cannon_projectile
  • Brightness: 255
  • Width of Beam: 16
  • Sprite Name: effects/blueblacklargebeam.vmt
  • Damage / second: 50000

Flags: Start On

Make an ambient_generic named cannon_charge and set Sound Name to npc/strider/charging.wav.

Make another ambient_generic named cannon_shoot and set Sound Name to npc/strider/fire.wav.

Make a point_template and give it these settings:

  • Name: cannon_template
  • Template 1: cannon_projectile
  • Template 2: cannon_warp
  • Template 3: cannon_laser2

Make an env_entity_maker at the front of the gun and give it these settings:

  • Name: cannon_maker
  • Point_template to spawn: cannon_template
  • PostSpawn Movement Speed: 8000 (probably not accurate, but still very fast)
  • PostSpawn Movement Direction: (depends on which way things are facing. "Point At" may not be accurate!)
  • PostSpawn Direction Variance: 0

Since our projectile is capable of bouncing, we need a way to stop it from doing so. Create a trigger_remove which the projectile will always hit. A small one over the info_target from earlier would be ideal, but if the cannon is going to be aimable, it will have to cover every solid surface.

  • Filter Name: filter_cannon_projectile

Flags: Everything (not including physics debris)

Make a filter_activator_name called filter_cannon_projectile and set Filter Name to cannon_projectile.

Lastly, make a logic_relay named cannon_fire_relay with these outputs:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnTriggercannon_chargePlaySound0.00No
OnTriggercannon_flashShowSprite0.00No
OnTriggercannon_pinchShowSprite0.00No
OnTriggercannon_laser1TurnOn0.00No
OnTriggercannon_shootPlaySound1.25No
OnTriggercannon_flashHideSprite1.25No
OnTriggercannon_pinchHideSprite1.25No
OnTriggercannon_laser1TurnOff1.25No
OnTriggercannon_makerForceSpawn1.25No
OnTriggercannon_chargeStopSound1.25No
OnTriggercannon_shootStopSound4.00No

Send the Trigger input to cannon_fire_relay to fire the cannon.

Counter-Strike: Source[edit | edit source]

Bullets[edit | edit source]

Make an env_gunfire (Not in FGD) and use this table as a reference for the settings for each weapon. Since env_gunfire won't do damage, the damage should be done with a trigger_hurt. If you want the gun to have tracers (unlike regular CSS guns), set the Tracer to Default, otherwise set it to CS_MuzzleFlash (avoids console spam when developer 1 is on). Despite the name, that tracer will not make muzzle effects.

Weapon Sound Fire Rate
228 weapons\p228\p228-1.wav 0.15
AWP weapons\awp\awp1.wav 1.50
Bullpup weapons\aug\aug-1.wav 0.09 Unscoped, 0.13 Scoped
C90 weapons\p90\p90-1.wav 0.06-0.08
Clarion weapons\famas\famas-1.wav 0.09
Commando weapons\sg550\sg550-1.wav 0.24-0.26
CV-47 weapons\ak47\ak47-1.wav 0.09-0.11
D3/AU-1 weapons\g3sg1\g3sg1-1.wav 0.24-0.26
Elite weapons\elite\elite-1.wav 0.12
Five-Seven weapons\fiveseven\fiveseven-1.wav 0.15
Glock 18 weapons\glock\glock18-1.wav 0.15 Manual, 0.05-0.07 Burst
IDF Defender weapons\galil\galil-1.wav 0.09
KM .45 weapons\usp\usp1.wav or weapons\usp\usp_unsil-1.wav 0.15
KM SMG weapons\mp5navy\mp5-1.wav 0.07-0.09
Krieg 552 weapons\sg552\sg552-1.wav 0.07-0.10 Unscoped, 0.13-0.14 Scoped
Leone 12-gauge weapons\m3\m3-1.wav 0.87-0.89
Leone YG1265 weapons\xm1014\xm1014-1.wav 0.24-0.26
M249 weapons\m249\m249-1.wav 0.07-0.09
M4A1 weapons\m4a1\m4a1-1.wav or weapons\m4a1\m4a1_unsil-1.wav 0.08-0.11 Unsilenced, 0.09 Silenced
MAC-10 weapons\mac10\mac10-1.wav 0.07
Machine Pistol weapons\tmp\tmp-1.wav 0.06-0.08
Night Hawk weapons\deagle\deagle-1.wav 0.22
Scout weapons\scout\scout_fire-1.wav 1.24
UMP45 weapons\ump45\ump45-1.wav 0.10-0.11

Projectiles[edit | edit source]

CS:S grenades can be spawned, but they just bounce forever.

  • Flashbangs can be simulated, except for the muting part. The flash can be done with an env_fade or color_correction, and the ringing sound can be done with ambient_generic (but you'll have to get your own ringing sound, cause CSS apparently generates the real one on the fly).
  • HE grenade explosions can be imitated with env_explosion. Radius is ~320, damage 99.
  • Smoke clouds can be imitated with env_sprites.

Day of Defeat: Source[edit | edit source]

Bullets[edit | edit source]

Make an env_gunfire (Not in FGD) and use this table as a reference for the settings for each weapon. Since env_gunfire won't do damage, the damage should be done with a trigger_hurt. For tracers, machine guns use BrightTracer, rifles and smgs use FaintTracer, and pistols don't use anything, so set them to DOD_3rdPersonMuzzleFlash which only shows bullet impacts.

Weapon Sound Fire rate
.30 Cal weapons\30cal_shoot.wav 0.10-0.11
BAR weapons\bar_shoot.wav 0.11-0.13
C96 weapons\c96_shoot.wav 0.07-0.08
Colt weapons\colt_shoot.wav 0.09
K98k weapons\k98_shoot.wav 0.60
K98 Sniper weapons\k98_shoot.wav 1.60
M1 Carbine weapons\m1carbine_shoot.wav 0.10
M1 Garand weapons\garand_shoot.wav 0.37
MG42 weapons\mg42_shoot.wav 0.05-0.07
MP40 weapons\mp40_shoot.wav 0.09-0.11
P38 weapons\p38_shoot.wav 0.10
Springfield weapons\spring_shoot.wav 1.84
Stg44 weapons\mp44_shoot.wav 0.12-0.14
Thompson weapons\thompson_shoot.wav 0.08-0.10

Projectiles[edit | edit source]

Rockets[edit | edit source]

Rockets can be spawned in with rocket_bazooka or rocket_pschreck (recommended to use point_template and env_entity_maker with it). Set the speed to 1300.

Grenades[edit | edit source]

Manually-spawned grenades instantly crash the game. Smoke clouds can be imitated with env_sprites and a color_correction, and grenades can be imitated with env_explosions (radius ~350).

Team Fortress 2[edit | edit source]

Bullets[edit | edit source]

Make an info_target where you want bullets to go. Name it bullet_target and set the Transmit to client flag. Make sure the center of it isn't in anything solid.

Make an info_particle_system where you want the bullets to come from.

  • Name: bullet_start
  • Particle System Name: (see below)
  • Control Point 1: bullet_target

Particle effects:

  • bullet_tracer01: Normal
  • bullet_tracer01_blue_crit: Blue crit
  • bullet_tracer01_red_crit: Red crit

Make a logic_timer with these outputs:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnTimerbullet_startStart0.00No
OnTimerbullet_startStop0.05No

Damage must be done with a trigger_hurt.

Below is a list of the weapons, the sounds to play (ambient_generic), and their refire rates.

Weapon Sound Fire rate
Ambassador Weapon_Ambassador.Single 0.600
Baby Face's Blaster weapons\doom_scout_shotgun.wav 0.630
Back Scatter Weapon_Back_Scatter.Single 0.630
Bazaar Bargain Weapon_Bazaar_Bargain.Single 1.500
Brass Beast Weapon_Gatling.Fire 0.105
Classic Weapon_ClassicSniperRifle.Single 1.500
Cleaner's Carbine weapons\doom_sniper_smg.wav 0.135
Diamondback Weapon_Diamond_Back.Single 0.510
Enforcer Weapon_Enforcer.Single 0.600
Family Business Weapon_FamilyBusiness.Single 0.540
Force-a-Nature Weapon_Scatter_Gun_Double.Single 0.315
Frontier Justice Weapon_FrontierJustice.Single 0.630
Hitman's Heatmaker weapons\doom_sniper_rifle.wav 1.500
Huo-Long Heater Dragon_Minigun.Fire 0.105
L'Etranger Weapon_Letranger.Single 0.510
Machina Weapon_SniperRailgun.Single 1.500
Minigun Weapon_Minigun.Fire 0.105
Natascha Weapon_Minifun.Fire 0.105
Panic Attack Weapon_BackShot_Shotty.Single 0.630
Pistol Weapon_Pistol.Single 0.150
Pretty Boy's Pocket Pistol Weapon_PickPocket_Pistol.Single 0.135
Reserve Shooter Weapon_Reserve_Shooter.Single 0.630
Revolver Weapon_Revolver.Single 0.510
Scattergun Weapon_Scatter_Gun.Single 0.630
Shortstop Weapon_Short_Stop.Single 0.360
Shotgun Weapon_Shotgun.Single 0.630
SMG Weapon_SMG.Single 0.105
Sniper Rifle Weapon_SniperRifle.Single 1.500
Soda Popper Weapon_Soda_Popper.Single 0.315
Sydney Sleeper Weapon_SydneySleeper.Single 1.500
Tomislav Weapon_Tomislav.Fire 0.125
Widowmaker Weapon_WidowMaker.Single 0.630
Winger Weapon_Winger.Single 0.150

Projectiles[edit | edit source]

  1. Make an entity from the list below and name it projectile (or whatever you want).
  2. Make a point_template, name it template and set Template 1 to projectile.
  3. Make an env_entity_maker, and configure it however is needed for your projectile and use case (i.e. fire a rocket when a button is hit).

Note: Precise launch speeds are not known...

Projectile Classname Notes
Bat Spell tf_projectile_spellbats
Boxing Glove Spell tf_projectile_spellkartorb
Flare tf_projectile_flare
Flying Guillotine tf_projectile_cleaver
Gas Passer tf_projectile_jar_gas
Grenade tf_projectile_pipe Loch n Load settings can be imitated by removing the bomb when it hits a trigger.
Huntsman Arrow tf_projectile_arrow To do: Hardly noticeable without its trail effect! Find it.
Jarate tf_projectile_jar
Lightning Orb Spell tf_projectile_lightningorb Will not pick up enemies properly if moving too fast.
Mad Milk tf_projectile_jar_milk
Meteor Shower Spell tf_projectile_spellmeteorshower
Needle tf_projectile_syringe To do: Hardly noticeable without its trail effect! Find it.
Rocket tf_projectile_rocket Rocket thinks it's underwater by default? Set teamnum to 1 to avoid this.
Rocket (Mangler) tf_projectile_energy_ball Does not make impact sound on its own. To do: Charged shot particle?
Sandman tf_projectile_stun_ball Stun can be replicated with player_speedmod.
Sentry Rockets tf_projectile_sentryrocket
Short Circuit Secondary tf_projectile_mechanicalarmorb
Skeleton Spawn Spell tf_projectile_spellspawnzombie

Tip: Most projectiles will look and act slightly different when teamnum is set to 2 (red team) or 3 (blue team). If not set, many effects will apply to both teams at once, or neither.

Note: Projectiles will not do damage on their own when created this way. Damage must be done with trigger_hurt or env_explosion.

Note: Heavy's consumable drops are item_healthkit_smalls and item_healthkit_mediums with special models. Their precise movement is probably not replicable, but that's all they are.

Tip: Regular rockets work fine with this method, but ones created with tf_point_weapon_mimic will be extra modifiable.

Note: Spawning stickybombs this way causes them to act like grenades! Use tf_point_weapon_mimic to create them.

Unusable projectiles (might be able to imitate them with other entities):

Left 4 Dead 2[edit | edit source]

Bullets[edit | edit source]

env_weaponfire can be used to shoot things, but it's limited in a few ways and can't be manually controlled.

Make an info_target where you want bullets to go. Name it bullet_target and set the Always transmit to client flag. Make sure the center of it isn't in anything solid.

Make an info_particle_system where you want the bullets to come from.

  • Name: bullet_start
  • Particle System Name: (see below)
  • Control Point 1: bullet_target

Particle effects:

  • weapon_tracers: Normal thin white
  • weapon_tracers_explosive: Thin white, longer streak
  • weapon_tracers_50cal: Thick yellow + thin yellow
  • weapon_tracers_50cal_glow: Thick yellow
  • weapon_tracers_50cal_low: Thick red + thin red
  • weapon_tracers_50cal_low_glow: Thick red
  • weapon_tracers_incendiary: Thin yellow + smoke puff trail + white smoke lines
  • weapon_tracers_incendiary_cheap: Thin yellow + smoke puff trail
  • weapon_tracers_incendiary_streak: Thin yellow

Make a logic_timer with these outputs:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnTimerbullet_startStart0.00No
OnTimerbullet_startStop0.05No

Damage must be done with a trigger_hurt.

Below is a list of the weapons, the sounds to play (ambient_generic), and their refire rates.

Weapon Sound Fire rate
AK-47 AK47.Fire .1300
Assault Rifle Rifle.Fire .0875
Auto Shotgun AutoShotgun.Fire .1500
AWP Weapon_AWP.Single 1.0500
Chrome Shotgun Shotgun_Chrome.Fire .5000
Combat Rifle Rifle_Desert.Fire .0700/.1500
Combat Shotgun AutoShotgun_Spas.Fire .1500
Glock Pistol.Fire .1750
Hunting Rifle HuntingRifle.Fire .2500
Krieg 552 Weapon_SG552.Single .0825
M60 M60.Fire .1300
Magnum Pistol Magnum.Fire .3000
MP5 Weapon_MP5Navy.Single .0750
P220 Pistol Pistol.Fire or Pistol.DualFire .1750
Pump Shotgun Shotgun.Fire .5000
Silenced Submachine Gun SMG_Silenced.Fire .0625
Sniper Rifle Sniper_Military.Fire .2500
Steyr Scout Weapon_Scout.Single .9000
Submachine Gun SMG.Fire .0625

Projectiles[edit | edit source]

None of Left 4 Dead's projectiles work correctly when directly spawned.

Alien Swarm[edit | edit source]

Bullets[edit | edit source]

It seems that it's not possible to visually recreate Alien Swarm's bullets, so the visual portion of this will be a bit lackluster, since it has to make do with Half-Life 2's bullet tracer. Make an env_gunfire (Not in FGD) and, if you're trying to emulate a particular gun, check the ingame menu for damage and fire rate stats. Since env_gunfire won't do damage, the damage should be done with a trigger_hurt.

Weapon Shoot Sound
Assault Rifle ASW_Weapon_Rifle.Single
Autogun ASW_Weapon_Autogun.Single
Minigun ASW_Weapon_Minigun.Single
PDW ASW_Weapon_PDW.multiShot
Prototype Rifle ASW_Weapon_Prifle.Single
Railgun ASW_Railgun.Single
Sentry ASW_Sentry.Fire
Shotgun ASW_Weapon_Shotgun.FireAndPump
Sniper Rifle ASW_Weapon_Sniper_Rifle.Single
Twin Pistols ASW_Weapon_Pistol.Single
Vindicator ASW_Weapon_Vindicator.FireAndPump

Projectiles[edit | edit source]

  1. Make an entity from the list below and name it projectile (or whatever you want).
  2. Make a point_template, name it template and set Template 1 to projectile.
  3. Make an env_entity_maker, and configure it however is needed for your projectile and use case (i.e. fire a grenade when a button is pressed).
Projectile Classname Notes
Bait asw_bait
Combat Flare asw_flare_projectile
Damage Amp asw_buffgrenade_projectile Set skin to 1.
Freeze Grenade asw_grenade_freeze
Grenade asw_grenade_cluster
Heal Beacon asw_healgrenade_projectile Set skin to 2.
Incendiary Mine asw_mine
Smart Bomb asw_rocket
T75 asw_t75
Trip Mine asw_laser_mine

Cannot be made because they won't work right:

Portal 2[edit | edit source]

Turrets[edit | edit source]

Make an env_gunfire (Not in FGD) and use these settings:

  • Rate of fire: 0.1
  • Shoot Sound: NPC_FloorTurret.ShotSounds
  • Tracer: Default

Actual turrets fire from two different spots. If you want the gun to fire from two different spots, copy the env_gunfire and set Rate of fire to 0.2 for both of them.

Portals[edit | edit source]

weapon_portalgun has inputs for firing portals even when the gun isn't being held. Also see prop_portal.

Counter-Strike: Global Offensive[edit | edit source]

Bullets[edit | edit source]

Make an env_gunfire and set Weapon (weaponname) to whatever you want. The entity will automatically fire with that weapon's fire rate, damage, and particle effects.

If the gun does not face east by default, you'll have to do this next part to make the muzzle effects point in the right direction. Make a logic_auto and set this output.

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnMultiNewRound(name of env_gunfire)SetLocalAngles(desired angle)0.00No

env_gunfire will not play the gun's firing sound. Make an ambient_generic, uncheck the Is NOT Looped flag, and play one of the sounds below as rapidly as the fire rate.

Weapon Sound Fire rate
AK-47 Weapon_AK47.Single 0.09-0.11
AUG Weapon_AUG.Single 0.09-0.11
AWP Weapon_AWP.Single 1.45
Desert Eagle Weapon_DEagle.Single 0.22
Dual Berettas Weapon_ELITE.Single 0.12
FAMAS Weapon_FAMAS.Single 0.07-0.10
Five-Seven Weapon_FiveSeven.Single 0.14
G3SG1 Weapon_G3SG1.Single 0.25
Galil AR Weapon_GalilAR.Single 0.07-0.10
Glock-18 Weapon_Glock.Single 0.14 Manual, 0.04-0.07 Burst
M249 Weapon_M249.Single 0.07-0.10
M4A1-S Weapon_M4A1.Silenced or Weapon_M4A1.SilencedSingle 0.09-0.11
M4A4 Weapon_M4A1.Single 0.07-0.10
MAC-10 Weapon_MAC10.Single 0.06-0.08
MAG-7 Weapon_Mag7.Single 0.84
MP5-SD Weapon_MP5.Single 0.07-0.09
MP7 Weapon_MP7.Single 0.07-0.09
MP9 Weapon_MP9.Single 0.06-0.08
Negev Weapon_Negev.Single 0.06-0.08
Nova Weapon_Nova.Single 0.87
P2000 Weapon_hkp2000.Single 0.15
P250 Weapon_P250.Single 0.14
P90 Weapon_P90.Single 0.06-0.08
PP-Bizon Weapon_bizon.Single 0.07-0.10
Sawed Off Weapon_Sawedoff.Single 0.84
SCAR-20 Weapon_SCAR20.Single 0.25
SG 553 Weapon_sg556.Single 0.07-0.10
SSG 08 Weapon_SSG08.Single 1.25
Tec-9 Weapon_tec9.Single 0.10
UMP-45 Weapon_UMP45.Single 0.07-0.10
USP-S Weapon_USP.SilencedShot or Weapon_USP.Single 0.17
XM1014 Weapon_XM1014.Single 0.34-0.36
Zeus x27 Weapon_Taser.Single N/A

Projectiles[edit | edit source]

  1. Make an entity from the list below and name it projectile (or whatever you want).
  2. Make a point_template, name it template and set Template 1 to projectile.
  3. Make an env_entity_maker, and configure it however is needed for your projectile and use case (i.e. fire a grenade when a button is pressed).
Projectile Classname Notes
Breach Charge breachcharge_projectile Silent, will not explode by any means. An env_explosion would have to suffice.
Bumpmine bumpmine_projectile Silent, never boosts player, indestructible. A trigger_push or similar entity is the only option.
Decoy decoy_projectile Does not make any gunfire sound, but does the smoke effect. Bounces are unusually elastic.
Flashbang flashbang_projectile
HE Grenade hegrenade_projectile See below.
Molotov/Incendiary Grenade molotov_projectile See below.
Smoke Grenade smokegrenade_projectile Will never make the cloud! Bounces are unusually elastic.
Snowball snowball_projectile
Tactical Awareness Grenade tagrenade_projectile Never explodes! Bounces are unusually elastic.

Molotovs and grenades will bounce forever unless you add this output to the env_entity_maker:

My OutputTarget EntityTarget InputParameterDelayOnly Once
OnEntitySpawnedprojectileInitializeSpawnFromWorld0.00No

Be careful: If the projectile receives this input more than once, its explosion timer will reset.