Multiple soundstreams?

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
LRKfm946
Master Sergeant
Master Sergeant
Posts: 163
Joined: Sun Feb 02, 2014 6:13 pm
Projects :: Battlefront II Hunger Games
Games I'm Playing :: SWBF2 BF3
Contact:

Multiple soundstreams?

Post by LRKfm946 »

My map has 4 different areas with unique environments in each. I'd like to have unique ambient sounds for each area. Is it possible to have soundstream regions overlapping and still work correctly? I remember reading somewhere that it might not be, but I want to make sure.

If not, what would my solution be?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Multiple soundstreams?

Post by Marth8880 »

Yup, totally possible. Just have two instances of your OpenAudioStream line in your LUA like so:

Code: Select all

	OpenAudioStream("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\SFL_s_COR_Streaming.lvl",  "cor1")
	OpenAudioStream("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\SFL_s_COR_Streaming.lvl",  "cor1")
Fun fact: I figured this out only a few days ago when I was playing around with sound streams in my Pioneer Trails map. :o
LRKfm946
Master Sergeant
Master Sergeant
Posts: 163
Joined: Sun Feb 02, 2014 6:13 pm
Projects :: Battlefront II Hunger Games
Games I'm Playing :: SWBF2 BF3
Contact:

Re: Multiple soundstreams?

Post by LRKfm946 »

Awesome, thanks!

If only I could get my sounds to work in the first place :(

EDIT: In my map I have random sky effects (normal, night, and rain) and I'm trying to disable the rain stream for the other two skies like so:

Code: Select all

function weather()
	WeatherMode = math.ceil(GetRandomNumber()*3)
	if WeatherMode == 2 then 
		ReadDataFile("dc:HGS\\HGS_sky.lvl", "rain")
	elseif WeatherMode == 3 then 
		ReadDataFile("dc:HGS\\HGS_sky.lvl", "night")
		DeactivateRegion("GlobalAmb_rain")
	else
		ReadDataFile("dc:HGS\\HGS_sky.lvl", "norm")
		DeactivateRegion("GlobalAmb_rain")
	end
end
Whenever I load the map, the rain sounds aren't disabled, and I get this error:

Code: Select all

Message Severity: 2
.\Source\ActiveRegion.cpp(186)
Region "GlobalAmb_rain" not found
I tried moving the stream to the conquest layer and changing its name, but that didn't work. Any suggestions?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Multiple soundstreams?

Post by Marth8880 »

Easy. Just put each soundstream region in its respective weather variation's layer. ;)
LRKfm946
Master Sergeant
Master Sergeant
Posts: 163
Joined: Sun Feb 02, 2014 6:13 pm
Projects :: Battlefront II Hunger Games
Games I'm Playing :: SWBF2 BF3
Contact:

Re: Multiple soundstreams?

Post by LRKfm946 »

Marth8880 wrote:Easy. Just put each soundstream region in its respective weather variation's layer. ;)
I don't have a world layer for each weather mode, I'm using sky lvls instead (I did this: viewtopic.php?f=27&t=18429)
I have one soundstream region for the rain currently located in the conquest layer of the world. It was originally in the SoundStream layer but I thought moving it might work.

I should add that several other regions are giving me trouble, including damage regions and rainshadow regions. I tried activating the damage region via lua and said region not found again. All of the rainshadow regions are grouped together, and some of them work, some don't.

(I just looked at some stock map files for reference and all the rainshadow region types are RainShadow1, RainShadow2, etc. instead of just rainshadow. I also left out the scale parameters of the damage region, but I don't think that would cause the region not to be loaded or whatever. I'll try those fixes and report back later on it.)
User avatar
yuke5
Field Commander
Field Commander
Posts: 945
Joined: Wed Jun 29, 2011 10:42 pm
Games I'm Playing :: SWBF2 TF2 RC KOTOR
xbox live or psn: My steam is yuke5.
Location: Vermont

Re: Multiple soundstreams?

Post by yuke5 »

Marth8880 wrote:Yup, totally possible. Just have two instances of your OpenAudioStream line in your LUA like so:

Code: Select all

	OpenAudioStream("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\SFL_s_COR_Streaming.lvl",  "cor1")
	OpenAudioStream("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\SFL_s_COR_Streaming.lvl",  "cor1")
Fun fact: I figured this out only a few days ago when I was playing around with sound streams in my Pioneer Trails map. :o
Awww man. This would have been so useful for Skyline. Oh well. I can still use it for Kashyyyk: Village!
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Multiple soundstreams?

Post by AQT »

LRKfm946 wrote:
Marth8880 wrote:Easy. Just put each soundstream region in its respective weather variation's layer. ;)
I don't have a world layer for each weather mode, I'm using sky lvls instead (I did this: viewtopic.php?f=27&t=18429)
I have one soundstream region for the rain currently located in the conquest layer of the world. It was originally in the SoundStream layer but I thought moving it might work.
You'll need to create and utilize those layers, in addition to using sky .lvl files. This explanation here might help: viewtopic.php?p=447781#p447781
Post Reply