Trigger Fall Anim w/out using Platform Behavior

Get help using Construct 2

Post » Sun Jul 07, 2013 4:13 pm

I am extremely stumped. Hopefully I can explain this in a way that is remotely understandable.

I'm working on a Superhero game where you carry civilians to safety. A long time ago, I was having trouble figuring out how to attach the civilian to the player to make it look like they're being carried. @Animmaniac was kind enough to help me out and showed me how to do it with UID's. It has worked great ever since.

The problem I'm having is that when you release the civilian (which contains the Platform Behavior), they fall while playing the walk animation. There is no point where I can "trigger" the fall animation and if I set it to play "while falling" they whole thing goes crazy.

I'm not quite sure how to get that falling animation to play.

Line 64 is where the carrying of objects/NPC's is located. You can see my attempts to trigger the animations below with the "Civ" family.

Any help is greatly appreciated.

Arrow Keys to move.
"F" key toggles flying
"S" picks up and releases civilians
"A" key while flying speeds you up

Capx: Superhero Game: Falling Problems
B
43
S
11
G
8
Posts: 232
Reputation: 7,730

Post » Sun Jul 07, 2013 5:22 pm

Well 'on fall' does trigger when you drop him:


you just need to make sure the moving animation doesn't override the falling one:
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Sun Jul 07, 2013 6:58 pm

Thanks @ramones. That helped, but it will still occasionally fail to trigger the falling animation. Right now I have an animation called "Left" that is used whenever the player is holding something. Its basically a drawing of the Player character's head and arms holding whatever object was picked up. Sometimes when I hit "S", that piece of art will just fall instead of switching to the fall animation. Any help is appreciated.
B
43
S
11
G
8
Posts: 232
Reputation: 7,730

Post » Mon Jul 08, 2013 1:13 am

Yeah I see if you drop him and catch and then drop him again, 'on fall' doesn't trigger.

I moved the 'set animation' to below the 'on s key pressed' but that didn't work for some reason. I think because the events below (that set the platform behavour enabled/disabled) were running every tick.

So I rearranged the events in the 'Carry objects' group. I moved the actions that only need to run once when you pickup or drop a civilian under the keypress event. The only action that needs to be running every tick is the 'set position'. It seems to be working better now - what do you think?

*edit* forgot the capx **
civilian_falling.capx (r137)ramones2013-07-08 01:51:06
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Mon Jul 08, 2013 12:34 pm

@ramones That is working perfectly! I really need to study it to understand what you did, but its fixed all of the problems. Thanks for taking the time to figure this out.
B
43
S
11
G
8
Posts: 232
Reputation: 7,730


Return to How do I....?

Who is online

Users browsing this forum: RobertMKD and 7 guests