Custom sounds doesn't play for the client?

Freelancer

Newbie
Joined
Mar 9, 2005
Messages
335
Reaction score
0
I've made a map with a custom sound in it and the sound plays for me, but for the clients it just say "File Missing" or it just doesn't play.
And yes, I got the res file forcing the client to download the sound, the client checked if the sound was there and it was.

So everything is there but it doesn't play for the client? Why?
Is there something I'm missing here?

I've had the same problem when mapping for another map a year ago or so. Some peoples could hear it, some couldn't.
 
If you are using ambient_generics for either looped or triggered sounds, clients who download the map won't hear them until they shut down and restart the entire game and rejoin the server. Also in my experience ambient_generics (mp3 or wav) need to be in the sounds/folder, I presume that is what your .res file is taking care of.
If you use env_soundscapes, they either have to be looped or set to play once on a trigger, env_soundscapes can't be triggered more than once (example: having a custom sound play every time a door is opened). So for sounds that need to be triggered more than once, you can use only ambient_generic, and then clients won't hear them untill a full restart.
Also make sure your files are 44.1 kHz
This is a problem with no fix right now that I know of.
 
One guy heard it the first time he played the map.
The others never hear it, even with a whole PC reboot!

And yes I've got the sounds correctly placed.
It's just that random peoples can hear it while most of them can't and never will.
 
It might be a problem on their end, I had an issue once with users who had ATI video cards, they were getting a trailing ghosting effect, I had one dude send me a screenshot, sure enough it was screwy.
But in my experience, you're better off with env_soundscape, than ambient_generic (you never said which you used).
 
If you're only using one sound, I'd seriously recommend changing the ambient_generic to env_soundscape. An env_soundscape can control randomly played sounds and looping sounds with the one entity.
You'll need to create a txt file named "soundscapes_yourmapname.txt" and place it in your \Program Files\Valve\Steam\SteamApps\%username%\half-life 2 deathmatch\hl2mp\scripts folder (for deathmatch). Place an env_soundscape entity on your map and give the soundscape keyvalue a name. Open up the soundscape_yourmapname.txt file and fill in the text as you like so it looks like this

Example soundscape_mapname.txt file


"soundscape name (same as in hammer)"
{


"playlooping"
{
"volume" ".90"
"pitch" "100"
"wave" "modfolder/filename.wav"
}

"playrandom"
{
"time" "45, 60"
"volume" "0.7,0.75"
"pitch" "100"
"soundlevel" "SNDLVL_NORM"
"rndwave"
{
"wave" "modfolder/filename.wav"
"wave" "modfolder/filename.wav"
"wave" "modfolder/filename.wav"
"wave" "modfolder/filename.wav"


}
}


}


Change those values to match your files and you should be good to go. This example uses one env_soundscape entity to play one looping wav file, and 4 random wave files at intervals between 45 and 60 seconds apart. If you only copy part of this file don't forget to add a close bracket, you need one } for each {

Hope this helps.
 
If you mean parent as in, the sound follows the radio if the radio moves around the map, then yes you can do that. Env_soundscapes have an adjustable radius. Ambient_generics can't be parented to anything btw.
If you mean "parent" as in, toggle the sound on and off repeatedly with a button, then no, an env_soundscape can only be toggled one time with a trigger or button (this goes for env_soundscape_triggerable as well, trust me I've tried this and it doesn't function like that) {output on trigger, target env_soundscape, via this input enable/disable} is the closest you can do, and it won't work twice, that's what ambient_generics are for, but those as you see can be problematic for some people.
Like I said earlier, there isn't any real fix for this, the best you can do is make sure your wav or mp3 files are a proper format (16 bit stereo, 44.1 kHz works but I think there are more variations that will work) and bspzip your custom files into the map. I do this with mine, and even with the sound files bspzipped into the map, they won't play when triggered unless the sound files are ALSO copied to the sound folder, which I do with the .res file so actually on my server the sounds for my map that are associated ONLY with ambient_generic entities (NOT env_soundscapes) are redundantly downloaded and placed in the sound folder of clients. It sucks to bloat the download size, but it seems to work that way.
 
Ambient generics CAN be parented.

Not by adding a parent to them but setting an entity which the sound origins from. If that entity moves, so will the sound.
 
Efter & Freelancer you both seem to know ur custom sound stuff so i could use some help from both of you on this custom sound topic.

I've created a Jet engine that you can interact with in the game and the only thing keeping me from completing it is a few custom sounds i want to use.

If an ambient_generics can be set to stay with the engine ill be using that so what do i need to do to have this sound play when i press the switch that starts the engine up?

Ps. This will be for a singleplayer map for HL2 and to be used in garry's mod9 with a friend.
 
Unarmed said:
Ambient generics CAN be parented.

Not by adding a parent to them but setting an entity which the sound origins from. If that entity moves, so will the sound.

SoundScapes aren't going to work. And I knew this from the beginning because I need to make the sound turn off / on and move.

Ambient Generics is perfect for it. Still it just won't play for most players!
 
Freelancer, sorry I can't be of any more help to you. There are definitely some issues with custom ambient_generics, I've had them myself.

Unarmed, You're absolutely right, and that tidbit slipped my mind, I have set an ambient_generic to eminate from a func_rotating entity once, and it worked great. But I have been at this for so long I have developed a tendency to keep terms technically correct, and technically ambient_generics can't be paranted, although "SourceEntityName" is essentially the same thing. Thanks for pointing that out.

_HL4E_halfLife_ I am guessing you should have the sound be turned on via the same button that starts the engine, by adding another output.
In the ambient_generic's properties there should be a "SourceEntityName" at the bottom, give it the name of your jet engine and the sound should eminate from it, and also give the ambient_generic a name for the button to reference it by.
 
Back
Top