Page 1 of 1

Random animations

PostPosted: Sun Mar 14, 2004 8:49 pm
by ingsan
i have 6 animations in one actor. I want to play them randomly ie 1 5 3 4 6.... or 6 4 2 3 6 1 5 2 6 4 3 4 and so on.

Should i work with ChangeAnimation or animindex(well i don't know how to use that option yet :oops: ) or any other thing?

Thank You !

PostPosted: Mon Mar 15, 2004 2:54 am
by jazz_e_bob
At the Animation Finish Event try something like:

int animToRun = round(rand(6));

switch(animToRun)

case 1;
Change to anim 1
case 2;
Change to anim 2
case 3;
Change to anim 3

etc
etc

:)

PostPosted: Mon Mar 15, 2004 10:13 am
by ingsan
    You're Wonderful !
    WOnderfully Great !
    GrAtefully Yours
    Your Fan :D

PostPosted: Mon Mar 15, 2004 10:35 am
by jazz_e_bob
Heh heh :oops:

I checked out Random Heros on your web site. Brilliant stuff.

Image

PostPosted: Mon Mar 15, 2004 10:44 am
by ingsan
:oops: thank you

PostPosted: Mon Mar 15, 2004 11:46 am
by ingsan
I followed ur advice ! and it works perfect.
What i wrote is the following :

Code: Select all
int animToRun=round(rand(4));
switch (animToRun)
{
 case 1:
        CreateTimer("Event Actor", "M1", 4000);
        break;
 
 case 2:
        CreateTimer("Event Actor", "M2", 3000);
        break;
 case 3:
        CreateTimer("Event Actor", "M3", 4000);
        break;
 case 4:
        CreateTimer("Event Actor", "M4", 3000);
        break;
}


and at each Timer, ChangeAnimation

Wow, u don't know how much u helped me :o

switch is a very helpful thing ! i've been working with that when i started GE but as i lack programming experience and knowledge ... i really didn't think about that :oops:
Oooohhh THank u Thank u Thank u :P

PostPosted: Mon Mar 15, 2004 12:35 pm
by jazz_e_bob
Looking forward to seeing what you are making. :wink:

PostPosted: Mon Mar 15, 2004 1:21 pm
by ingsan
in a couple of weeks maybe ! 8)