Page 1 of 1

animation finish help

PostPosted: Mon Sep 17, 2007 3:37 am
by DollMaster
For my full code, see this thread http://game-editor.com/forum/viewtopic.php?f=2&t=4392

In each key down event, depending on what direction he is faceing/move state, I have the variable DIR assigned a value.

Code: Select all
if (key[KEY_UP]==0&&key[KEY_LEFT]==0&&key[KEY_RIGHT]==0)
{ChangeAnimation("Event Actor", "run_down", FORWARD);
dir=1;}


The DIR variable is assigned on my key up event too.

Code: Select all
if (key[KEY_UP]==0&&key[KEY_LEFT]==0&&key[KEY_RIGHT]==0)
{ChangeAnimation("Event Actor", "stop_down", FORWARD);
dir=1;}


The DIR variable also determines what animation occurs when the players attacks.
Code: Select all
if(dir==1||dir==5)
{ChangeAnimation("Event Actor", "heroa", FORWARD);}
else if(dir==3||dir==7)
{ChangeAnimation("Event Actor", "heroau", FORWARD);}
else if(dir==2||dir==6)
{ChangeAnimation("Event Actor", "heroal", FORWARD);}
else if(dir==4||dir==8)
{ChangeAnimation("Event Actor", "heroar", FORWARD);}


Code still works like I want except player continuesly does his attack animation.

When these attack animations finish, I want to go back to whatever movement/stand still animation he is supposed to go to depending on the variable DIR.

So I entered this code as an animation finish event, for player attack down animation.
Code: Select all
if(dir==1)
{ChangeAnimation("Event Actor", "stop_down", FORWARD);}
if(dir==3)
{ChangeAnimation("Event Actor", "stop_up", FORWARD);}
else if(dir==2)
{ChangeAnimation("Event Actor", "stop_left", FORWARD);}
else if(dir==4)
{ChangeAnimation("Event Actor", "stop_right", FORWARD);}


else if(dir==5)
{ChangeAnimation("Event Actor", "run_down", FORWARD);}
else if(dir==7)
{ChangeAnimation("Event Actor", "run_up", FORWARD);}
else if(dir==6)
{ChangeAnimation("Event Actor", "run_left", FORWARD);}
else if(dir==8)
{ChangeAnimation("Event Actor", "run_right", FORWARD);}


But he no longer does his attack animation and just stands there. What am I doing wrong? Isn't animation finish supposed to cause something to happen when the animation cycles through all of its frames?

Re: animation finish help

PostPosted: Mon Sep 17, 2007 3:58 am
by DollMaster
Ok another question, how many frames must be in an animation in order for the animation finish to work? I have only two frames, in mine and it does NOT work. However, when I increased the # of frames I think it works...

Re: animation finish help

PostPosted: Mon Sep 17, 2007 12:41 pm
by makslane
Waht's your Game Editor version? I have tested here and works with 2 frames.

Re: animation finish help

PostPosted: Mon Sep 17, 2007 10:18 pm
by DollMaster
I have 1.3.4 full version. However, I tested the two frames in on the latest current demo version and it did NOT work.

So my animation's frames looks like this in order for animation finish to work:

filler frame(standing), swing 1, swing 2, filler frame(standing)
4 frames, frame rate=7

This way it works perfectly, however, i worry if there will be a problem if i upgrade to a better version.

Re: animation finish help

PostPosted: Mon Sep 17, 2007 10:52 pm
by makslane
Please, post or send me the game.

Re: animation finish help

PostPosted: Tue Sep 18, 2007 4:39 am
by DollMaster
i sent two zips to support@game-editor.com. one has my working version and one has the recreated animation issue version.

Re: animation finish help

PostPosted: Wed Sep 19, 2007 3:56 am
by DollMaster
Any luck Makslane? I kind of prefer to use two frame animations as it'll make it easier on me when I make my weapon actors.

Re: animation finish help

PostPosted: Wed Sep 19, 2007 12:18 pm
by makslane
Look your email