Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: EnterTheStory (aka tolworthy) on Sun 01/06/2008 20:14:53

Title: "Invalid DIRECTION parameter" (SOLVED)
Post by: EnterTheStory (aka tolworthy) on Sun 01/06/2008 20:14:53
In first serious attempt at using "optional" parameters I get this error message:

Error: Character.Animate: Invalid DIRECTION parameter


// the call
animate2(FANTINE,176,8,1);

// calling this
function animate2(int who,  int view,  int loop, int delay, int repeat, int block,int direction) // qqq
{ character[who].UnlockView();
character[who].ChangeView(view);
character[who].Animate(loop,delay,repeat,block,direction);
}

// module header:
import function animate2(int who, int view, int loop=0, int delay=2, int repeat=1, int block=1, int direction = 1 );

Is it because I'm defining integers then accepting enumerated types? What should I have done instead? Any guidance would be gratefully received!
Title: Re: "Invalid DIRECTION parameter"
Post by: Khris on Sun 01/06/2008 20:27:42
Try:
import function animate2(int who, int view, int loop=0, int delay=2, int repeat=eOnce, int block=eBlock, int direction = eForwards);

Alternatively, use the actual enums:
import function animate2(int who, int view, int loop=0, int delay=2, RepeatStyle repeat=eOnce, BlockingStyle block=eBlock, Direction direction = eForwards);
Title: Re: "Invalid DIRECTION parameter"
Post by: EnterTheStory (aka tolworthy) on Sun 01/06/2008 20:34:39
Thanks. I must have done something foolish earlier to make me think that wouldn't work. I'll do it right, now. :)