Platform Attack While Crouching

For questions about using Classic.

Post » Thu Jun 16, 2011 10:10 pm

I'm making a Zelda II style game, but can't get Link to attack while crouching. I have an animation called "attacking" for attacking while standing up, and another called "crouchAttack" for attacking while crouching. Link has a private variable called "crouching" where 0=standing and 1=crouching, it turns to 1 when Z is held down.
[url=https://docs.google.com/leaf?id=0B9d5pqOItfvfOGVlOGU2ZjgtZjU2Mi00OGNiLTg5MjktOGJmYWMxMDllMjk2&hl=en_US:1usmcmx4]Download[/url:1usmcmx4]
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Thu Jun 16, 2011 11:10 pm

Can't take a look at it because it looks like the download is private.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Fri Jun 17, 2011 6:24 am

Sorry about that, this link should work.
https://docs.google.com/leaf?id=0B9d5pq ... 2&hl=en_US
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Fri Jun 17, 2011 12:26 pm

Hmm.
Well, looking at your code, I can see no reason why it doesn't work.

For example, place a text object on the layout and use "Always" to display both the crouchingVar and the current animation name of Link, and you'll see that the states are all as you'd expect when pressing the buttons, except for the crouchAttack animation, which doesn't show up at all.

I think that it might be a quirk with Construct.
To prove this, change the

+ link: Value 'crouchingVar' Equal to 1
-> link: Set animation to "crouchAttack"

to

+ link: Value 'crouchingVar' Equal to 1
-> link: Set animation to "attacking"

so that it's the same as when 'crouchingVar' equals 0, just to prove that the conditions work.
It seems that the "crouchAttack" animation just won't play.

Try deleting that animation, and then set it up again.

Construct can be like this sometimes.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Fri Jun 17, 2011 11:12 pm

I deleted the animation and made it again but it didn't seem to do anything :/
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Sat Jun 18, 2011 1:09 am

[quote="AfterShock":6761ayzr]I deleted the animation and made it again but it didn't seem to do anything :/[/quote:6761ayzr]

Hi, i tried your cap, and the problem could be because you have 2 animations tied to the 'z' button.
Why dont you just have the 'crouchattack' animation play everytime he crouches?

[color=#BF0000:6761ayzr]Amended[/color:6761ayzr]

I actually meant the 'down arrow key'. The crouchattack animation does work for a split second, but having the down arrow key at the same time seems to over-ride it.
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Sat Jun 18, 2011 7:57 am

The reason it doesn't work is (edit: partly) because how you've ordered your events. I moved the event handling your animations above the one initiating the attack animations and the crouch attack starts. It's immediately changed back to the crouching animation though. I haven't looked through the animation event that much but it's pretty clear that it cancels out your crouch atttack animation.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Sat Jun 18, 2011 11:02 pm

[quote="chrisbrobs":13usz11n][quote="AfterShock":13usz11n]I deleted the animation and made it again but it didn't seem to do anything :/[/quote:13usz11n]

Hi, i tried your cap, and the problem could be because you have 2 animations tied to the 'z' button.
Why dont you just have the 'crouchattack' animation play everytime he crouches?

[color=#BF0000:13usz11n]Amended[/color:13usz11n]

I actually meant the 'down arrow key'. The crouchattack animation does work for a split second, but having the down arrow key at the same time seems to over-ride it.[/quote:13usz11n]
I see what the problem is but I wanted link to be able to crouch to block things that are low, and be able to attack things that are low. The code should work considering I said the "crouching" animation should only play if the animation isn't currently "crouch attack". I think it's some kind of bug with construct.
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Sat Jun 18, 2011 11:54 pm

Have you read the Platform School tutorial By deadeye ?

It has a good section on animation event sorting.

[url:2yvyne8c]http://www.scirra.com/forum/viewtopic.php?f=8&t=2154[/url:2yvyne8c]
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Mon Jun 20, 2011 3:24 am

[quote="chrisbrobs":1tvb50zk]Have you read the Platform School tutorial By deadeye ?

It has a good section on animation event sorting.

[url:1tvb50zk]http://www.scirra.com/forum/viewtopic.php?f=8&t=2154[/url:1tvb50zk][/quote:1tvb50zk]
Yes I have, unfortunately I don't think it would help out to reread it in this case.
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests