Some help with attacking while walking

Get help using Construct 2

Post » Sun May 05, 2013 3:46 pm

I've been having a few problems with some movements I've been trying to do. Currently if you duck and attack once the animation is over the character stands up instead of remaining ducking. I'm also having some problems with getting him to attack while he is walking. I'm pretty sure it has to do with some conflicting instance variables but I can't figure out where I went wrong.

Here is my work file:
http://www.mediafire.com/?ovgi3r35ae5qnl5Jakten2013-05-07 12:35:00
B
5
Posts: 29
Reputation: 758

Post » Mon May 06, 2013 3:34 am

Can't grab the capx right now, but I would look at the logic you have for attacking, does it set any animation when it ends, or does it update a variable that triggers another animation like standing?
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Mon May 06, 2013 3:35 am

To fix conflicts with instance variable simply use some Inverted (NOT) statements basically. So if X is Alpha and NOT Bravo then do the event... stuff like that...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Mon May 06, 2013 2:07 pm

Thanks for the help BluePhase!

Here is a screen shot of what I have currently:


You can see my last attempt there using the walking variable when ctrl is pressed. Unfortunately it just plays the walk animation still though.

I also tried some other variations where if an arrow button is pressed play "walk attack" but if it is not pressed just play the regular attack and some other variations on that (i.e if this animation is playing when ctrl is pressed then play the "walk attack" animation)

I think it might have something to do with me using 'Ctrl Pressed' instead of "Ctrl Down" if I switch it it kind of works but causes some other problems as I only want the animation to run through once and it causes conflicts with the ducking animation.

Edit: I also managed to fix my ducking issue using what you suggested.Jakten2013-05-06 14:15:15
B
5
Posts: 29
Reputation: 758

Post » Tue May 07, 2013 12:32 pm

So I've mucked about with it and did some reading and have come to the conclusion that it must have something to do with the walking animation constantly refreshing due to the button being held down. I've seen some people say that you can get around that by attaching the character to an invisible block which I haven't done and seems like it may be a lot of work at this point.

Does anyone know if there is a way to do this without having to set up the character that way?

Here is my current .capx if anyone wants to check out what I've got so far.
http://www.mediafire.com/?0qpgj628l7apcpaJakten2013-05-07 12:33:59
B
5
Posts: 29
Reputation: 758

Post » Wed May 08, 2013 3:21 pm

Finally managed to get the attacking problem worked out as well using NOT statements, thanks again BluePhaze!
B
5
Posts: 29
Reputation: 758

Post » Wed May 08, 2013 4:13 pm

No problem! Glad it was of some use for you. Sorry I haven't been able to keep up on this thread, been a hectic week.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418


Return to How do I....?

Who is online

Users browsing this forum: currypuff, makotto, randomly and 26 guests