Need help with musicdef.mdl modification

A place to discuss user-created Allegiance music, soundfiles, chatpacks, and other audio-related content.
Post Reply
Zero_Falcon
Posts: 413
Joined: Tue Jun 03, 2008 5:14 am
Location: Singapore

Post by Zero_Falcon »

I want to mod the musicdef.mdl file in a way that the 'flightMusicXBSounds' (where X is a number) still play even when I get into a dogfight or come under fire (for that matter 'flightMusicXCSound' is used). I tried replacing the "GainSound(MusicGain, ImportWave("musicXX"));" with "RedbookSound(AllegianceCD, X);", but in doing so any music that was playing the moment I get in a dogfight will stop and no music will play for a certain amount of time. I want the previous music track to keep playing.

Below is the code musicdef.mdl.

Code: Select all

use "gamepanes";

gameScreenMusicSound        = GainSound(MusicGain, ImportWave("music02"));
flightMusic1ASound          = GainSound(MusicGain, ImportWave("music03"));
flightMusic1BSound          = GainSound(MusicGain, ImportWave("music04"));
flightMusic1CSound          = GainSound(MusicGain, ImportWave("music05")); //This is the music I wish to prevent playing
deathMusicSound             = GainSound(MusicGain, ImportWave("music06"));
flightMusic2ASound          = GainSound(MusicGain, ImportWave("music07"));
flightMusic2BSound          = GainSound(MusicGain, ImportWave("music08")); 
flightMusic2CSound          = GainSound(MusicGain, ImportWave("music09")); //This is the music I wish to prevent playing
flightMusic3ASound          = GainSound(MusicGain, ImportWave("music10"));
flightMusic3BSound          = GainSound(MusicGain, ImportWave("music11"));
flightMusic3CSound          = GainSound(MusicGain, ImportWave("music12")); //This is the music I wish to prevent playing
gameOverLostMusicSound      = GainSound(MusicGain, ImportWave("music13"));
gameOverWonMusicSound       = GainSound(MusicGain, ImportWave("music14"));
If you notice, I replaced the 'SFXGain' with 'MusicGain' so I can alter the music volume without affecting the SFX volumes.

Help please, thanks in advance! :D
pkk
Posts: 5417
Joined: Tue Jul 01, 2003 7:00 am
Location: Germany, Munich

Post by pkk »

Zero_Falcon wrote:QUOTE (Zero_Falcon @ Mar 21 2010, 11:42 AM) I tried replacing the "GainSound(MusicGain, ImportWave("musicXX"));" with "RedbookSound(AllegianceCD, X);", but in doing so any music that was playing the moment I get in a dogfight will stop and no music will play for a certain amount of time.
Why do you want to play tracks from Audio CD?!

If no Audio CD is insert, no track is playing. :P

Why don't you replace the sound files with empty one (no content, not 0 byte files!)?
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
Zero_Falcon
Posts: 413
Joined: Tue Jun 03, 2008 5:14 am
Location: Singapore

Post by Zero_Falcon »

pkk wrote:QUOTE (pkk @ Mar 21 2010, 08:04 PM) Why do you want to play tracks from Audio CD?!

If no Audio CD is insert, no track is playing. :P
Exactly, that was my first attempt to prevent any track from playing! :lol:

Not that I want to play music from a CD I don't have.
HSharp
Posts: 5192
Joined: Fri Aug 11, 2006 11:18 am
Location: Brum, UK

Post by HSharp »

I think it's the wrong file to be looking at, that file will change the music tracks, not when it chooses to play the tracks so even replacing it with a 0kb file it will still interrupt any existing music and then just keep playing the 0kb file which is why you just get no music (until the event changes so it will play some other music)

A silly fix would to just replace music05/09/12 with whatever music file you do want it to play but it will still interrupt whatever is playing and start from the start.
Image
Image
Post Reply