Adding rain sound effects?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Adding rain sound effects?

Post 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?
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding rain sound effects?

Post 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...
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post 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.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding rain sound effects?

Post 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.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post by SW_elite »

Ummm.... No offence and thanks a lot for trying to help, but it has to repeat...
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Adding rain sound effects?

Post 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...
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Adding rain sound effects?

Post 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.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding rain sound effects?

Post 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.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post 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.... :(
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding rain sound effects?

Post 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.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post by SW_elite »

Is that it?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Adding rain sound effects?

Post by AQT »

Yes, otherwise I wouldn't have posted it. :roll:
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post by SW_elite »

But dosent that mean I have to use Kamino music then?
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: Adding rain sound effects?

Post by Commander_Fett »

yes, you have to use kamino music, since you have to use the kamino sound file to get the rain sound
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post 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?
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: Adding rain sound effects?

Post 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.
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia!!!

Re: Adding rain sound effects?

Post by SW_elite »

Good, thats what I thought was meant to happen but I wasent 100% sure. Thanks for clearing it up for me :)
Post Reply