Author Topic: Battle Music Issue - Please help  (Read 651 times)

Legacy_Junnest

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Battle Music Issue - Please help
« on: September 26, 2011, 02:21:44 pm »


               Recently I've returned to NWN after a six year absence and I am refreshing myself with the workings of everything in the toolset and game directory. I've added music to a module of mine successfully to be used during the day and night for the specified area, but I am having an issue figuring out how to make a music file show up under the "Music, Battle" section. The music file has been converted from an mp3 to a wav to an mp3 to a bmu with the proper bitrate and such, and it is currently sitting in my music folder.

Now for the other music files I had to fill in the last line of the ambientmusic.2da file which is now sitting in my override folder, which worked successfully. But where am I supposed to fill in to get the battle music to show up under the "Music, Battle" section? I don't see any other 2da files and I don't see any other examples in the ambientmusic.2da file to go from. Please help.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Battle Music Issue - Please help
« Reply #1 on: September 26, 2011, 02:43:35 pm »


               I'm not sure how that's done, the tracks I added as a test only worked as regular music, not for battle music.  If there isn't a way to do it directly, there is a workaround, though.  Add something like this to the on enter of any area that you want custom battle music in:

void main()
{
MusicBattleChange (GetArea (OBJECT_SELF), GetLocalInt (OBJECT_SELF, "BATTLE_MUSIC") );
}

 The area just needs a "BATTLE_MUSIC" int set on it with the 2da line that has the track you want to play on it.  I tested that just now, and it plays the custom lines properly through that method.

 Obviously, if someone knows how to make it work in the toolset it'd be better, but that's how to go about it if there isn't a way.
               
               

               
            

Legacy_Junnest

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Battle Music Issue - Please help
« Reply #2 on: September 26, 2011, 03:22:00 pm »


               The script compiled successfully, so I'm not saying that it won't work, but with that script the daytime/nighttime ambient music seems to continue playing through battles instead of switching to whatever is set as the battle music and it isn't playing the music I was trying to get it to, either. I probably have the integer wrong, but the file name is mus_fieldfight.bmu. I tried both with and without the bmu at the end but no cigar.

I'm renown amongst my friends for not being too compliant with scripts, so please excuse my newbiness for any obvious/blatant errors I may be making. '<img'>
               
               

               


                     Modifié par Junnest, 26 septembre 2011 - 02:22 .
                     
                  


            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Battle Music Issue - Please help
« Reply #3 on: September 26, 2011, 05:00:37 pm »


               It's almost certain to be an error with the music file or 2da, if it's not appearing on the area music dropdown. Could you show us the line you added to ambientmusic.2da?

Also if you didn't already, try using the Mp3ToBmu 0.35 on the mp3 file. Sometimes mp3 files' header information can make the engine misread the bmu file, for instance if you open it in windows media player, some settings can cause the file to become un-bmu-able. Mp3ToBmu will (usually) fix that.
               
               

               
            

Legacy_Junnest

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Battle Music Issue - Please help
« Reply #4 on: September 26, 2011, 05:08:29 pm »


               That's the same program I used to convert from mp3 to bmu. The file is showing up under the daytime/nighttime music dropdowns, just not the battle music dropdown. Here is the line I wrote in the 2da:

98        ****           mus_fieldfight     mus_fieldfight     ****       ****       "Field Fight"

The first time I wrote it in, it worked the same as it does now (only appearing under daytime/nighttime music). What you're seeing there is the edit I made/my second attempt. Now I know the second time I wrote it is under Stinger 1, because a lot of the files in the 2da with "fight" or "battle" in the name had a Stinger 1 written in. I thought that filling in the Stinger 1 would fix my problem, but obviously not. It didn't change a thing, actually. =P

EDIT:

My other two music files are written in the same way, without the Stinger 1 written in, and they also only appear in the daytime/nighttime music dropdowns.
               
               

               


                     Modifié par Junnest, 26 septembre 2011 - 04:12 .
                     
                  


            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Battle Music Issue - Please help
« Reply #5 on: September 26, 2011, 05:33:05 pm »


               Oh, for a stinger to appear it needs to be a .wav file stored in a hakpak along with the ambientmusic.2da. It's possible without a valid stinger wav the music won't play.
               
               

               


                     Modifié par _six, 26 septembre 2011 - 04:33 .
                     
                  


            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Battle Music Issue - Please help
« Reply #6 on: September 26, 2011, 08:51:58 pm »


               

Junnest wrote...

That's the same program I used to convert from mp3 to bmu. The file is showing up under the daytime/nighttime music dropdowns, just not the battle music dropdown. Here is the line I wrote in the 2da:

98        ****           mus_fieldfight     mus_fieldfight     ****       ****       "Field Fight"


That's due to a weird quirk of the toolset -- a bug or a feature, depending on how you look at it. In order for a track to appear as a valid battle music track in the toolset dropdown, it has to have the text _bat_ in the name, e.g.:

34  61875       mus_bat_rural1   mus_sbat_rural1  ****     ****     **** 

When I added new battle tracks for my modules, I actually had to rename them to mus_bat_*.bmu to get them to show up in the toolset battle track dropdown. You'll have to do the same if you want them to show up there.

There's nothing stopping you from altering the battle tracks to be anything you want via script once the module's been started, though. So you could use MusicBattleChange, for example in the module load script, to set the battle tracks to be whatever you want regardless of what they're named (as long as they're bmus). But if you want the convenience of being able to work with the toolset dropdown lists, I don't know any other way to do it other than to rename them in the way I described.
               
               

               
            

Legacy_Junnest

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Battle Music Issue - Please help
« Reply #7 on: September 27, 2011, 12:16:32 am »


               It works! Thank you everyone for your assistance. Finally I can stop worrying about the music and get along with the rest of the module - I'll try to make it a fun one that hopefully some of you can enjoy. I really do appreciate all the help, Failed.Bard, _six, and AndarianTD. =D