Page 1 of 1

Newbie Music Question!

Posted: Mon Nov 15, 2010 4:23 pm
by Captain Jonesy
Hi!

I'm currently attempting to script fading in and out of different music tracks during the progression of my game but failing to do so (Nearly finished it). I've been using looking at the dizzy game called "The other side" for reference how to code an such method which is only game I've seen/come across that does this, I'm wondering if anyone knows of any other alternative games that has multiple music tracks which fade in and out which I analyse the code or any suggestions how to code such action?

Also has anyone here scripted music to be triggered via func_CollideObject on the level itself? Does this work?

Thanks in advance :v2_dizzy_walkman:

Jonesy

Posted: Mon Nov 15, 2010 4:34 pm
by delta
Captain Jonesy wrote:Also has anyone here scripted music to be triggered via func_CollideObject on the level itself? Does this work?
yes, I've done it in a few games, and it does work. See DWD, TTD, RRD, and IID for examples.

Others tend to use the 'Open_Room' code instead, changing the music when you enter a room. This works just as well, and saves putting 'colliders' in the map, however I prefer the greater flexibility that colliders give you.

Posted: Mon Nov 15, 2010 7:59 pm
by Colin
I used the collider method in Volcano island dizzy

place 2 colliders on your map like this
Image

the code to switch would be like this
func CollideObject_8006_1() { MusicFade( 1,1 ); MusicPlay(MUSIC_PRINCE); }
func CollideObject_8007_1() { MusicFade( 1,1 ); MusicPlay(MUSIC_CAVES); }

I think I copied this code, from how Jamie did it in RRD :v2_dizzy_confused2:

Posted: Tue Nov 16, 2010 10:08 pm
by delta
Colin wrote: I think I copied this code, from how Jamie did it in RRD :v2_dizzy_confused2:
yup that's it almost exactly. One slight thing I'd change: move the colliders 2 'blocks' apart from each other, rather than one. This is because you can sometimes not collide with one of them if you double back on yourself, therefore not changing the music. If you widen the gap slightly, you don't get that problem. :)