Adding rain sound effects?
Moderator: Moderators
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Adding rain sound effects?
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?
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?
- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Adding rain sound effects?
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...
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
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.
- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Adding rain sound effects?
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.
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.
Code: Select all
ActivateRegion("regionname")
testfunction = OnEnterRegion(
function(region, player)
ScriptCB_SndPlaySound("SOUND_NAME_HERE")
end
end,
"regionname"
)I'm not sure how to get it to keep replaying, but that SHOULD work for once off.
Info from HERE and HERE.
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
Ummm.... No offence and thanks a lot for trying to help, but it has to repeat...
- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Adding rain sound effects?
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...
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Adding rain sound effects?
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.SW_elite wrote:Ummm.... No offence and thanks a lot for trying to help, but it has to repeat...
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.
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
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.
I did look at the Kamino level, that was a little help, but I didn't get any help from the Lua script.
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Adding rain sound effects?
The only thing you have to change in your LUA is what sound .lvl file to load and that would be kam.lvl.
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
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....
If I cant change the background music I don't think I can do the sound effects....
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Adding rain sound effects?
Code: Select all
ReadDataFile("sound\\kam.lvl;kam1gcw")
--or
ReadDataFile("sound\\kam.lvl;kam1cw")- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
Is that it?
-
AQT
- Gametoast Staff

- Posts: 4910
- Joined: Sat Nov 03, 2007 4:55 pm
- Location: SoCal, USA
Re: Adding rain sound effects?
Yes, otherwise I wouldn't have posted it. 
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
But dosent that mean I have to use Kamino music then?
-
Commander_Fett
- High General

- Posts: 847
- Joined: Fri Oct 17, 2008 9:59 pm
- Projects :: No Mod project currently.
Re: Adding rain sound effects?
yes, you have to use kamino music, since you have to use the kamino sound file to get the rain sound
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
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?
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?
-
Commander_Fett
- High General

- Posts: 847
- Joined: Fri Oct 17, 2008 9:59 pm
- Projects :: No Mod project currently.
Re: Adding rain sound effects?
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.
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Adding rain sound effects?
Good, thats what I thought was meant to happen but I wasent 100% sure. Thanks for clearing it up for me 
