Page 1 of 1
Adding rain sound effects?
Posted: Fri Jun 11, 2010 6:48 am
by SW_elite
I had a search for the answers I needed but nothing I found was specific enough for me.
So what I need to know is how do I set up a SoundRegion to play the rain sound effects and what LUA work is needed?
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 6:54 am
by lucasfart
I haven't done any work on that stuff, but i'm thinking that when you create the region, there should be a box wher you can enter the sound, maybe? Or you could just make a normal region and use the "onenterregion" command in lua. I can't be any more specific though, as i've never tried it myself...
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 6:59 am
by SW_elite
I was thinking of the OnEnterRegion command but it's not the usual way and I don't even know how to code yet, I'm mainly into skinning, modeling and mapping.
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 7:09 am
by lucasfart
Well. From a copy/paste of Mav's script, i'll say to try this. I have no prior experience so don't blame me if it doesn't work.
Code: Select all
ActivateRegion("regionname")
testfunction = OnEnterRegion(
function(region, player)
ScriptCB_SndPlaySound("SOUND_NAME_HERE")
end
end,
"regionname"
)
Where "regionname" is the name of your region, and "SOUND_NAME_HERE" is your sound....
I'm not sure how to get it to keep replaying, but that SHOULD work for once off.
Info from
HERE and
HERE.
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 7:14 am
by SW_elite
Ummm.... No offence and thanks a lot for trying to help, but it has to repeat...
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 7:18 am
by lucasfart
Yeah, i know, but i wasn't sure how to get it to go on a loop. I'll look into it. Sorry, and i know you'll probably not even use this, but i'm just learning to script myself, so it'll be handy for me to figure this out anyway, and probably for you too...
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 8:55 am
by Maveritchell
SW_elite wrote:Ummm.... No offence and thanks a lot for trying to help, but it has to repeat...
Using a script callback to play a sound can be used on either a looping sound or on a non-looping sound. However, whenever you have questions about something like this, it's always best to see how Pandemic's already done it.
In this case there are regions with specific sound-related properties - what you want is a "Sound Stream Region," and you can read about these in your documentation or you can simply open up a stock map and see how it works.
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 7:53 pm
by SW_elite
I did, I looked at Kamino, but I just forgot to add that into the first post. I saw the Sound Stream Region and I looked at the properties bit and I couldn't understand where the sound actually came from... And I couldn't understand where to add/change the script to make the Region work....
I did look at the Kamino level, that was a little help, but I didn't get any help from the Lua script.
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 7:58 pm
by AQT
The only thing you have to change in your LUA is what sound .lvl file to load and that would be kam.lvl.
Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 8:22 pm
by SW_elite
Where do I change it though, I can't figure that out?
If I cant change the background music I don't think I can do the sound effects....

Re: Adding rain sound effects?
Posted: Fri Jun 11, 2010 10:27 pm
by AQT
Code: Select all
ReadDataFile("sound\\kam.lvl;kam1gcw")
--or
ReadDataFile("sound\\kam.lvl;kam1cw")
Look familiar? You obviously have done it before according to
THIS topic.
Re: Adding rain sound effects?
Posted: Sat Jun 12, 2010 1:31 am
by SW_elite
Is that it?
Re: Adding rain sound effects?
Posted: Sat Jun 12, 2010 12:51 pm
by AQT
Yes, otherwise I wouldn't have posted it.

Re: Adding rain sound effects?
Posted: Sat Jun 12, 2010 6:33 pm
by SW_elite
But dosent that mean I have to use Kamino music then?
Re: Adding rain sound effects?
Posted: Sat Jun 12, 2010 8:32 pm
by Commander_Fett
yes, you have to use kamino music, since you have to use the kamino sound file to get the rain sound
Re: Adding rain sound effects?
Posted: Sat Jun 12, 2010 8:51 pm
by SW_elite
Hmmm, Okay... I think i'll just have to go with it then...
I'll give it a try and see if it works
EDIT: Just a question... After I get the music working, do I make the sound stream region in ZE and then munge?
Re: Adding rain sound effects?
Posted: Sat Jun 12, 2010 11:29 pm
by Commander_Fett
copy the sound section from the kamino lua, make it read the kamino sound file, add the region in ze (check the kamino map in ze to see what is supposed to be in the fields) and munge, and the sound should work.
Re: Adding rain sound effects?
Posted: Sun Jun 13, 2010 2:03 am
by SW_elite
Good, thats what I thought was meant to happen but I wasent 100% sure. Thanks for clearing it up for me
