Script Structure
Independent values
Adjust (parent key)
IronSight (parent key)
VMDOF/depth of field (parent key)
WeaponSpec (parent key)
Independent values
Options (sub-parent key)
Melee (sub-parent key)
LaserPointer (sub-parent key)
Activities (sub-parent key)
Recoil (sub-parent key)
Spread (sub-parent key)
Scope (sub-parent key)
Burst (sub-parent key)
Bullet (sub-parent key)
EnergyBullet (sub-parent key)
BulletEntitySpawn (sub-parent key)
HandGrenade (sub-parent key)
Detonator (sub-parent key)
ShootPos (sub-parent key)
NPC (sub-parent key)

SMOD includes a framework for creating up to 30 custom weapons, thanks to flexible scripts that can define everything from firing mode(s) and recoil to laser pointers and melee attacks. Default weapon script values are not explained here, so for more info on typical Half-Life2 weapon scripts and their values, see the VDC weapon script article. All the other values explained below aren't necessarily exclusive to just weapon_custom* scripts and can be applied to hard-coded weapons as well (with some exceptions like ShootPos).

About the organization of this article:

  • This article includes a full weapon_custom*.txt script template below, containing all the known SMOD weapon keyvalues. After that, there are sections of information on all of the values. They are placed in a descending order according to their placement within the script template.
  • An independent value is a simple keyvalue that works on its own or within a parent block. A parent keyvalue is the start of a keyvalue block and within this block you'll find more independent values specific to this block. There are also sub-parent keyvalues, which are lesser parent blocks within another block, which contain their own independent values. Most listed values are independent and each parent keyvalue is sectioned with a heading. The heading provides a guide as to the level of parent keyvalue block. More information on Source keyvalues.

The majority of terms should have links provided, but check the glossary for any terms you don't understand. Also note that keyvalues that rely on number values usually default to 0. If you want a droppable weapon, for instance, you don't have to set NoDrop to 0.



Mapadd Command Reference (Non-LUA)Command Reference (LUA)Getting StartedPorts 'n' Doors
Alarm, Alarm!Color Correction in SMODDoor BreachingMobile APCsWorking With Dropships
Supply Drop (LUA)Countdown (LUA)
kh0rn3's Mapadd Generator
Scripts addcontentsoverride_classsmod_custom_explosivesmodaclistSMOD Soundscripts


excludeweaponsweapon_categoryweapon_customConsole Command List
Other Crosshair CustomizationGenerating AI NodesUsing the NodemakerSubViewCam
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License