AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [TUT] Replace Weapon Firing Sounds (https://forums.alliedmods.net/showthread.php?t=299376)

Natsheh 08-01-2017 17:08

Re: [TUT] Replace Weapon Firing Sounds
 
Best way is to hook emit sound forward...

klippy 08-01-2017 18:35

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by Natsheh (Post 2539137)
Best way is to hook emit sound forward...

That doesn't work for guns.

Natsheh 08-01-2017 21:18

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by KliPPy (Post 2539163)
That doesn't work for guns.

thats akward it worked with a knife ?

klippy 08-01-2017 21:20

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by Natsheh (Post 2539177)
thats akward it worked with a knife ?

It does work with the knife. But the knife ain't gun, right?

Natsheh 08-02-2017 01:18

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by KliPPy (Post 2539178)
It does work with the knife. But the knife ain't gun, right?

Its a weapon...

HamletEagle 08-02-2017 04:59

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by KliPPy (Post 2539163)
That doesn't work for guns.

He said guns, not weapons.

meTaLiCroSS 08-04-2017 21:38

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by Natsheh (Post 2539177)
thats akward it worked with a knife ?

Weapons shoot sounds are handled on client-side in exception of knife.

Depresie 08-07-2017 02:50

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by meTaLiCroSS (Post 2538617)
So, you haven't tested this?

I did test it some time ago.. it should be fine and now..

Quote:

It works pretty good in first person. But like all other methods, not when others are shooting.
When spraying you can sometimes make out the beginning of the original sound.
I didn't test when other players were shooting, but i will these days, but in theory it should work and when others are shooting too, the initial sound should be cut, but there may be some delay depending on the player's ping.. the only way to fix it would be to recreate the weapon firing function, which would be a little CPU expensive..

Ofc this could be done much better and more efficiently using Reverse Engineered Trio ( ReHLDS + ReGame + ReAPI )
but for that you should ask prostostem@ since he has better knowledge of how the game works..

Black Rose 08-07-2017 10:36

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by Depresie (Post 2540053)
I didn't test when other players were shooting, but i will these days, but in theory it should work and when others are shooting too, the initial sound should be cut, but there may be some delay depending on the player's ping.. the only way to fix it would be to recreate the weapon firing function, which would be a little CPU expensive..

I did test it using podbot so that might be the issue.

meTaLiCroSS 08-10-2017 23:36

Re: [TUT] Replace Weapon Firing Sounds
 
Quote:

Originally Posted by Depresie (Post 2540053)
the only way to fix it would be to recreate the weapon firing function, which would be a little CPU expensive..

Yeah, you might note you did a wrong research.

Whenever you post an snippet you should be fully sure of its functionality. Also, don't test on a listen server, test with on a dedicated one.

Weapons fire sound are handled client-side, this means there's no server code associated to the fire sound. The only association you can assume, is that clients listen to the shoot sound because it's sent to them by its respective PlayBack event (you can send a fire sound after this callback is triggered to override the sound played, you can see code reference on HLSDK, cl_dlls). The player who fires the weapon predicts the sound, and as you know, prediction is what it is: A PREDICTION, it's not synchronized with the server, and this sound could be easily skippable, depending on certain factors.

The only accurate snippet to change this fire sound correctly must be the weapon prediction override.


All times are GMT -4. The time now is 08:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.