How would I go about replacing the combine sounds for NPCs?

simple as that, I want to know how I would replace the audio of the combine for NPCs. its been bugging my players when they are fighting droids in starwarsRP and they are hearing combine radio chatter and such. I want to either replace the sounds with random audio of battle droids, and if possible have it where certain NPCs that are not droids but are also hostile have their own diolog aswell that isn’t a droids voice. so far I have been hunting down how to disable those NPC sounds, recently getting a little bit of an insite of where to look for it. but still needing a bit of help with this.

Take a look at EntityEmitSound and take a look at emitter, check if he’s a combine and then suppress it sound


I would probably go with this, saves the client from having to download any files

Use this to figure out which sounds you wish to replace, and format the sounds as shown with the exact same sound name to overwrite the default HL2 sounds. You will have to make the clients download these files through either fastDL or a workshop addon otherwise the players will continue to hear the default sounds.

For example, replacing all the combine soldier’s deaths sounds, I would first find the sound I wish to replace it with, then find the combine’s death sound ( npc/combine_soldier/die1.wav, npc/combine_soldier/die12.wav, npc/combine_soldier/die3.wav )

Then, rename your desired sound to the one you wish to overwrite (you could either find 3 different sounds and rename them accordingly or just use one sound and copy it three times) and then place them in

youraddon/sound/npc/combine_soldier/die1.wav and so on.

Hope this helps

Would it be inefficient to, for each sound played, check the emitter to see if it has a specific model to determine what sound to play?

No, getting the player model is no work for the game.
I wouldn’t worry too much about efficiency unless your doing a whole lot of stuff in think or draw hooks that run every frame