How can I have the order of 3 tracks be random every time throughout changing scenes?
jckmcgraw
Member Posts: 647
Hello,
I have 3 music tracks that I want to play throughout the course of somebody playing my game. There are many levels, which means many scene changes. The tracks are relatively long (1-5 minutes), which is why I want them in a random order every time. Is there a way I can do this?
Additionally, if I have a track looped, and I play a different track, will it stop the previous looping? Or is there a way I can stop it looping?
Thanks,
Jack McGraw
I have 3 music tracks that I want to play throughout the course of somebody playing my game. There are many levels, which means many scene changes. The tracks are relatively long (1-5 minutes), which is why I want them in a random order every time. Is there a way I can do this?
Additionally, if I have a track looped, and I play a different track, will it stop the previous looping? Or is there a way I can stop it looping?
Thanks,
Jack McGraw
Best Answers
-
SAZ_1 Posts: 397if its looping it will keep looping... basically make a integer rule (call it track or whatever) and then when a scene change is triggered tell do change attribute to (track+1)%3 (%3 will let it only select 3 numbers in this case either 0,1 or 2) .. at that point make 3 rules if track =1 play track1, if track=2 play track 2 .. so on.. now if you want it to change every time a scene change occurs to make things easier have these rules in one actor and place the actor in every scene that needs the music.... that should work fine i think. hope it helps!
-
BSideGames Posts: 392very tricky... you would need to have a set of rules that know which track is playing and how many seconds long that track is then after that x amount of seconds it would need pick from the random track attribute again. If you wanted to not repeat a track the rules would need to be a bit more complex but still doable.
I hope that helps
Answers
Jack McGraw