How do I create animations "attack" and "crouchattack"

Get help using Construct 2

Post » Tue Jan 12, 2016 3:41 am

I asked this before and received an answer, but I tried and couldn't get it to work on my end.
What I am trying to accomplish is using the same button to attack for both the "Attack" animation and the "CrouchAttack" animation.
1) "Attack" should be the animation to access when pressing the attack button while standing and jumping.
2) "CrouchAttack" should be the animation played when pressing the attack button while in the "Crouch" animation.

The controls are:
WASD to move
"," to attack

Here is the CAPX.
https://www.dropbox.com/s/ct6o250kfjo5r ... ckup1?dl=0

Thanks for any help that you can offer me even if it doesn't solve the issue it may lead me on the path to solving it myself.
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Tue Jan 12, 2016 9:12 pm

What determines which animation it uses?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,365
Reputation: 4,724

Post » Wed Jan 13, 2016 2:22 am

gumshoe2029 wrote:What determines which animation it uses?


Well, if you are hold down the "S" key to crouch then you'll be in the "Crouch" animation. While being in the "Crouch" animation anytime you press the attack key you should "CrouchAttack" rather than "Attack".
Is that what you are asking me?
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Wed Jan 13, 2016 3:04 am

Why dont you add a condition in attack, that plays the crouchattack animation only if the crouch is true, that should do it, instead of calling the regular attack animation. Right click on the event that calls for attack, and add the condition to check that the sprite is in the crouch animation, or whatever u have it named
B
32
S
14
G
4
Posts: 172
Reputation: 4,008

Post » Wed Jan 13, 2016 5:07 am

arcab072081 wrote:Why dont you add a condition in attack, that plays the crouchattack animation only if the crouch is true, that should do it, instead of calling the regular attack animation. Right click on the event that calls for attack, and add the condition to check that the sprite is in the crouch animation, or whatever u have it named


I'm looking for that condition and cannot find it. Can you be a little more specific with the directions?
Sorry, kinda of a noob.
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Wed Jan 13, 2016 5:58 pm

its easy, lets say you have it like this:
EVENT // ACTION
on click / [,] // character/ start attack animation


what you need to do is create another event, similar to the regular shooting, or standing shooting, but this time, add an extra condition, like this:

EVENT // ACTION
on click / [,] // character/ start crouchAttack animation
character / is animation"crouch" playing
you add it by right clicking in the event section, and select add another condition, on the same( click[,]) event
B
32
S
14
G
4
Posts: 172
Reputation: 4,008

Post » Wed Jan 13, 2016 9:57 pm

I'm having a hard time understanding.
I tried multiple times last night, but couldn't quite get a what I wanted.
Is there anyway you could show me though the CAPX?
https://www.dropbox.com/s/ct6o250kfjo5r ... ckup1?dl=0

I don't mean to be a complete fool and having someone hold my hand through this entire thing, but I really just don't get this part.
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Thu Jan 14, 2016 3:04 am

I would love to help brother, just give me a bit, and I'll help you as much as i can
B
32
S
14
G
4
Posts: 172
Reputation: 4,008

Post » Thu Jan 14, 2016 3:12 am

You could put an instance variable on the sprite playing the animation called CrouchDetection

And set it so every tick you are crouching set CrouchDetection to 1

Then add and Else event and the action to set it to 0 so when your not crouching it will be 0

And finally add a condition to your event that allows you to attack, and make it so the normal attack animation only plays when CrouchDetection equals 0, or make it so that the crouch attack animation only plays when CrouchDetection equals 1.
B
28
S
11
G
4
Posts: 77
Reputation: 4,321

Post » Fri Jan 15, 2016 4:18 am

I put a bad CAPX earlier.
Here is an update:
https://www.dropbox.com/s/yq0wkhl3hvq3m ... .capx?dl=0
B
24
S
7
G
3
Posts: 122
Reputation: 3,047


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, kiugetski, RealMagisterLudi and 9 guests