Page 1 of 1

Change Animation using script editor...

PostPosted: Sun Feb 06, 2005 10:42 pm
by IPete2
Hi team,

I am now getting to grips with simple scripting. Wow the power underneath GE is really cool!

However, I have a little question. I am using the following code with a global variable called 'moveme' :

if (moveme==1)
{
y=y-4;
ChangeAnimation("ducky","Duck001","FORWARD");
}


'moveme' is set by a routine which checks if a key is held down.

The problem is that if the key is held down - no animation runs because it is always resetting, because the key is held.

Is there another way to achieve change animation in scripting please?

I could use a counter but that seems a bit lame in C. Any thoughts?

IPete2.

PostPosted: Sun Feb 06, 2005 10:58 pm
by jazz_e_bob
if ( animIndex != [put animIndex for Duck001 here] )
ChangeAnimation("ducky","Duck001","FORWARD");



Makslane - See thread:
http://www.game-editor.com/forum/viewtopic.php?t=285&highlight=animindex

If implemented you could use:
if ( animIndex != animIndex(Duck001) )
ChangeAnimation("ducky","Duck001","FORWARD");

PostPosted: Sun Feb 06, 2005 11:51 pm
by IPete2
Jazz,

You are a star!

I shall try that out right now!

Thanks dude!

IPete2.