Dropping Problems

Get help using Construct 2

Post » Mon Jul 29, 2013 4:47 pm

Ben

This has me confused. I currently have the game set up where the player can pick up civilians (the man in the green shirt) by pressing the "S" button. If you press "S" again, you drop them. Seems pretty simple.

Everything is working great except for situations where the player is flying fast and on the "S" button being pressed, the civilian just plays their falling animation and continues to stick to the Player.

I've recently changed a little of the game by making it possible to also catch an NPC that is falling through the air by only flying into them and not needing to press S. To stop from automatically catching the civilian when ever the player is in the air and drops them, I have set up a FallCounter that is triggered every time the civilian falls. A civilian must be falling for at least 2 seconds before "automatically catch on collision" can be triggered again.

Not sure if that explains it properly. To see what I'm talking about (the pictre above), press S to pick up the man in the Green Shirt, then press the "F" key to fly. If you hold in the "A" button you'll fly faster. If you hit "S" while flying faster, the Civilian won't drop. He'll only play his falling animation.

Thanks for any help you can give.

Capx File

Ben
B
43
S
11
G
7
Posts: 232
Reputation: 7,220

Post » Mon Jul 29, 2013 6:24 pm

Wow o_o I suggest you get an animation manager for each object.

Instead of starting or stopping animations within other actions, create events that only pertain to the animations and make each animation happen in the order of importance. I'll show you an example from a game of mine.



This ensures that only one possible animation from this object can be playing at any given time, and you have all of the animations that will ever play for the object right in one spot. They will happen in importance from top to bottom, so if you have a falling animation, put that above the walking and idle animation.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Mon Jul 29, 2013 7:11 pm

I had a similar system to that earlier, but I think I was running into some weird frozen animations and such because of the carrying mechanic. I might try and streamline it in the future.
B
43
S
11
G
7
Posts: 232
Reputation: 7,220

Post » Mon Jul 29, 2013 9:07 pm

It's probably the disabled 'else' in event 71. Without the else then when you press 's' it drops the civilian and then immediately catches him again.
B
55
S
28
G
18
Posts: 1,520
Reputation: 25,305

Post » Tue Jul 30, 2013 11:54 am

Thanks, @ramones ! That was an easy fix. I'm not sure why I had it disabled in the first place. Still, it seems odd that the problem only happened when I was holding down A. Thanks again.
B
43
S
11
G
7
Posts: 232
Reputation: 7,220


Return to How do I....?

Who is online

Users browsing this forum: aldi45mts, AllanR, lukedevel, m0nkeybusiness and 1 guest