how to add a custom hero music? [Solved]

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
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

how to add a custom hero music? [Solved]

Post by Brucelciolino »

is there any tutorial about how to add a custom music in "SoldierMusic"?
Last edited by Brucelciolino on Fri Mar 11, 2022 11:47 pm, edited 1 time in total.
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: how to add a custom hero music?

Post by Marth8880 »

Exact same way you add any other kind of music. :)

See here - viewtopic.php?f=27&t=12236
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: how to add a custom hero music?

Post by Brucelciolino »

Marth8880 wrote:
Thu Mar 10, 2022 7:29 pm
Exact same way you add any other kind of music. :)

See here - viewtopic.php?f=27&t=12236
I added the song to "sound/worlds/EFX/streams" with the name "Boba.wav"

I added to "efxcw_music.stm" as "Streams\boba.wav imp_hero_Boba_lp"

I added to "efxcw_music.mus" as
Music()
{
Name("imp_hero_Boba_lp");
Priority(1.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("imp_hero_Boba_lp");
}

And I wrote "imp_hero_Boba_lp" in SoldierMusic from Boba Fett's odf
But the music never appears
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: how to add a custom hero music?

Post by Marth8880 »

What about the needed changes for the snd file and lua file?
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: how to add a custom hero music?

Post by Brucelciolino »

Marth8880 wrote:
Fri Mar 11, 2022 11:39 am
What about the needed changes for the snd file and lua file?
I have now added the following text to the snd:
SoundStream()
{
Name("imp_hero_Boba_lp");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
CyclePlayback(1);
Stream("efxcw_music");
SegmentList()
{

}
}

In EFXg_con.lua I had already added the ReadDataFile("dc:sound\\efx.lvl;efxcw")
and also OpenAudioStream("dc:sound\\efx.lvl", "efxcw_music")

Is there anything else I need to add to .lua?
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: how to add a custom hero music?

Post by Marth8880 »

Make sure to add an actual Segment to the SegmentList as well. It should refer to the wav file (or its alias) in the stm file.
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: how to add a custom hero music?

Post by Brucelciolino »

Marth8880 wrote:
Fri Mar 11, 2022 8:41 pm
Make sure to add an actual Segment to the SegmentList as well. It should refer to the wav file (or its alias) in the stm file.
I got it, thank you
Post Reply