In 1213, he shoots with Tab, but he shoots both ways.
When I script my character to attack with Tab he only attacks 1 way.
Can someone please help me?
What code have you got so far? Since it sounds like you've got it part way working, it'd be easier for us to help if we culd see that, rather than have you start over again.
on_key_press:
if (keycode==9) {
character[EGO].LockView(2);
character[EGO].Animate(1);
character[EGO].UnlockView();
}
Wait, what was the problem again? That the 'attack' always faces the same direction, whichever way the character is facing? Sorry, misunderstood originally.
The problem is this line:
character[EGO].Animate(1);
Which will always run the same animation (the left-facing loop). Since I don't think LockView affects the loop, replacing that code with:
if (keycode==9) {
cEgo.LockView(2);
cEgo.Animate(cEgo.Loop, 3);
cEgo.UnlockView();
}
Should do it. Note that you were also missing the required 'delay' parameter for Character.Animate - I've used 3, but play around with that until it looks right for you - and that you should realy make it blocking, so the view doesn't release before the animation completes. Read the manual (http://www.adventuregamestudio.co.uk/manual/Character.Animate.htm) entry, for more details on the parameters.
Thanks very much.
I will try it when I get home :)