|
|
Triggering Sounds in your Map Difficulty: Intermediate |
| Category: CS:S > Mapping | Author(s): SGT_kick_ur_ass |

Okay so you've probably read my last tutorial on Adding Sound but you weren't sure how to use your sound because it doesn't loop right? Well this tutorial will show you how to use the sounds that don't loop and how to make it so that they only play when you reach a certain part of the map.
Start off by opening your map and using the entity tool ( ) add in the entity ambient_generic.
I just made a quick example map, in this map the sound will play when the player goes through the doorway.

Yours can be different, it doesn't really matter because it's all the same thing when it comes to setting it up.
Now open up your ambient_generic entity and you should see the following

Go ahead and give it a name, I called it sound, you can call it whatever you want as long as it has a name because you will need it.
Now move on to the Sound Name Option and search for a sound file. My door will have a bell sound when the player walks through it so I filtered the word Bell.

The other options should stay the same, there isn't really a need in changing them.
Now move onto the Flags Tab that's at the top. You should notice that there are 2 options selected, well unlike my last tutorial, these you should keep the same because the sound doesn't loop, and you don't want it playing when the map starts, you want it to be triggered.

You can now close the ambient_generic properties window because we don't need it anymore, we are done for this part.
Now onto setting up the trigger. This is pretty simple once you get the hang of it.
Create your trigger brush and use the tools/toolstrigger texture for it. Place it where you want the sound to trigger, so for my map I'll be placing it in the center of the doorway.

Now this is what you need to choose on your own. There are 2 entities that you can tie this brush to but each are different. If you want the sound to trigger only once, then use the entity trigger_once. If you want it to trigger each time you go though the door, then use the entity trigger_multiple. In this tutorial I'll be using trigger_multiple, but you can use trigger_once if you want because the set up is the exact same.
So, tie the brush to trigger_multiple or trigger_once and open up the properties menu. Go ahead and give it a name.

That's the only thing we have to do there, no move on to the Outputs Tab, clickAdd and key in the following:
My Output Named: OnTrigger
Targets Entities Named: sound or the name you gave the ambient_generic
Via This Input: PlaySound
It should look something like this:

You're done! Now just compile and test it ingame, if you used a Trigger_multiple you should notice that it plays each time you go through the trigger. If you use a trigger_once it will only play once.
If you have any Questions, please do not hesitate to ask me, I am willing to help.
Example Map
www.halflifestorm.com
Half Life Storm Studio
|
| Added: 2 years ago | Tags: triggering, sounds, your |
 Add Feedback Provide constructive feedback. What is "constructive"?You cannot post yet!Get involved on FPSB by posting your thoughts. Give authors your feedback to help them develop. To post in this submission register or login. |
 You cannot assess yet!Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure. To vote on this submission register or login. This Tutorial in a nutshell... Helpful & Handy 1 x Helpful 1 x Handy 1 x Well Written You cannot stamp yet!Stamps let you apply characteristics to submissions to help others understand them. To stamp this submission register or login.
 |
Half Life Storm The Mappers Corner! |
| Membership: On Request |
| Primary Skills: Compiling, Mapping, Modelling, Motion Graphics, Texturing, UV Mapping |
| Inception: 3 years ago |
Want more? Find related tuts. |