Weapon templates (presets)

Weapon templates (presets) #

The sample mod includes some premade weapon templates to simulate weapons from other mods.

If not stated otherwise, the weapon template can be applied to any fully configurable weapon, replacing its behavior (via from_scratch property).

Counter Strike #

The templates for CS weapons are stored in the templates/weapons/cs/ directory. They include almost every CS firearm (except for dual berretas).

Example
{
    "weapon_9mmhandgun": "cs/glock18",
    "weapon_eagle": "cs/deagle",
    "weapon_9mmAR": "cs/mp5navy",
    "weapon_shotgun": "cs/m3",
    "weapon_sniperrifle": "cs/awp",
    "weapon_pistol": "cs/usp",
    "weapon_pistol2": "cs/fiveseven",
    "weapon_smg": "cs/ump45",
    "weapon_smg2": "cs/p90",
    "weapon_rifle": "cs/m4a1",
    "weapon_rifle2": "cs/famas",
    "weapon_shotgun2": "cs/xm1014",
    "weapon_sniperrifle2": "cs/g3sg1"
}

As a mod developer you need to take into account that CS handles weapons different (comparing to HL) in several aspects and this behavior is replicated in the weapon templates:

  • Most CS weapons use different spread and kickback rules.
    • The fire spread gets wider with each fire, making the player to use short burst fire to keep the shots accurate (unlike HL where the spread is randomized in a constant range independent of previous shots).
    • Kickback (recoil) is server-side, i.e. it actually affects the direction of the next shot (unlike HL where the recoil is client-side and purely visual).
    • The kickback (recoil) inscreases with each fire making the player control their pointing devices to compensate for the recoil.
    • Both spread and kickback depend on whether the player is in on the ground, moving or ducking. Usually the weapons shoot more accurate when player is ducking and less accurate when player is moving or not on the ground (e.g. in jump or on the ladder).
  • Weapons have range modifier that decreases the damage on longer distances. In HL the bullet damage is constant independent of the distance.
  • Most CS weapons can shoot underwater, except for FAMAS, Galil and shotguns. While this does little impact in CS as it usually doesn’t feature maps with water deep enough for players to swim, this is something to remember when you’re making a mod.
  • Most CS weapons eject shells to the left side (when playing in the right-handed setup which is default in modern CS). There’re some exceptions like P90, AUG and M249. If you don’t want shells to eject to the left side, you may remove "shell_left_side" property or set it to false.
  • Shell ejection positions and velocity defined in templates might be not true to their original counterparts from CS.
  • CS view weapon models were made as left-handed. We set mirror_viewmodel for each CS weapon to make them appear right-handed.

CS weapons demonstrate some other traits that are not possible (yet) to express via weapon templates:

  • Each weapon has an associated max player speed. That’s why player moves slower when, for example, a sniper rifle is deployed.
  • CS firearms can penetrate walls.

We advise not mixing HL and CS weapon fire styles in the same mod as it might be confusing to the player, so don’t mix HL and CS weapons without making appropriate changes. Follow these recommendations:

  • Decide whether you want a dynamic spread and kickback from CS. Set it appropriately for all related firearms.
  • Decide whether you want bullet damage depend on the range and set or remove range modifier appropriately.
  • Configure damage values to your liking. Since replicating the CS damage values wouldn’t fit the HL singleplayer balance (the damage values in CS are balanced around players having 100 hp and low time-to-kill) as a rule of thumb we took original damage values and divided them by 2.5 (except for Desert Eagle, AWP and Scout).
  • Set allow_underwater for each weapon in accordance to your intentions.

CS also uses some shell models that are not present in HL, so you must provide them in the mod (or just copy from cstrike/models) or set shell_model to models/shell.mdl which exists in base Half-Life. CS uses following models for shells:

  • pshell.mdl - used by pistols and some SMGs.
  • rshell.mdl - used by rifles and some SMGs.
  • rshell_big.mdl - used by Scout and AWP.
  • shotgunshell.mdl - used by shotguns, but reuses the model from base Half-Life, so you don’t need to worry about it.

Shell models and world weapon models (w_ prefixed) in CS on average are smaller than ones in Half-Life. You might want to scale models accordingly.

Currently you can’t have all CS weapons at once in your mod - there’re simply not enough weapon slots. You can select the limited set of preferred weapons and stick to them. E.g. there’s not much sense in utilizing both AUG and SG 552 as they’re very similar. And you probably don’t need all kinds of SMGs.

Pistols #

All pistols in CS are semi-auto which means player needs to release and press the attack button again in order to make another shot. This is different from HL where weapons are automatic, i.e. the weapon continues firing as long as player has the attack button pressed. You can remove "semiauto" property from the weapon template to allow full auto behavior.

Glock-18 #

{
    "weapon_9mmhandgun": "cs/glock18"
}

Burst fire is performed by pressing the secondary attack button, unlike CS where the secondary attack switches the mode to burst and firing still needs to be performed with a primary attack button.

This also implements burst fire as actual series of consecutive shots opposite to CS where it seems to fire three bullets at the same time.

The end of the reload animation is not consistent with the idle animation - this is the original CS model problem.

Required models:

  • w_glock18.mdl
  • v_glock18.mdl
  • p_glock18.mdl

Required sounds:

  • weapons/glock18-2.wav
  • weapons/clipout1.wav
  • weapons/clipin1.wav
  • weapons/sliderelease1.wav
  • weapons/slideback1.wav
  • weapons/de_clipin.wav
  • weapons/de_clipout.wav

USP #

{
    "weapon_pistol": "cs/usp"
}

In CS it doesn’t make sense to use the silenced USP: it deals less damage and has worse accuracy. Having quiet gunshots is a very weak bonus.

USP produces less noise for NPCs in a silenced mode, but it’s still not enough for a trade off (at least until proper stealth mechanic is implemented in Featureful SDK).

So, to justify the silencer we took a liberty of completely removing the kickback when the silencer is attached (the "kickback" is set to the empty array for the "alt_fire"). You may also play with "spread" and "cycle_time" to balance the two attack modes between each other.

USP uses 45acp ammo type, so you should place some ammo_45acp on your maps or change ammo_name to some other ammo type.

Required models:

  • w_usp.mdl
  • v_usp.mdl
  • p_usp.mdl

Required sounds:

  • weapons/usp_unsil-1.wav
  • weapons/usp1.wav
  • weapons/usp2.wav
  • weapons/usp_clipout.wav
  • weapons/usp_clipin.wav
  • weapons/usp_silencer_on.wav
  • weapons/usp_silencer_off.wav
  • weapons/usp_sliderelease.wav
  • weapons/usp_slideback.wav

Desert Eagle #

{
    "weapon_eagle": "cs/deagle"
}

Desert Eagle in Counter Strike uses ammo type 50AE which is not defined in Featureful SDK. This template still uses 357 ammo like in Opposing Force.

Required models:

  • w_deagle.mdl
  • v_deagle.mdl
  • p_deagle.mdl

Required sounds:

  • weapons/deagle-1.wav
  • weapons/deagle-2.wav
  • weapons/de_clipin.wav
  • weapons/de_clipout.wav
  • weapons/de_deploy.wav

Five-Seven #

{
    "weapon_pistol": "cs/fiveseven"
}

Five-Seven uses 57mm ammo type, so you should place some ammo_57mm on your maps or change ammo_name to some other ammo type.

Required models:

  • w_fiveseven.mdl
  • v_fiveseven.mdl
  • p_fiveseven.mdl

Required sounds:

  • weapons/fiveseven-1.wav
  • weapons/fiveseven_clipout.wav
  • weapons/fiveseven_clipin.wav
  • weapons/fiveseven_sliderelease.wav
  • weapons/fiveseven_slidepull.wav

P228 #

{
    "weapon_pistol": "cs/p228"
}

P228 in Counter Strike uses ammo type 357SIG which is not defined in Featureful SDK. This template uses 357 ammo type. You can change ammo_name to your liking.

Required models:

  • w_p228.mdl
  • v_p228.mdl
  • p_p228.mdl

Required sounds:

  • weapons/p228-1.wav
  • weapons/p228_clipout.wav
  • weapons/p228_clipin.wav
  • weapons/p228_sliderelease.wav
  • weapons/p228_slidepull.wav

Submachine guns #

MAC-10 #

{
    "weapon_smg": "cs/mac10"
}

MAC-10 uses 45acp ammo type, so you should place some ammo_45acp on your maps or change ammo_name to some other ammo type.

Required models:

  • w_mac10.mdl
  • v_mac10.mdl
  • p_mac10.mdl

Required sounds:

  • weapons/mac10-1.wav
  • weapons/mac10_clipout.wav
  • weapons/mac10_clipin.wav
  • weapons/mac10_boltpull.wav

TMP #

{
    "weapon_smg": "cs/tmp"
}

TMP has a silencer attached so it’s configuired to make less noise for AI.

The end of the reload animation is not consistent with the idle animation - this is the original CS model problem.

Required models:

  • w_tmp.mdl
  • v_tmp.mdl
  • p_tmp.mdl

Required sounds:

  • weapons/tmp-1.wav
  • weapons/tmp-2.wav

MP5 Navy #

{
    "weapon_9mmAR": "cs/mp5navy"
}

Required models:

  • w_mp5.mdl
  • v_mp5.mdl
  • p_mp5.mdl

Required sounds:

  • weapons/mp5-1.wav
  • weapons/mp5-2.wav
  • weapons/mp5_clipout.wav
  • weapons/mp5_clipin.wav
  • weapons/mp5_slideback.wav

UMP-45 #

{
    "weapon_smg": "cs/ump45"
}

UMP-45 uses 45acp ammo type, so you should place some ammo_45acp on your maps or change ammo_name to some other ammo type.

Required models:

  • w_ump45.mdl
  • v_ump45.mdl
  • p_ump45.mdl

Required sounds:

  • weapons/ump45-1.wav
  • weapons/ump45_clipout.wav
  • weapons/ump45_clipin.wav
  • weapons/ump45_boltslap.wav

P90 #

{
    "weapon_smg": "cs/p90"
}

P90 uses 57mm ammo type, so you should place some ammo_57mm on your maps or change ammo_name to some other ammo type.

The end of the reload animation is not consistent with the idle animation - this is the original CS model problem.

Required models:

  • w_p90.mdl
  • v_p90.mdl
  • p_p90.mdl

Required sounds:

  • weapons/p90-1.wav
  • weapons/p90_clipout.wav
  • weapons/p90_clipin.wav
  • weapons/p90_boltpull.wav
  • weapons/p90_cliprelease.wav

Assault rifles #

FAMAS #

{
    "weapon_rifle": "cs/famas"
}

Burst fire is performed by pressing the secondary attack button, unlike CS where the secondary attack switches the mode to burst and firing still needs to be performed with a primary attack button.

Required models:

  • w_famas.mdl
  • v_famas.mdl
  • p_famas.mdl

Required sounds:

  • weapons/famas-1.wav
  • weapons/famas-2.wav
  • weapons/famas_clipout.wav
  • weapons/famas_clipin.wav
  • weapons/famas_boltpull.wav
  • weapons/famas_boltslap.wav
  • weapons/famas_forearm.wav

M4A1 #

{
    "weapon_rifle": "cs/m4a1"
}

Required models:

  • w_m4a1.mdl
  • v_m4a1.mdl
  • p_m4a1.mdl

Required sounds:

  • weapons/m4a1_unsil-1.wav
  • weapons/m4a1_unsil-2.wav
  • weapons/m4a1-1.wav
  • weapons/m4a1_clipin.wav
  • weapons/m4a1_clipout.wav
  • weapons/m4a1_boltpull.wav
  • weapons/m4a1_deploy.wav
  • weapons/m4a1_silencer_on.wav
  • weapons/m4a1_silencer_off.wav

AUG #

{
    "weapon_rifle": "cs/aug"
}

Required models:

  • w_aug.mdl
  • v_aug.mdl
  • p_aug.mdl

Required sounds:

  • weapons/aug-1.wav
  • weapons/aug_clipout.wav
  • weapons/aug_clipin.wav
  • weapons/aug_boltpull.wav
  • weapons/aug_boltslap.wav
  • weapons/aug_forearm.wav

Galil #

{
    "weapon_rifle": "cs/galil"
}

Required models:

  • w_galil.mdl
  • v_galil.mdl
  • p_galil.mdl

Required sounds:

  • weapons/galil-1.wav
  • weapons/galil-2.wav
  • weapons/galil_clipout.wav
  • weapons/galil_clipin.wav
  • weapons/galil_boltpull.wav

AK-47 #

{
    "weapon_rifle": "cs/ak47"
}

AK-47 uses 762 ammunition (in both CS and real life). In our configuration it uses 556 ammo type - same as other rifles.

Required models:

  • w_ak47.mdl
  • v_ak47.mdl
  • p_ak47.mdl

Required sounds:

  • weapons/ak47-1.wav
  • weapons/ak47-2.wav
  • weapons/ak47_clipout.wav
  • weapons/ak47_clipin.wav
  • weapons/ak47_boltpull.wav

SG 552 #

{
    "weapon_rifle": "cs/sg552"
}

Required models:

  • w_sg552.mdl
  • v_sg552.mdl
  • p_sg552.mdl

Required sounds:

  • weapons/sg552-1.wav
  • weapons/sg552-2.wav
  • weapons/sg552_clipout.wav
  • weapons/sg552_clipin.wav
  • weapons/sg552_boltpull.wav

Shotguns #

M3 #

{
    "weapon_shotgun": "cs/m3"
}

Required models:

  • w_m3.mdl
  • v_m3.mdl
  • p_m3.mdl

Required sounds:

  • weapons/m3-1.wav
  • weapons/m3_insertshell.wav
  • weapons/m3_pump.wav

XM1014 #

{
    "weapon_shotgun2": "cs/xm1014"
}

Required models:

  • w_xm1014.mdl
  • v_xm1014.mdl
  • p_xm1014.mdl

Required sounds:

  • weapons/xm1014-1.wav

Sniper rifles #

Support for black frames around the crosshair when scoped is not implemented yet.

Scout #

{
    "weapon_sniperrifle": "cs/scout"
}

Required models:

  • w_scout.mdl
  • v_scout.mdl
  • p_scout.mdl

Required sounds:

  • weapons/scout_fire-1.wav
  • weapons/scout_bolt.wav
  • weapons/scout_clipin.wav
  • weapons/scout_clipout.wav
  • weapons/zoom.wav

AWP #

{
    "weapon_sniperrifle": "cs/awp"
}

AWP in Counter Strike uses ammo type 338Magnum which is not defined in Featureful SDK. This template uses 762 ammo type. You can change ammo_name to your liking.

Required models:

  • w_awp.mdl
  • v_awp.mdl
  • p_awp.mdl

Required sounds:

  • weapons/awp1.wav
  • weapons/boltpull1.wav
  • weapons/boltup.wav
  • weapons/boltdown.wav
  • weapons/awp_deploy.wav
  • weapons/awp_clipin.wav
  • weapons/awp_clipout.wav
  • weapons/zoom.wav

SG 550 #

{
    "weapon_sniperrifle2": "cs/sg550"
}

Required models:

  • w_sg550.mdl
  • v_sg550.mdl
  • p_sg550.mdl

Required sounds:

  • weapons/sg550-1.wav
  • weapons/sg550_boltpull.wav
  • weapons/sg550_clipin.wav
  • weapons/sg550_clipout.wav
  • weapons/zoom.wav

G3SG1 #

{
    "weapon_sniperrifle2": "cs/g3sg1"
}

Required models:

  • w_g3sg1.mdl
  • v_g3sg1.mdl
  • p_g3sg1.mdl

Required sounds:

  • weapons/g3sg1-1.wav
  • weapons/g3sg1_slide.wav
  • weapons/g3sg1_clipin.wav
  • weapons/g3sg1_clipout.wav
  • weapons/zoom.wav

Machine guns #

M249 #

{
    "weapon_m249": "cs/m249"
}

Required models:

  • w_m249.mdl
  • v_m249.mdl
  • p_m249.mdl

Required sounds:

  • weapons/m249-1.wav
  • weapons/m249-2.wav
  • weapons/m249_boxout.wav
  • weapons/m249_boxin.wav
  • weapons/m249_chain.wav
  • weapons/m249_coverup.wav
  • weapons/m249_coverdown.wav

Delta Particles #

The templates for Delta Particles weapons are stored in the templates/weapons/dp/ directory. Not all weapons are implemented yet. This is work in progress.

Example
{
    "weapon_9mmhandgun": "dp/glock",
    "weapon_357": "dp/python",
    "weapon_eagle": "dp/44desert_eagle",
    "weapon_smg": "dp/smg",
    "weapon_shotgun": "dp/shotgun",
    "weapon_sniperrifle": "dp/barrett_m82a1"
}

Delta Particles changes the way some HL weapons behave as well as adds its own weapons. The common distinctive traits:

  • Weapon models are more rich on sounds (played via animation events).
  • Firearms produce screen shake effect on firing.
  • Weapons may come with randomized amount of starting ammo.
  • In Delta Particles weapons use the holster animation. This is not implemented yet.

Glock #

{
    "weapon_9mmhandgun": "dp/glock"
}

Glock from Delta Particles with burst fire, screen shake and shells ejecting to the left side.

This template is designed specifically for weapon_9mmhandgun, it won’t work properly for other weapons without modifications.

Required model:

  • v_9mmhandgun.mdl (custom model from Delta Particles)

Required sounds:

  • items/9mmclip_insert.wav
  • items/9mmclip_release.wav
  • items/9mmclip_slide.wav
  • items/deploy_default1.wav
  • weapons/common_hand1.wav
  • weapons/common_hand2.wav
  • weapons/glock_slideback1.wav

Python #

{
    "weapon_357": "dp/python"
}

Python with a scope ability and a laser spot when unscoped. This also adds a screen shake effect.

This template is designed specifically for weapon_357, it won’t work properly for other weapons without modifications.

Required model:

  • v_357.mdl (custom model from Delta Particles)

Required sounds:

  • items/deploy_357.wav
  • items/deploy_default2.wav
  • weapons/357_bulletsout.wav
  • weapons/magnum_ammo_in.wav
  • weapons/magnum_ammo_out.wav

.44 Desert Eagle #

{
    "weapon_eagle": "dp/44desert_eagle"
}

Desert Eagle in Delta Particles uses ammo type 44 which is not defined in Featureful SDK. This template uses 357 ammo type. You can change ammo_name to your liking.

Required models:

  • w_44_desert_eagle.mdl
  • v_44_desert_eagle.mdl
  • p_44_desert_eagle.mdl
  • 44shell.mdl

Required sounds:

  • items/44_slide.wav
  • items/44insert1.wav
  • items/44release1.wav
  • items/44slide1.wav
  • weapons/44_gun_fire.wav

SMG #

{
    "weapon_smg": "dp/smg"
}

Required models:

  • w_smg.mdl
  • v_smg.mdl
  • p_smg.mdl
  • 45acp_shell.mdl

Required sounds:

  • weapons/smg_fire1.wav
  • weapons/smg_fire2.wav
  • weapons/smg_deploy.wav
  • weapons/common_hand2.wav
  • items/deploy_default1.wav
  • items/deploy_default2.wav
  • items/smg_clipinsert1.wav
  • items/smg_cliprelease1.wav
  • items/smg_slide.wav
  • items/smg_silencer_add.wav
  • items/smg_silencer_remove.wav

Shotgun #

{
    "weapon_shotgun": "dp/shotgun"
}

This template is designed specifically for weapon_shotgun, it won’t work properly for other weapons without modifications.

Delta Particles uses custom animation events and attachment point for shell ejection. This is not implemented in Featureful SDK. Instead, the ejection delay and shell offset are provided as constant value in the configuration file.

Required models:

  • v_shotgun.mdl (custom model from Delta Particles)

Required sounds:

  • weapons/shotgun_end.wav
  • weapons/shotgun_start.wav
  • weapons/12gauge_in.wav
  • weapons/grip_start.wav
  • weapons/grip_end.wav
  • weapons/common_hand2.wav
  • weapons/reload1.wav (custom sound from Delta Particles)
  • weapons/reload3.wav (custom sound from Delta Particles)
  • weapons/scock1.wav (custom sound from Delta Particles)

Barrett M82A1 #

{
    "weapon_sniperrifle": "dp/barrett_m82a1"
}

Required models:

  • w_barrett_m82.mdl
  • v_barrett_m82.mdl
  • p_barrett_m82.mdl
  • models/snipershell.mdl

Required sounds:

  • items/deploy_barrett.wav
  • weapons/sniper_fire.wav
  • weapons/sniper_optic1.wav
  • weapons/sniper_mag_out.wav
  • weapons/sniper_mag_in.wav
  • weapons/sniper_bolt2.wav
  • weapons/sniper_bolt3.wav