Random animations

Non-platform specific questions.

Random animations

Postby ingsan » Sun Mar 14, 2004 8:49 pm

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 !
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Mon Mar 15, 2004 2:54 am

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

:)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Mon Mar 15, 2004 10:13 am

    You're Wonderful !
    WOnderfully Great !
    GrAtefully Yours
    Your Fan :D
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Mon Mar 15, 2004 10:35 am

Heh heh :oops:

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

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Mon Mar 15, 2004 10:44 am

:oops: thank you
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby ingsan » Mon Mar 15, 2004 11:46 am

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
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Mon Mar 15, 2004 12:35 pm

Looking forward to seeing what you are making. :wink:
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Mon Mar 15, 2004 1:21 pm

in a couple of weeks maybe ! 8)
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest