I haven't tried it yet but was wondering if you can do them like you would do a random message or numbers?
So everytime they went into a room something else would play.
I've seen a couple other solved posts on this in the past couple days. I'm busy right now, or I'd find them for you, but it shouldn't be too hard.
My point for taking this post, though, was to ask why. If there's a good and logical reason, that's cool, but be careful that it doesn't sound disjointed to the player. Aesthetic value is one of the factors that keeps people playing.
Well I was thinking for this main room the two chars will be in and and a lot of coming and going so maybe have diff tunes play.
EDIT:
This worked.
int blah = Random(3);
if (blah==0)PlayMusic(1);
else if (blah==1) PlayMusic(2);
else if (blah==2) PlayMusic(3);
else if (blah==3) PlayMusic(4);
Actually, I seem to be full of crap. I just went looking for you and couldn't find anything, althoughI thought Mats Berglinn had a post about random music a week or so ago. I know how to do it, but I'm really busy right now or I'd prolly whp you up some code, but I'm sure someone wil come along any second now. It is pretty easy, if I remember correctly, so don't worry.
If, as in the example above, all the music files are grouped together, you could probably use:
int blah = Random(3) + 1; // Replace 1 with the lowest number you want to play (e.g. '+ 10' to play 10, 11, 12 or 13).
PlayMusic(blah);
No real difference, just saves you writing out a long list of else if's.
Thanks Ashen.
Using the Ultimate Randoms module, the files don't have to be in order, and you could run something like:
PlayMusic(RandomOfX(4, 3, 7, 11, 1));
Would play MUSIC3, MUSIC7, MUSIC11, or MUSIC1
Thanks for pointing that out.