Page 1 of 1

Animation sequences?

PostPosted: Fri Jun 10, 2011 5:27 pm
by Guardian69
Hi guys,

I'm fairly new to GE and have come across something I want to do but cant find the information on how to do it.

I want to add a couple of animation sequences to an actor and switch to a different sequence in script on an event.

Ok, for example say I have one sequence that has 8 images representing the orientation of a top down ship, and I have another set of sequences for an idle animation.

How would I change the actor in script to use a different animation sequence? :?

Cheers,
Guardian

Re: Animation sequences?

PostPosted: Fri Jun 10, 2011 5:33 pm
by Hblade
I would like to help but I'm not the best in this type of stuff, if your trying to get the actor to be able to fly in the angle that you go (if you go right he turns right and whatnot) then you would most likely base the animpos off of the angle, but it's really confusing sometimes :'(

talk to DST i'm sure he wouldn't mind helping.

Also try asking skydereign

Re: Animation sequences?

PostPosted: Fri Jun 10, 2011 5:47 pm
by Guardian69
Nah, the direction stuff I have working fine.

I just want to know the script handle for how to switch to a different animation sequence.

i.e. You set up a sequence by going to actor control > Add sequence > and then specifying the frames that make up the sequence.

Re: Animation sequences?

PostPosted: Fri Jun 10, 2011 6:06 pm
by jimmynewguy
do you meant change the animation?

Code: Select all
ChangeAnimation("Actor", "name_of_animation", FORWARD);


FORWARD makes the animation start over playing forward
BACKWARD same thing just backwards
STOPPED stop on first frame of animation (technically 0 in GE)
NO_CHANGE keep the direction the animation is in, (ie. FORWARDS, BACKWARDS, STOPPED) but if the current animation is the one you're changing to it won't restart the animation

so if you have all your directions down then when the ship is moving you could do something like:

Code: Select all
if(directional_velocity >= 1)// if we're moving
{
switch(dir)
{
case 0:ChangeAnimation("Event Actor", "fly_right", NO_CHANGE);//angle is 0 pi
break
case 1:ChangeAnimation("Event Actor", "fly_up", NO_CHANGE);//angle is pi/2
break;
//ect
}
}


is this what you mean? If not feel free to elaborate for more help

Re: Animation sequences?

PostPosted: Sat Jun 11, 2011 3:22 pm
by Guardian69
Thank you, I think that is what I need, I will give it a go.

In the meantime I have got another question . If add a new animation with images called player000, player001 and player002, should the animpos be 0, 1, 2 respectively? I have made a few animations and the animpos seems to be different for each.

Cheers,
Guardian