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!
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);
Thanks. I must have done something foolish earlier to make me think that wouldn't work. I'll do it right, now. :)