Frictional Games Forum (read-only)

Full Version: How to play sound and area?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to play sound, when player goes to area. How I can do that?
Where do you want to play this sound? Is it ambient or on the player? If it's a sound on the player, like a gasp or reaction, you usually play it on the player using PlayGuiSound. Otherwise, if the sound has a source in the level, use PlaySoundAtEntity. Use either one along with a collision callback to trigger it when the player enters an area.

PHP Code:
AddEntityCollideCallback("Player""AreaName""FuncName"true1);
PlaySoundAtEntity("SoundName""SoundFile.snt""EntityName"0false); 
PlaySoundAtEntity("12_girl_scream", "12_girl_scream.snt", "GirlScream01", 1.0f, true);
Why not just as above...
Entity is also an area...
THink it could become a bit confucing for starters Mud, don't you think?
I think its best to keep starters on the PlaySoundAtEntity function.. Always works!
My bad, I typo'ed Area instead of Entity. Slipped my mind. The correct function is called PlaySoundAtEntity, not PlaySoundAtArea, but it works just like I explained above.

Edited my post.