Page 1 of 2
Posted: Sat Feb 01, 2014 10:24 pm
by French_Touch
How do you include music in game? Do we need loops? I'm thinking about creating some good music or maybe sound effect while I play. Did somebody do something?
I played around with my DAW and came up with this. I know it's basic, it's just a start, but if some people are interested in a part of it, I can send it to you.
Posted: Sun Feb 02, 2014 1:48 am
by Psychosis
no in-game music, queue up your own playlist in the background.
It's better without. we would also run afoul of licensing for anything not under GPL
Posted: Sun Feb 02, 2014 2:21 am
by aem
I like adding music to the game because you can set different music to play depending on what is going in in game. Simply need to edit musicdef.mdl in the Production/Artwork folder. I haven't done this in years, so I am under the assumption nothing has changed to break this functionality.
I will try this out now and make sure it still works and post a guide since I am not sure there still is one anywhere.
Posted: Sun Feb 02, 2014 4:58 pm
by French_Touch
That would be great!
I don't really know how it works. I tried to edit the file, but I've no idea how to do it.
QUOTE use "gamepanes";
gameScreenMusicSound = RedbookSound(mymusic.wav);
flightMusic1ASound = RedbookSound(AllegianceCD, 3);
flightMusic1BSound = RedbookSound(AllegianceCD, 4);
flightMusic1CSound = RedbookSound(AllegianceCD, 5);
deathMusicSound = RedbookSound(AllegianceCD, 6);
flightMusic2ASound = RedbookSound(AllegianceCD, 7);
flightMusic2BSound = RedbookSound(AllegianceCD, 8);
flightMusic2CSound = RedbookSound(AllegianceCD, 9);
flightMusic3ASound = RedbookSound(AllegianceCD,10);
flightMusic3BSound = RedbookSound(AllegianceCD,11);
flightMusic3CSound = RedbookSound(AllegianceCD,12);
gameOverLostMusicSound = RedbookSound(AllegianceCD,13);
gameOverWonMusicSound = RedbookSound(AllegianceCD,14);[/quote]
I changed the first line, I guess it is more complicated than that...
Posted: Sun Feb 02, 2014 5:27 pm
by aem
Its rather simple but that is not how to do it. I ran out of time to put the full guide together, but here is a rough one which should be enough for now.
If you simply want to swap out each music track you would do something like:
gameScreenMusicSound = GainSound(SFXGain, ImportWave("music02"));
The RedbookSound is to pull if off the original game disc. Need to use the GainSound with ImportWave like the above example. Have the wav file in the Production/Artwork folder. I think only wav is supported for music so convert everything to wav format if needed. Don't include the .wav at the end of the file name.
You can also expand the track selection by using RandomSound which will randomly pick a song from a list.
gameScreenMusicSound = GainSound(MusicGain,IntermittentSound(5, false,
RandomSound([
(ImportWave("music_allegiance_madness"),1),
(ImportWave("music_allegiance_theme"),1),
(ImportWave("music_allegiance_tribute"),1),
])
));
Finally, you can play two sounds together if you wanted such as a voice chat to let you know when the situation changes.
ASound is "Clear: No enemy spotted and/or you have not been spotted."
BSound is "Contact: Enemy spotted and/or you have been spotted."
CSound is "Combat: Enemy fires on you and/or you fire on the enemy."
Rest you can figure out based on the name such as deathMusic that plays when you die.
To have a voice chat or whatever sound play along with the music use PairedSound like..
flightMusic1ASound = PairedSound(
GainSound(MusicGain,
RandomSound([
(ImportWave("music_bios_ballad_rev1"),1),
(ImportWave("music_bios_ballad_rev2"),1)
])
),
SerializedSound(MutexSal, 5, 10, true, GainSound(VoiceOverGain, ImportWave("music_vo_sal_sensorscleared")))
);
You can get the full example files along with music tracks at
http://www.mesialonline.com/Allegiance/sound/iGmusic.html.
Posted: Sun Feb 02, 2014 6:14 pm
by French_Touch
Great. For now, I just would like to have some in-game music while I play. I can't make it work yet, but I'll eventually find how to do it.
gameScreenMusicSound = GainSound(SFXGain, ImportWave("music02"));
It didn't work (Music is on).
I put music02.wav in Allegiance/lobbies/production/artwork (there is another directory in lobbies, it's beta/artwork)
Posted: Sun Feb 02, 2014 6:19 pm
by aem
If you are playing in Beta like others are today you would need both musicdef.mdl and the music files in Beta/Artwork.
Posted: Sun Feb 02, 2014 6:26 pm
by French_Touch
So I made a copy of the mdl file of your music pack in Artwork directories, both of them. And I just created 11 copies of a simple wav file named music02-music11. I can't hear anything, but in-game, I don't have sound effects any more. It seems that something is going on, but not exactly what I expected!
QUOTE use "gamepanes";
gameScreenMusicSound = GainSound(SFXGain, ImportWave("music02"));
flightMusic1ASound = GainSound(SFXGain, ImportWave("music03"));
flightMusic1BSound = GainSound(SFXGain, ImportWave("music04"));
flightMusic1CSound = GainSound(SFXGain, ImportWave("music05"));
deathMusicSound = GainSound(SFXGain, ImportWave("music06"));
flightMusic2ASound = GainSound(SFXGain, ImportWave("music07"));
flightMusic2BSound = GainSound(SFXGain, ImportWave("music08"));
flightMusic2CSound = GainSound(SFXGain, ImportWave("music09"));
flightMusic3ASound = GainSound(SFXGain, ImportWave("music10"));
flightMusic3BSound = GainSound(SFXGain, ImportWave("music11"));
flightMusic3CSound = GainSound(SFXGain, ImportWave("music12"));
gameOverLostMusicSound = GainSound(SFXGain, ImportWave("music13"));
gameOverWonMusicSound = GainSound(SFXGain, ImportWave("music14"));[/quote]
Posted: Mon Feb 03, 2014 5:13 am
by Imago
nope, nothing has changed to break it. just make sure your allegiance CD is in the drive.
Posted: Mon Feb 03, 2014 5:15 am
by Imago
i recall having an ISO of (only) the music that i could "mount" .... the name of the disc had to be "AllegianceCD" IIRC