Frictional Games Forum (read-only)

Full Version: How do you block sound?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hiho all nice developers!
I'm just wondering if there's any smart way to block sound.

When I'm entering the highest floor on my map, it sounds like the whole house is on fire. I have three rooms with stoves + campfires, and when you're walking near the walls outside the rooms, you hear the sound.

My first thought was to make some kind of invisible entity and make it block sounds. Then it would be easy to just place them inside the walls. I have no idea if it's possible to do this, that's why I'm asking you.
Maybe it already exist better methods to block sounds. Shy
I don't know if this works, but you should find out which sound file the "fire" is using and then use:

Code:
StopSound("Name of sound file", 0);

I think it should work.
(02-05-2012, 09:15 PM)Ninami Wrote: [ -> ]I don't know if this works, but you should find out which sound file the "fire" is using and then use:

Code:
StopSound("Name of sound file", 0);

I think it should work.
That code works, but is not really what I'm looking for. I do still want to have the sound of fire inside the rooms, but not outside. I want to make my custom story more realistic and not let the sound of fire go trough the walls. I'm not even sure if it's possible to make a script for this. But, thanks anyways Shy .

Oh I see, I thought you wanted the sound to stop completely.
Sorry I don't know how that would work.

You could try this function:

Code:
StopSound(string& asSoundName, float afFadeTime);

And when you enter an area, lets say you exit a door, the sound fades away.
And visa-versa when you enter the door, the sound start again.

Just balling some ideas Tongue
(02-05-2012, 09:38 PM)Ninami Wrote: [ -> ]Oh I see, I thought you wanted the sound to stop completely.
Sorry I don't know how that would work.

You could try this function:

Code:
StopSound(string& asSoundName, float afFadeTime);

And when you enter an area, lets say you exit a door, the sound fades away.
And visa-versa when you enter the door, the sound start again.

Just balling some ideas Tongue
Great idea! I have never thought about it before. Then I will just put two script areas, next to each other, that always are active, inside the doors to the rooms. One for fade in sound, and one for fade out sound.
I hope I can get this to work now.
Thanks for your idea Shy

No problem! If you have any problems don't hesitate to ask Smile

There might be a way to do this perfect but I don't really know how, but this way is pretty close Tongue