Sound event help, please

R

richard_cabeza

Hi, can someone please point me toward a quality tutorial on custom sounds. Everything I've found so far answers my question in a different way, and I'm confused.

Map name: test_map

Here's what I have so far:
4 custom WAVs in the the folder "sound/office_wars/"
redflag10.wav
redflagreturned.wav
blueflag10.wav
redflagreturned.wav

A text script named "test_map_level_sounds.txt". It currently lives in the maps folder next to the actual map file.

I copy/pasted the text for the script from a tutorial or something on this site. Here's what's inside my script:
------------------
"redflag10"
{
"channel" "CHAN_AUTO"
"volume" "VOL_NORM"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_NORM"
"wave" "sound\office_wars\redflag10.wav"
}

"redflagreturned"
{
"channel" "CHAN_AUTO"
"volume" "VOL_NORM"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_NORM"
"wave" "sound\office_wars\redflagreturned.wav"
}

"blueflag10"
{
"channel" "CHAN_AUTO"
"volume" "VOL_NORM"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_NORM"
"wave" "sound\office_wars\blueflag10.wav"
}

"blueflagreturned"
{
"channel" "CHAN_AUTO"
"volume" "VOL_NORM"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_NORM"
"wave" "sound\office_wars\blueflagreturned.wav"
}
--------------------

Inside the map, i've got a logic_relay switch already attached to the briefcase (i figured out an efficient way to send the briefcase home after 20 seconds). I want a sound to play, telling everyone that the flag is about to reset, then another when the flag gets sent back. It's set to:

OnTrigger redflag10 PlaySound (10.01 seconds delay)
OnTrigger redflagreturned PlaySound (20.01 second delay)

They are set to not loop and play to everyone.

In testing, the sounds do not play. It appears that they load, because when I open the console, there's a red message saying 4 custom sounds were loaded. I just must not be triggering them correctly. Any help?
 

Armadillo of Doom

Group Founder, Lover of Pie
aa
Oct 25, 2007
949
1,228
From the looks of it, your problem is the trigger. There needs to be an output or other event to activate the trigger. The most common one is OnStartTouch, but I don't think that applies here. What you need is OnFlagDrop, ActivateTriggerWhatever. OnTrigger means whenever said trigger gets activated by something. Unless you specificy the something, it will never turn on.
 
R

richard_cabeza

sorry, i forgot to include that step. Yeah, i've got the briefcase set to trigger the logic_relay when dropped, then to cancel pending when picked back up. It works well to adjust the intelligence respawn timer (with a kill and forcespawn command on delays).

i also have an update. I just noticed this error as I was closing my test map:

Failed to load sound "sound\office_wars\redflag10.wav", file probably missing from disk/repository
Failed to load sound "sound\office_wars\redflagreturned.wav", file probably missing from disk/repository
Entity 15 (class 'item_teamflag_return_icon') reported ENTITY_CHANGE_NONE but 'm_hOwnerEntity' changed.

It (the sound) plays in Hammer, but do I need another copy of the sounds somewhere else? I'm confused. I'm testing on LAN; do I need to have control of an internet server to add sounds? That seems odd, so I'm hoping not (I just had to ask). p.s. in my test_map, I'm not using the blue flag entities; that's why the error only lists the red files.

Thanks for any help.
 
Last edited by a moderator: