tutorial:replacing-weapon-sounds

You can modify weapon sounds using Soundscripts, which the Source Engine uses and the PAC sound part allows to use them to replace sounds. Read more on Soundscripts in the Valve Developer Community: https://developer.valvesoftware.com/wiki/Soundscripts

You can browse the list of soundscripts by double-clicking, expanding, the game sounds category in the PAC asset browser.

HL2 stuff is in the gmod wiki https://wiki.garrysmod.com/page/Common_Sounds but add-on weapons' soundscripts have to be found in game sounds.

Note that some weapon bases, like M9K, don't work in a way that allows PAC to override soundscripts.

The event which handles this best is animation_event, with “find” attack primary. Most add-on weapons don't have special reload sounds played in third person, but one can use the “find” reload to play a new one if there is no reload sound.

The soundscripts' activation condition depends on which one it is e.g. Weapon_Pistol.Single is when the pistol fires a shot, while Weapon_Pistol.Reload is when you reload it. They have to be activated properly to take effect and modify the right sound.

It is though not recommended to replace reloading sounds for compound reload sequences like those of revolvers and shotguns, since overriding soundscripts requires the sound part to activate at the same time as the original, and the exact timings aren't known in PAC. As such, playing the muted soundscripts in a loop that is not activated by any event could cause issues.

Step 1a- weapon_class event. To find the weapon's entity name, look in the console for “Giving player a weapon_name”, right click and copy to clipboard the weapon's spawnmenu icon and paste it in, or go to the top tab and click tools-show only with active weapon.
Step 1b- animation_event event.
Step 2- replacement sound can be anything, but best use the overlapping flag so it doesn't cut off
Step 3- soundscript sound is the weapon's firing soundscript, most are Weapon_Name.Single or something similar.
  • Last modified: 2 years ago
  • (external edit)