|
Re: random code question
[Re: bluemax]
#222113
08/18/08 02:19
08/18/08 02:19
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
check the manual :P The var returned is fractional, and is always less than the upper limit. The random sequence starts always with the same numbers, unless 'randomized' at game start by random_seed(). see random() and random_seed() Hope this helps! 
|
|
|
Re: random code question
[Re: delinkx]
#222118
08/18/08 04:10
08/18/08 04:10
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
random_wlcm = integer(random(3)); works fine for me, even without any "random_seed(0);" though I would suggest having it at the start of main somehere (and after save-game loads too) or you could try this
switch(integer(random(3)))
{
case 0:
media_play("I_wlcm1.avi",NULL,100);
break;
case 1:
media_play("I_wlcm2.avi",NULL,100);
break;
default:
media_play("I_wlcm3.avi",NULL,100);
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|