Custom Weapon Sound does not play/all sounds are played Created 2 months ago2024-10-16 19:34:07 UTC by La Hire La Hire

Created 2 months ago2024-10-16 19:34:07 UTC by La Hire La Hire

Posted 2 months ago2024-10-16 19:34:07 UTC Post #349251
I created some simple new weapon sound for the shooting and reloading of the crossbow in Goldsource HL1. I followed the instructions from the tutorials and exported in Audacity as Mono, Wav (Microsoft), 11025 Hz, unassigned 6-Bit or signed 16 Bit.
I moved it to the sound/weapons folder of my mod but when I shoot in game, it automatically loads the reload sound. I tried other settings in Audacity as well and checked a million times the file-names are correct but I dont find the error. When I put the original sound files in the mod-folder it works fine.
Any help please?
Posted 2 months ago2024-10-18 10:49:35 UTC Post #349258
I was not able to fix the root cause but I solved it this way:
Edited the qc-File and entered a direct link to the sounds when they should be triggered:
$sequence fire1 "fire1" fps 60 { event 5004 0 "dartshoot/dartfire.wav" }
$sequence fire2 "fire2" fps 30 { event 5004 0 "dartshoot/dartfire.wav" }
$sequence fire3 "fire1" fps 60 { event 5004 0 "dartshoot/dartfire.wav" }
$sequence reload "reload" fps 30 { event 5004 0 "dartreload/dartreload.wav" }

In the Sound-Folder of the mod I set up two folders with only one wave-file each as in the qc.
Still I had to replace the orignial sound files in the sound/weapons-folder in my mod with 'silent files' (I took the "_comma" from the Barney folder) and the orignial naming. Otherwise it would play my sound and the sounds at the same time.

Still dont understand why this was not working in the first try with the same files.
Posted 2 months ago2024-10-18 20:01:51 UTC Post #349260
Maybe the sounds are being played in code?

https://github.com/ValveSoftware/halflife/blob/master/dlls/crossbow.cpp

Also, do you mean that when shooting the crossbow in your mod, the "reload" sound plays instead? Or that both the "shoot" and the "reload" sounds play? It would help if you shared those sound files with us so we could test it ourselves.

I would suggest you try to investigate further instead of implementing that sloppy fix. Believe me, those hacks are never sustainable in the long term :P
Posted 2 months ago2024-10-21 18:27:36 UTC Post #349270
Oops, looks like we've got ourselves a bot here, gentlemen! I'm gonna submit a status report to the administrator today.
Posted 1 month ago2024-10-23 20:29:10 UTC Post #349274
Thanks for the reply, I was not home the last days.

So here are the both sounds I use (Mono, 11025 Hz, 6 or 18-bit with Audacity):
https://c.gmx.net/@324476459848565342/UUVS97bRTay4BbtR5uKVEg

I overwrite them in the vavle/sounds folder, so not even using a special mode folder. But when I shoot the crossbow ingame, it plays my shoot- and at the same time my reload-sound:
https://youtu.be/YVSsIYWAjpk

Yes the sounds to be played are linked in the coding, but as I just replace them I expect it to work as well... so shooting plays the shooting sound and not both.
Posted 1 month ago2024-10-24 21:32:07 UTC Post #349276
Ok, I just discovered the reason. It's so stupid, and at the same time it was the only possible explanation, so it makes sense.

If you pay attention, you'll hear that when the crossbow is fired in vanilla HL, those two sounds are indeed played. First the "xbow_fire1.wav", and then the "xbow_reload1.wav". And this happens because the crossbow is a manually-operated weapon and Gordon must draw the string again after every shot. Valve just reused the same sound for the full reload animation (a bit cheap on their part).
Posted 1 month ago2024-10-28 19:25:05 UTC Post #349286
Wow you are right, I just overwrote the reload-sound with a "boom"-sound and it is played at the shooting-sequence as well. :glad:
Stupid of me not to try that before :|
Thanks for the reply!
You must be logged in to post a response.