"Invalid DIRECTION parameter" (SOLVED)

Started by EnterTheStory (aka tolworthy), Sun 01/06/2008 20:14:53

Previous topic - Next topic

EnterTheStory (aka tolworthy)

In first serious attempt at using "optional" parameters I get this error message:

Error: Character.Animate: Invalid DIRECTION parameter

Code: ags

// 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!

Khris

#1
Try:
Code: ags
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:
Code: ags
import function animate2(int who, int view, int loop=0, int delay=2, RepeatStyle repeat=eOnce, BlockingStyle block=eBlock, Direction direction = eForwards);

EnterTheStory (aka tolworthy)

Thanks. I must have done something foolish earlier to make me think that wouldn't work. I'll do it right, now. :)

SMF spam blocked by CleanTalk