How can I disable music switching?

I made an in-game music player years ago and successfully got it work on HWRM recently.

But then I found a problem:
HWRM will switch music when current player’s fleet is under attack. That is something my script can’t be aware of.
My question is, if there is a method to disable that so that my music player can do it’s job properly?

In the level file, maybe disable the setBattleMusic() function.

Won’t help - if you do that, the game will just revert to the default battle music defined in Homeworld2.big/soundscripts/soundconfig.lua

I too was having issues with this, but I didn’t notice the soundconfig.lua. Maybe there’s a way to turn off this feature there.

Well i’m sure i have solved this issue. To way i think i have done it is to disable the new music code and enable the old classic music code, to do this u have a soundscripts folder in your mod folder and in there you should have the soundconfig.lua file open this and change the following
– boolean defines
TRUE = 1.0
FALSE = 0.0
– boolean defines
TRUE = 0.0
FALSE = 1.0

And to what i think has changed the new code to the old way

I was also able to simply comment out the default battle music line which restored the old behavior. Great find matththegeek! Thanks!

I know this is a stretch, but is it possible this different way music is functioning, could it be related to why the planet killer music doesn’t play in the final mission of HW2R?

AFAIK, this issue only effects multiplayer/skirmish. The planet killer music may not be playing because of an omission in that level’s file.

Hi while this is an older topic the situation is exactly the same for me right now…

I’m currently attempting to insert the Music into the Somtaaw Mod and thus far it works just fine. Except for that tiny exception that it also changes the music for me in battle (which is actually preferred) my real issue is that it always plays the same ambient track and the same battle track despite having so many the game can choose from.

How can I enable a randomized function? Furthermore despite -bigOverwrite it still played the original HW2 music over my Cataclysm Music till for testing purposes I renamed the original music.big to another file type. I did paste the songs in the same fashion and file structure as in the original…


I’d also comment out the

2 lines here:

– FEMusic: string, the file to use as the Front End Music Track, also is the default mission music if nothing is selected --FEMusic = “data:sound/music/ambient/amb_03”
– FEBattleMusic: string, the file to use as the battle music during combat --FEBattleMusic = “data:sound/music/battle/battle_01”

And after that I noted that it actually changed the music at least for the ambient songs but only to return to the same song original which played prior to the track change. Any ideas? How did you guys solve it @tempest6677 @HW_Lover ??

I assume per random script? Could I barrow this script from the 2 of you perhaps? For the benefit of the Cataclysm feeling inside that mod?

Randomized music is NOT part of Homeworld Remastered. You’ll need a script for that.
My mod has a pretty fine-tuned random music script that plays a variety of music to suit the way Freespace structures its’ transitions… The problem with using the Gearbox ambient and battle tracks is that it will be harder to control them during the game- which is why I’ve opted to keep the music functions I use separate.
Since Cataclysm is my favorite installment of the Homeworld franchise, I definitely see not problem sharing what I’ve got with the community. Just a heads up; you’ll need to do a bit of tweaking so it fits your selection of tracks and lengths. When it’s set up right though, it works perfectly.
If you have any questions, shoot me a PM.

This is my music player mod. You may do some tweak to add your tracks and their lengths to it and put it into your mod.
Remember that make sure there’s no space in the name of the music, or the game may crash when you try to load a saved game.
Feel free to PM me if you have any question.

Fantastic I thank you both I will test out both scripts… I might go with @tempest6677 his script this time. While I know your music player even since hw2 vanilla and loved it @HW_Lover I think for the true feeling of Cataclysm not being able to choose your track makes more sense. Although if yellow could manage to separate both things between the SP campaign he’s working on and mp skirmish I might go with your tool after all.