Page 1 of 1

Key Up Animation

PostPosted: Sun Sep 13, 2009 8:49 am
by Romol
I need a script that: for example: performing an action replaces the character animation. that is, if you left animations charLeft.png after it should be Charleft2.png. I mean Key UP :roll:

Re: Key Up Animation

PostPosted: Sun Sep 13, 2009 10:12 am
by skydereign
Kind of vauge, if these explanations weren't what you wanted, can you be more specific? Maybe if you gave an example within a game, because I don't see a reason for what you are doing, since gameEditor already has multiple file image animations.

Assuming that is not what you are talking about, you can do it several ways, here is one. You can use animpos, so a single image, and upon the key up, you have this code.
Code: Select all
animpos++;

Note that the animation direction should be stopped.

A direct version, using your example, this code would be on the key up of UP.
Code: Select all
if(strcpy("charLeft", getAnimName(animindex))==0)
{
    ChangeAnimation("Event Actor", "Charleft2", STOPPED);
}

Re: Key Up Animation

PostPosted: Sun Sep 13, 2009 12:33 pm
by Romol
For more specific ... I need to change not just the animation and the animation is executed when moving object. Suppose we go in the region and now running the character animation is not CharRight and replaced by CharRight2. I tried the above help, something did not work.