Setting Music for Each Level
by Orion the Hunter · in Torque Game Builder · 12/11/2012 (2:46 pm) · 6 replies
Hello everyone,
I've been wondering how to set it so that music will play when the level is loaded. I've tried a giant trigger that covers the map but that screws up the collision layers and I can't hit walls or collect stuff. (It's a bug, which has been acknowledged... I think...) So, how do I tell it that if the scene graph is "level1" to play "UndergroundMusic"?
Thanks!
I've been wondering how to set it so that music will play when the level is loaded. I've tried a giant trigger that covers the map but that screws up the collision layers and I can't hit walls or collect stuff. (It's a bug, which has been acknowledged... I think...) So, how do I tell it that if the scene graph is "level1" to play "UndergroundMusic"?
Thanks!
#2
12/12/2012 (5:45 am)
I have the audio datablocks set up correctly, so do I add the fields to the scenegraph? (I'll give it a go.)
#3
12/12/2012 (5:53 am)
Huh... in console I get "Unable to play audio profile '' ".
#4
12/12/2012 (6:43 am)
You mean "Unable to locate audio profile"? Because that means you didn't exec() your script file with the audio profiles in it....
#5
12/12/2012 (11:32 am)
No, because if I write "playMusic(UndergroundMusic);" in the console I hear it play. The problem is that it isn't getting the info the right way... I deselected everything and then I added dynamic fields to the scenegraph, I think.
#6
12/12/2012 (2:20 pm)
Ah, I fixed it. Forgot to get scene graph. D'oh!
Torque Owner Richard Ranft
Roostertail Games
Of course, this assumes you have your level loaded and that you have audio description and audio profile datablocks prepared already. For information on how to do that, check the Torque 2D docs under Inteface Tutorials->Feature->Audio Tutorial.