More ambient troubles

More ambient troubles

Re: More ambient troubles Posted by Necromancer on Thu May 8th 2008 at 1:40am
Necromancer
392 posts
Posted 2008-05-08 1:40am
392 posts 1499 snarkmarks Registered: May 5th 2008
I got the PakScape file and every thing worked fine. Then I copied all of the new files that I got into a new folder that I created within valve.

Then I use the ambient_generic to make it play one of the wav files when I make a level.

How come whenever I do this it crashes the level and does not play? Do you know why this would happen? Any help would be very appreciated.



Re: More ambient troubles Posted by Le Chief on Thu May 8th 2008 at 7:08am
Le Chief
2605 posts
Posted 2008-05-08 7:08am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
The ambient_generic is one of the most difficult things that new mappers find hard to set up, however with a bit of common sense and knowledge of the file structure, they are very simple and easy to master.

First of all, there is no need to extract these sounds outside the pak file, any mod or map can use these sounds. Say for example we want a sound file inside the pak0 file to play in our map, lets just pick any random one: ambience/boomer.wav. This is what we enter into the ambient_generics file name field, there is no need to enter: c:/sierra/half-life/valve/sounds.... because the game knows where the sound folder is and it will assume that everything you type in the file name field is is inside the sound folder.

If you want the sound to play when you trigger it, than you must check "start silent" in the flags because ambient generics are an on/off kind of entity. When the start silent flag is ticked, this means that the entity will start off in its off state, triggering the ambient_generic entity will cause it to toggle into its on state and play the sound.

Depending on what type of sound it is, you may want it to be playin in a small radius or across the whole level, this is done by the "Play everywhere, small radius, medium radius and large radius" flags, you should only have one of these flags ticked and they are pretty self explanatory.

The only other field you need to worry about is the Volume field, just remember not to put the sound louder than 10, otherwise half-life will crash.

So lets do an experiment, create an ambient_generic with the following settings:

Name: sound01
WAV name: ambience/boomer.wav
Volume: 10

Flags: Play everywhere, start silent

Now create a trigger auto with the following settings:

Target: sound01
Delay before trigger: 2
Trigger to send: on

Now compile the map and the sound should play. And now you know the basics for sound in a map.

Just a final note, and this note applies to models, sounds, sprites and maps. Say for example you have a sound, ambience/hello.wav in a map that is part of a mod. The engine will search 4 areas for the sound:

1) sound/ambience/hello.wav ( in the mod folder)
2) sound/ambience/hello.wav ( in the mod's pak0 file)
3) valve/sound/ambience/hello.wav
4) sound/ambience/hello.wav (in valves pak0 file)

It will first search 1, than 2, 3, 4 and if it dosen't find a sound in those 4 locations, than an error will be produced.
Aaron's Stuff
Re: More ambient troubles Posted by Necromancer on Thu May 8th 2008 at 10:44pm
Necromancer
392 posts
Posted 2008-05-08 10:44pm
392 posts 1499 snarkmarks Registered: May 5th 2008
Thank you for your help. Everything now works fine.
Re: More ambient troubles Posted by Le Chief on Fri May 9th 2008 at 4:08am
Le Chief
2605 posts
Posted 2008-05-09 4:08am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
No worries mate :smile:
Aaron's Stuff
Re: More ambient troubles Posted by Crucifix on Sun May 25th 2008 at 2:57am
Crucifix
2 posts
Posted 2008-05-25 2:57am
Crucifix
member
2 posts 0 snarkmarks Registered: May 25th 2008
How do I make it so the sound loops? Im getting no luck with the wav I made using audacity...Help? :sad:
Re: More ambient troubles Posted by Le Chief on Sun May 25th 2008 at 6:12am
Le Chief
2605 posts
Posted 2008-05-25 6:12am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Any sound can be looped easily. Download a program called "goldwave". This program can be used to edit all your half-life sounds and convert any sound into the right format for half-life (16 bit mono, 22050).

Open your sound in goldwave, than go tools > cue points, than add a cue point at the start of your wave file, then save your file and thats it.

Now when you trigger the sound in half-life, it will keep looping until you trigger it off or if the sound has a "is not looped" flag checked.
Aaron's Stuff
Re: More ambient troubles Posted by Crucifix on Sun May 25th 2008 at 9:02am
Crucifix
2 posts
Posted 2008-05-25 9:02am
Crucifix
member
2 posts 0 snarkmarks Registered: May 25th 2008
Thanks for the quick reply..Worked perfectly
Re: More ambient troubles Posted by Le Chief on Mon May 26th 2008 at 4:11am
Le Chief
2605 posts
Posted 2008-05-26 4:11am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
No problem :smile:
Aaron's Stuff