I Ain't Afraid of No Ghost - Interactive Sound
I'm wanting to create a game where you have to locate a ghost using only sound.
The game features 2 active objects, a mouse controlled one called 'hero' and a static one called 'ghost'.
[img:center]http://4.bp.blogspot.com/_lnLKVy468Rk/Smn0n7OpeLI/AAAAAAAAADU/iXkwEbmDVis/s1600/Ghost%2BSound%2BScreen.PNG[/img]
I'd like ghost to emit a moaning sound that gets louder the closer hero gets to it. The sound will be looped from the start of the frame on it's own channel. I'd also like to be able to customize the distance from ghost that hero will start to hear ghost.
If it's possible it would be great if it's in surround sound so you can hear what direction the sound is coming from.
I have no idea where to start. If someone would please have a go at making this happen using the files I've supplied I can study what you've done. I'm not being lazy. I really do learn better that way. Message me I'll give you my email address to sent it back. If your not up for that then you could try to talk me through it. Any help will be appreciated.
A huge thanks in advance.
Ghost Sound.zip (36.2 KB)
http://www.mediafire.com/download.php?zlnmwqn0moi
Contains the following files:
Ghost Sound.mfa
Ghost Sound.wav
Re: I Ain't Afraid of No Ghost - Interactive Sound
As a start with volume you could use the advanced direction object to get the distance between the ghost and the 'hero' as you call it, and set the volume to 100-distance. You can also use panning to show what direction, but I have no idea how to pan. :crazy:
Re: I Ain't Afraid of No Ghost - Interactive Sound
Hey! I've created a little example for you. I hope that's what you wanted. It's no surround but left/right stereo pan.
http://clickteam.info/looki/Examples/StereoSound.mfa
Re: I Ain't Afraid of No Ghost - Interactive Sound
Oh, by the way, in the volume action, you can modify the expression
100-LongDist( "Advanced Direction Object", X( "Hero" ), Y( "Hero" ), X( "Ghost" ), Y( "Ghost" ))/12.0
to
100-[color:#FF0000]([/color]LongDist( "Advanced Direction Object", X( "Hero" ), Y( "Hero" ), X( "Ghost" ), Y( "Ghost" ))[color:#FF0000]-XYZ)[/color]/12.0
XYZ being a distance at which the sounds starts playing.
Set it to 50, and you can hear the sound at around 51 (but it's so silent you won't actually notice it!).
Re: I Ain't Afraid of No Ghost - Interactive Sound
Wow. Thank you for going to the effort. It's awesome. Very clever.
I tried changing XYZ distance to 50 but I'm not sure of how it's done. Could u please post what the volume action looks like when this change is made.
Also what does the 12.0 on the end mean.
Thanks for taking the time to help.
Re: I Ain't Afraid of No Ghost - Interactive Sound
Well, the 12 just divides the volume. So you have to be nearer to hear the sound.
Change the volume action to this.
100-(LongDist( "Advanced Direction Object", X( "Hero" ), Y( "Hero" ), X( "Ghost" ), Y( "Ghost" ))-50)/3.0
I've added the -50, and changed the 12.0 to 3.0.
Now, when you are very near to the ghost, the volume quickly increases, but when you're more than 50 pixels away, it's mute.
Re: I Ain't Afraid of No Ghost - Interactive Sound
Ahhh... Thats how I had it except for changing the 12.0 at the end. That seems to be the key to noticing the change to XYZ.
Now I can finally get my idea off the ground.
Thanks again for all your help Looki.
Re: I Ain't Afraid of No Ghost - Interactive Sound