Adding Menu Music¶
This guide will show you how to add more menu to the ssf2 menu sound track.
Files¶
These files will be needed
/sound/ssf2_audio.ssf/ssf2/ssf2.swf
Editing Main.as¶
First go into Main.as in ssf2_audio.ssf and add menumusic3 line under the menumusic2 class
public var menumusic1:Class;
public var menumusic2:Class;
public var menumusic3:Class; // <--- Your new code
public var starman_music:Class;
Note
If you want to add more than one song you can add menumusic4, menumusic5… etc.
Go down to the main() function and add your new Class to the mainmenu3 variable
public function Main()
{
this.battle_results = Main_battle_results;
this.menumusic1 = Main_menumusic1;
this.menumusic2 = Main_menumusic2;
this.menumusic3 = Main_menumusic3; //<--- Your new code
this.starman_music = Main_starman_music;
Adding the music¶
Now stay in ssf2_audio.ssf and go to the sounds folder, near the bottom you should see DefineSound 292 and 293 with the linkages of Main_menumusic_2 and 1.
Add your Music to the song list and make sure it has the correct linkage of Main_menumusic3
Adding the Class file¶
Still in the ssf2_audio file, Create a new file called Main_menumusic3 and add the code from below. After this add it to the scripts file.
package
{
import mx.core.SoundAsset;
public class Main_menumusic3 extends SoundAsset
{
public function Main_menumusic3()
{
super();
}
}
}
You now should be done with ssf2_audio.ssf so compile it and add it to the game
Editing the Source¶
Go to src/[Game Version]/com/mcleodgaming/ssf2/audio.SoundQueue.as and go to the playmusic function (around line 165)
Edit the code to add your new menumusic3 song in
if(soundName === "menumusic")
{
if(this.m_currentSongID === "menumusic1" || this.m_currentSongID === "menumusic2"|| this.m_currentSongID === "menumusic3"|| this.m_currentSongID === "menumusic4"|| this.m_currentSongID === "menumusic5"|| this.m_currentSongID === "menumusic6"|| this.m_currentSongID === "menumusic7")
{
soundName = String(this.m_currentSongID);
}
else
{
var menuMusic:Array = ["menumusic2","menumusic3","menumusic4","menumusic5","menumusic6","menumusic7"];
var idx:int = Math.floor(Math.random() * menuMusic.length);
soundName = String(SaveData.Unlocks.alternate_tracks && Utils.random() > 0.5 ? menuMusic[idx] : "menumusic1");
}
}
Note
I added my own code for scalability and yeah I think that’s how you do it.
Enjoy???¶
An Example from the SSF2 Remix Mod