Adding a special music file

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Adding a special music file

Post by jcb989 »

Me again. Hey, I want to add one special mp3 file for music to my scenario.
I'd rather it didn't play the whole game, so, what are my options?
I could not conclude what I need to do from other posts, although I tried a few things.
So I guess I need to know:

1. where do I put the new mp3 file for my scenario? Does it go here: \\Scenario_Name\Data\Music or must it be in the main music directory (I think not)?

2. any special rules for the mp3 file? size, length, or bit-quality?

3. what do I put in the music.txt file (BA-standard example below)?

4. Is DEPLOY below, also including Force Selection? That would be the ideal time to play the music file such that is not too bothersome for players.

MainMenu // emtMainMenu
Campaign // emtCampaign
Deploy // emtDeploy
Battle // emtBattle
Won // emtWin
Lost // emtLose
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Adding a special music file

Post by pipfromslitherine »

You should be able to put the mp3 file into the local scenario music folder. Then just put the non-typed filename into a local music.txt file. I believe it will look for a local file, then use a global one for any that are not local.

As for when they are used, I'm not entirely sure off the top of my head. The main ones will be battle (the whole battle). I think deploy below is indeed force selection.

Cheers

Pip
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

Okay, I'll try it again. I think the mistake I am making is the path location for the local scenario music folder.
I tried using it here:

\\Scenario_Name\Data\Music

But I think it belongs maybe somewhere else, have to go look at the main game folder structure one more time.

I'll go try again and report back. Last time the time that prompted my post, all I heard was the sound of silence, so I know I did something wrong lol.
thanks Pip
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

OK, it worked! LOL and it is damned entertaining, hehe

\\Scenario_Name\Data\Music is the correct location.

I cut down my filename this time to be under 12 characters, if that made the difference I don't know but Deploy is music played during force selection, yes. It may also be during unit placement if there is a deployment phase (in this particular scenario there isn't).

The music continues to play inside of BA proper even after force selection is done, upon exit, so as I navigated back to Multiplayer games the song was still playing until it ran through (about 2 minutes) or another song is initiated by somewhere else. Very cool. haha

Thanks Pip,
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

I continue to debug, lol. Now my one added song is all that will play during the whole mission lol.
That could be annoying. I added all the original music files called in my music.txt file, back into the music folder of the local scenario.
No dice. I haven't restarted a new game yet but in the one I am play testing, adding the files didn't do anything. hmmm...
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

Problem remains unresolved, but no worry anymore. I simply merged my mp3 file with the main battle song mp3 used in BA Bulge missions.
And whola! I have music that recycles continuously, with my new song included and not completely irritating playing over and over.
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Adding a special music file

Post by pipfromslitherine »

Cool. I wasn't entirely clear that you were in fact having a problem, so glad it is solved! I must confess that I don't remember exactly how all the music and transitions work, or are supposed to work! :)

Cheers

Pip
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

No worry. I think, but I'm not 100% sure, that only the song associated with "Battle" in the music.txt file is called during multiplayer. I never hear any of the other ones to my knowledge, only in sinlge-player mode I think.
Anyway, its working and hopefully folks enjoy the change of pace during that scenario. Did you take a listen? =)
I have all the words if you care to know them in english...
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

Sorry to be the music pest. I am receiving reports that iPad users cannot hear my sound track, while PC users can....
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Adding a special music file

Post by pipfromslitherine »

Hmmm. I don't recall doing anything to the mp3s for the music. Is your mp3 the same format as the existing ones? Maybe the iPad doesn't like specific formats.

Cheers

Pip
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Adding a special music file

Post by pipfromslitherine »

Hmmm - or it could be a bug with case sensitivity on an unexercised code path... I will check it out in the morning.

Cheers

Pip
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

the case sensitivity bit me in the arse on the .lst file so let me go look at that, didn't think of that and obviously not fully aware how important that is, or when its important. I guess it will be hard for me to 100% test without re-uploading my code to someone with an iPad...hmmm... but if I find Beattles instead of beattles then I think we can presume that is the issue lol (j/k)
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

Here is the content of the music.txt file:
MainMenu // emtMainMenu
Campaign // emtCampaign
PanzerliedMix // emtDeploy
Battle // emtBattle
Won // emtWin
Lost // emtLose
Here is the name of my mp3 file:

PanzerliedMix.mp3

the meta-tag information matches nothing but there is some meta-tag info about the song in there.
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

Since the cat is out of the bag on my little music addition, here is some background information:

http://en.wikipedia.org/wiki/Panzerlied

http://www.worldwar2aces.com/panzerlied.htm
(more versions of the song)
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Adding a special music file

Post by pipfromslitherine »

It is more likely a problem in the code re:case sensitivity - on iPad if you download a mission pack then it gets unpacked automatically with upper case filenames, which the system expects.

Cheers

Pip
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: Adding a special music file

Post by jcb989 »

Okay. I will make the correction in the next revision and report back.
In the meantime, I will ask kingt to edit his music.txt file to call the filename in UPPERCASE and see if that works.
Post Reply

Return to “Battle Academy : Modders Corner ”