Thanks for your fast reply!
I switched the variables over to entity skills. The other mistake was just a typo of mine in making this post. Unfortunately, all the entities still move at the same time.
It's like the same random number is used for EVERY model that has the action attached, instead of coming up with a random number for each individual model.
I'll go ahead and post the exact code I'm using, so that someone can give me an idea of how I'm screwing this up haha. The action is for small bugs that crawl around the level randomly.
Code:
action bugs
{
while (1)
{
randomize();
my.skill21=int(random(300))+200; // Random number of frames to wait before moving
my.skill20=0; // Counter for current frame of sanding
ent_animate(me,NULL,0,0);
while (my.skill20<my.skill21) // Is current frame less than total number of standing still frames?
{
ent_animate(my,"stand", my.skill48,anm_cycle); // play the "stand" frames animation
my.skill48 += 1 * time; // "stand" animation speed
my.skill48 %= 100; // loop animation
my.skill20+=1; // increase counter by one
wait (1);
}
my.skill22=0; //Counter for current frame of walking
ent_animate(me,NULL,0,0); // reset animation
while (my.skill22<20) // Is current frame less than total number of movement frames?
{
ent_animate(my, "walk",my.skill46,anm_cycle); // play the "walk" frames animation
my.skill46 += 12 * time; // "walk" animation speed
my.skill46 %= 100; // loop the animation
randomize();
temp.z -= 10000;
temp.z = -c_trace (my.x, temp.x, ignore_me | ignore_passable);
temp.x = int(-(random(4)));
temp.y = 0;
c_move (my, temp.x, nullvector, ignore_passable | glide); // move bug randomly along floor
randomize();
my.skill24=int(random(5))+1; // set random value to my.skill24 to determine if the bug should rotate
randomize();
my.skill23=int(random(179))+1; // set random value to my.skill25 to determine degree of bug rotation
if (my.skill24==1) // if my.skill24 is 1, then the bug will rotate clockwise
{
randomize();
c_rotate (my, vector((int(random(50))+1),0,0),ignore_passable); // rotate
}
if (my.skill24==2) // if my.skill24 is 2, then the bug will rotate counter-clockwise
{
randomize();
c_rotate (my, vector((-int(random(50))+1),0,0),ignore_passable); // rotate
}
my.skill22+=1; // increase counter by one
wait (10*time);
}
}
}