Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you block sound?
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#1
How do you block sound?

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
(This post was last modified: 02-05-2012, 10:30 PM by Mackiiboy.)
02-05-2012, 01:03 PM
Website Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#2
RE: How do you block sound?

I don't know if this works, but you should find out which sound file the "fire" is using and then use:

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

I think it should work.
02-05-2012, 09:15 PM
Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#3
RE: How do you block sound?

(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:

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 .

02-05-2012, 09:33 PM
Website Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#4
RE: How do you block sound?

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:

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
(This post was last modified: 02-05-2012, 09:41 PM by Ninami.)
02-05-2012, 09:38 PM
Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#5
RE: How do you block sound?

(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:

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

02-05-2012, 10:07 PM
Website Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#6
RE: How do you block sound?

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
02-05-2012, 10:15 PM
Find




Users browsing this thread: 1 Guest(s)