-
Notifications
You must be signed in to change notification settings - Fork 2
Shoot Entities
wootguy edited this page Jun 5, 2018
·
2 revisions
Shoot entities define what happens when you pull the trigger. There are 4 types of these, and all of them share a large chunk of keyvalues. You can connect up to 4 of these to a weapon_custom entity - one for each fire button plus an alternate primary fire.
The "Shoot Entities":
These keyvalues are shared across all 4 shoot entities. These are for configuring generic settings like damage, accuracy, and cooldowns.
Keyvalue Value Type |
Description |
---|---|
_____________________________ | |
Name string |
Name of the entity (this is what you write in weapon_custom). |
Damage float |
Damage to apply. For projectiles, this applies only when bouncing off an entity. |
Damage Type integer |
Override default damage type. |
Damage Type 2 integer |
Additional damage type. Combines with default or overridden type. |
Gib Mode integer |
Choose how the weapon should explode monsters. |
Friendly Fire integer |
Enable this for PvP. |
Shoot Sounds List of weapon_custom_sounds |
Sounds to play when firing, chosen randomly. |
Shoot Animations List of integers |
Animations to play when firing, chosen sequentially. |
Shoot Empty Animation integer |
Animation to play when the last shot in the clip is fired. |
Shoot Empty Sound weapon_custom_sound |
Sound to play when the last shot in the clip is fired. |
Shoot Failure Sounds List of weapon_custom_sounds |
Sounds to play when the fire is aborted (due to enabled flags). Chosen randomly. |
Ammo Cost integer |
Amount of ammo used when a single shot is fired. |
Cooldown float |
Time to wait (seconds) after firing a shot. |
Cooldown On Fail/Empty float |
Time to wait (seconds) after failing to shoot (e.g. out of ammo, in water). |
Accuracy float |
Bullet spread in degrees. 0 = perfect accuracy, 180 = worst possible. |
Accuracy Function integer |
Gaussian = Bullets will mostly hit in the center of the accuracy cone. Uniform = Any point in the accuracy cone is equally likely (combine with 180 deg accuracy for disco parties). |
Recoil 2 floats |
The minimum and maximum amount of vertical recoil. A random value is selected between these 2 values each time you shoot. |
Kickback float |
Push force applied to the player in the opposite direction of where the gun is pointed. |
Knockback float |
Push force applied to monsters when hit. |
Max Range float |
Maximum shoot distance (does not apply to projectiles). |
Heal Mode integer |
Healing action (e.g. medkit fire) |
Heal Targets integer |
Selectively heal based on classification. |
Ricochet Max Angle float |
Maximum angle (degrees) that a shot will ricochet off a wall (only works for beams, currently). |
Muzzle Flash Color Color |
Dynamic light color (0 0 0 = disabled) |
Muzzle Flash Adv. 3 integers |
Radius, Life time (seconds*0.1), and rate of decay of the muzzle flash. |
Shell Ejection Type integer |
Type of shell to eject after firing. |
Shell Custom Model string |
Custom shell model. |
Shell Offset Vector |
Position to eject the shell from, relative to the gun position. Coordinates are given as Right, Up, and Forward units. |
Shell Velocity Vector |
Shell ejection direction and speed, relative to the aim vector. Coordinates are given as Right, Up, and Forward units. |
Shell Spread float |
Amount to randomize the shell ejection direction. |
Shell Ejection Delay float |
Time in seconds to delay the shell ejection after firing. |
Shell Ejection Delay Sound weapon_custom_sound |
Sound to play if after the ejection delay has finished (but only if the delay is greater than 0). |
Wind Up Time float |
Time in seconds to wait before firing after the button is pressed. |
Min Responsive Wind Up Time float |
Minimum time to windup if windups can be cancelled. |
Wind Up Action integer |
What to do after the windup has finished. |
Wind Up Ammo Cost integer |
Amount of ammo used for a full windup. |
Wind Up Damage Multiplier float |
Extra damage done if the shot is fired at maximum windup (scales to match however long the windup was held). |
Wind Up Kickback Multiplier float |
Extra kickback force applied if the shot is fired at maximum windup (scales to match however long the windup was held). |
Wind Up Easing integer |
Smoothing function to use for windup (accelerates and decelerates the windup). |
Wind up Sound weapon_custom_sound |
Sound to play during the windup |
Wind Up Pitch Start integer |
Starting pitch for the windup sound. |
Wind Up Pitch End integer |
Ending pitch for the windup sound. |
Wind Up Animation integer |
Animation to play when the windup is started. |
Wind Up Animation Time float |
Time to wait before playing the windup loop animation, if one is set. |
Wind Up Loop Animation integer |
Animation to play after the windup start animation. |
Wind Up Loop Sound weapon_custom_sound |
Sound to play while the windup loop animation is active. |
Wind Up Overcharge Time float |
Time to wait before triggering the overcharge action. |
Wind Up Overcharge Action integer |
What to do when the windup has been held for too long (overcharged). |
Wind Up Overcharge Effect weapon_custom_user_effect |
Effect to trigger when the windup has been overcharged. |
Wind Up Overcharge Animation integer |
Animation to play when the windup has been overcharged. |
Wind Up Overcharge Cooldown float |
Time to wait after the windup has been overcharged. |
Wind Up Move Speed Multiplier float |
Scales player movement speed while the weapon is winding up. |
Wind Up Shoot Move Speed Mult. float |
Scales player movement speed while the weapon is wound up and the player is shooting (e.g. minigun fire makes you stop moving) |
Wind Down Time float |
Time for the weapon to wind down after winding up. |
Wind Down Min Cancel Time float |
Minimum wind down time required before you can try to wind up again. |
Wind Down Animation integer |
Animation to play while the weapon is winding down. |
Wind Down Sound weapon_custom_sound |
Sound to play while the weapon is winding down. |
Toggle Cooldown float |
Time to wait after toggling to this fire mode. |
All Shoot Entities get these flags
# | Name | Description |
---|---|---|
___________________ | ||
1 | Don't Fire On Damage | Abort the attack if shooting would not result in the target being healed. |
2 | Don't Fire On Miss | Abort the attack if shooting would not hit anything. |
4 | No Sound Overlap | Prevents weapon shoot sounds from overlapping by default. For melee weapons, this prevents the swing and hit sounds from playing at the same time. |
8 | Responsive Windup | Allows windups to be cancelled part way through. |
16 | Partial Ammo Shooting | Allows shooting if only a fraction of the required ammo is available (scales back damage accordingly). |
32 | Quake Muzzle Flash | Flashes yellow light at the player's third-person model. |
64 | No Autofire | Holding down the shoot button won't let you shoot continuously. |
128 | No Projectile Orienting | Projectiles won't rotate to face their movement direction. |
256 | Works In Water | Shots can be fired under water. |
512 | No Bubbles In Water | Shooting into water won't spawn bubbles. |
1024 | Detonate Satchels | Any satchels owned by the player will be detonated. |