Page 1 of 1

Punching,kicking,....left

PostPosted: Sat Nov 10, 2007 1:41 pm
by Azou
Helloo...I've got a problem:how to punch,kick or something like that in left?? i tried,but this is too hard! :twisted: :x

Re: Punching,kicking,....left

PostPosted: Sat Nov 10, 2007 6:08 pm
by Rux
Make a var called dir. On key down for the punch AND kick(2 separate scripts)
Code: Select all
if(dir == 0)
{
    ChangeAnimation(*"Punch Left"*);
}
else if(dir == 1)
{
   ChangeAnimation(*"Punch Right"*);
}

On key down for left,
Code: Select all
dir = 1;

On key down for right,
Code: Select all
dir = 0;


Create Actor Event on player,
Code: Select all
dir = 0;

Also if you don't want the animations to repete do an animation finish event for both, Animation Finish (Punch Left): Change Animation "Stand Left"ect...

Hope this helps. Note in script editor use the events and actions menu for create actor, cause thats not how to do Create Actor in Script Editor.

Re: Punching,kicking,....left

PostPosted: Sat Nov 10, 2007 6:45 pm
by Azou
okay i 'll test as soon as i'll have free time! :D

Re: Punching,kicking,....left

PostPosted: Sat Dec 01, 2007 12:08 pm
by Azou
Please,Rux (or somebody else)i know that you're very busy, :oops: but ...i tried,and that's not work.Here is a demo.Can you make it for me,please?? :?

Re: Punching,kicking,....left

PostPosted: Sat Dec 01, 2007 2:52 pm
by Spidy
i think bee-ant or mike will help ya.maybe sgt.sparky

Re: Punching,kicking,....left

PostPosted: Sat Dec 01, 2007 4:31 pm
by Azou
Okay! :P

Re: Punching,kicking,....left

PostPosted: Sat Dec 01, 2007 5:35 pm
by Rux
I fixed my script. In the first script I forgot to put else on the second half of the script.

Anyway here is the working version of your demo. :D

Re: Punching,kicking,....left

PostPosted: Sat Dec 01, 2007 6:08 pm
by Azou
Thanx man!! I gave you a point!! :D

Re: Punching,kicking,....left

PostPosted: Sun Dec 02, 2007 3:31 am
by Bannock
I apolagize for continuing a thread that has served it's purpose, but I felt it would be appropriate to place this question here, rather than start a new topic.

Based off of the first bit of script given in this thread, not the modified one, I made my own version of this and got it working. However, what I'd like to know, is an easy method of of preventing the player from hitting the attack key multiple times in a row.
The attack animation has Repeat disabled so you can't hold the attack button down, but you can still hit it again while it's in the middle of the attacking animation, which if nothing else, can allow a sort of rapid fire attack.
I can only guess that it would involve timers, but I don't have much experiance (see: none) with that sort of thing.