help with randomizing

Non-platform specific questions.

help with randomizing

Postby DarkParadox » Sun Jun 03, 2007 12:33 pm

how do you make it so that a actor randomlys chooses an animation?
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Postby Fuzzy » Sun Jun 03, 2007 3:32 pm

animpos = rand(nframes);

fill in the number or range of frames that you want to select from, or use that variable.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby DarkParadox » Sun Jun 03, 2007 6:17 pm

no i want it so he changes to a different animation not speed
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Postby DilloDude » Mon Jun 04, 2007 2:43 am

Code: Select all
ChangeAnimation("Event Actor", getAnimName(round(rand(lnum + .99999) - .5)), FORWARD);

replace 'lnum' with the number of your last animation (ie if there are three anims, lnum should be 2. Rather than using lnum +.99999 you could do this yourself, ie 2.99999)
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest