Page 1 of 1

how to add a custom hero music? [Solved]

Posted: Wed Mar 09, 2022 5:06 pm
by Brucelciolino
is there any tutorial about how to add a custom music in "SoldierMusic"?

Re: how to add a custom hero music?

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

See here - viewtopic.php?f=27&t=12236

Re: how to add a custom hero music?

Posted: Fri Mar 11, 2022 10:01 am
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

Re: how to add a custom hero music?

Posted: Fri Mar 11, 2022 11:39 am
by Marth8880
What about the needed changes for the snd file and lua file?

Re: how to add a custom hero music?

Posted: Fri Mar 11, 2022 1:52 pm
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?

Re: how to add a custom hero music?

Posted: Fri Mar 11, 2022 8:41 pm
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.

Re: how to add a custom hero music?

Posted: Fri Mar 11, 2022 11:12 pm
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