Skip to content

Custom Weapons

wootguy edited this page May 23, 2026 · 16 revisions

Custom Weapons can be created two ways. The classic method is to create a new subclass of CBasePlayerWeapon and recompile the server. If you want the weapon to hit what you're aiming at and not feel laggy, you would also need recompile and distribute a new version of the client. This is a hassle when porting dozens of weapons used only once per map/mod port.

A new weapon system in this mod can create new weapons without a client update, without introducing input lag, and without breaking lag compensation. This is done through config files that define the attributes and event-based behavior for the weapon.

Weapon data is sent to clients on demand, meaning you can edit weapon behavior live, even if the weapon is being used by a player. An example of this is a weapon that has a silencer attachment. You could add an event that updates the sounds, accuracy, recoil, etc. when the silencer is added. Or maybe you want an experience mod where the fire rate and reload speed increases with your power level.

Configs are in the INI format and are usually organized by action (Primary attack, Secondary attack, Reload). Here's an example config. For an explanation of each section, see these guides:

Custom Weapon Attribute Types
Custom Weapon Attributes
Custom Weapon Events

Clone this wiki locally