Let me preface this by saying this topic would be more suited to the Mod Development subforum.
Glowbomb12 wrote:Hello, I am completely new to this forum
Hello!
Glowbomb12 wrote:wanted to ask if there was a way where I can have the Federation bonus music play when I'm in the Last Stand sector, but then change to the Last Stand music only when I'm fighting the flagship.
I don't think it would be possible to set it only during the flagship fight, but it is possible to make it play separate tracks in combat and explore.
Glowbomb12 wrote:I've gotten as far as slipping in the audio into where it needs to be and I've set the game to be able to play it, but I noticed that the game would just cycle between the 2 tracks with what I currently have.
okay, so it sounds like
1) you created a new <track> in sounds.xml and added that track to the final sector in sector_data.xml. as you said that will add a new song to play after the current song ends.
2) which means you know how to make a mod...? otherwise how would you have added a new track...?
Glowbomb12 wrote:Unless I can just set Federation as "explore" and Last Stand as "battle", I cant think of any other way that I can get my idea to work.
Yeah instead you should do that, which as I said is close to what you want but not quite. Last Stand song will play in all sector 8 battles, but it's pretty close. But it's also important to note that when you start a battle the song will play from wherever you left off in the explore song, since the regular tracks are designed to fade into each other to make it natural.
Anyways, it sounds like you already know where the music should go and how to create a <track> in sounds.xml, so basically you just change the <explore> of the "laststand" <track> to whatever the Federation (Bonus) track's file name is, and then add a <combat> tag below it with the name of the Last Stand track (bp_MUS_LastStand.ogg). You shouldn't need to edit sector_data.xml.
(Vanilla sounds.xml for reference)
Code: Select all
<music>
...
<track>
<name>laststand</name>
<explore>bp_MUS_LastStand.ogg</explore>
</track>
...
</music>
if you only play vanilla without other sound mods, you can just add the entire <music> tag (like you probably did to add the separate track) and change the <track> with <name> laststand:
Code: Select all
<!-- this is sounds.xml.append -->
<music>
...
<track>
<name>laststand</name>
<explore>{put the file name of the bonus track here, including extension}</explore>
<combat>bp_MUS_LastStand.ogg</combat>
</track>
...
</music>
That should work.
But like I said if you play with multiple sound mods, this is a better approach:
(Note that as of FTL 1.6.1+, music in audio/ must be in .ogg format)
The below is functionally equivalent to rewriting all of vanilla's <music> and making edits to change the laststand <track>. However, the special tags here will not break mods that add/modify <music> in any way, except for changes to the laststand <track>. I've explained what each command does in comments.
Code: Select all
<mod:findLike type="music"><!-- find the <music> tag -->
<!-- find the <track> with <name>laststand</name> -->
<mod:findWithChildLike type="track" child-type="name"><mod:selector>laststand</mod:selector>
<!-- set the explore track to be the Federation bonus song, the combat track to be the Last Stand song -->
<mod-overwrite:explore>{put the name of the bonus track here}</mod-overwrite:explore>
<mod-append:combat>bp_MUS_LastStand.ogg</mod-append:combat>
</mod:findWithChildLike>
</mod:findLike>