Fallthrough woes [double jump fixed]

Get help using Construct 2

Post » Tue Jul 17, 2012 9:32 pm

Here's a capx with the problems I'm going to ask about in this post.
https://dl.dropbox.com/u/22615804/pendulum_doublejump_fallthrough.capx

Ok, so I've been trying to make a jump sustain and double jump in C2 for a little while now. I completely ditched the "simulate jump" feature of the platform behaviour, working only with the Vector.Y component. I actually managed to get a jump sustain that worked kinda like I wanted (before I started messing with it to limit the jumping that is).

After that I went on to implementing double jump. Since the way I made the custom jump allowed for infinite mid air jumps I figured I'd just limit it.

Now I have run into some issues and I don't know how to fix, or work around, them.

First, the double jump is inconsistent.

It seems that double jumping is finnicky at best.
If I tap lightly/quickly, I can jump in midair two times from standing.
If I hold the jump button for too long (have not figured out the specifics on this)I can't do a midair jump at all.

I've commented the parts of my event sheet that controls these things. The event sheet is "Control".

Also, seemingly as a result from using this way to create jumps, I can't use the fall through function at all. Not sure how to work around this yet. If you have any ideas I'd appreciate it.

Thanks.inkBot2012-07-18 12:07:44
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Tue Jul 17, 2012 10:14 pm

Set a Ver to player lets Say "jump"

Wen platform jumps "W is pressed" add 1 to variable

if Variable is Equal to 2 or less allow platform to jump

wen platform lands set Var back to 0


So the player will not accomplish jump past 2 additions of.
hope this helps. Erndog2k2012-07-17 22:16:36
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Tue Jul 17, 2012 10:42 pm

You clearly didn't check the capx. I'm already doing this (although counting down instead of up), and it doesn't work properly for some reason.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Wed Jul 18, 2012 4:44 am

[QUOTE=inkBot] You clearly didn't check the capx. I'm already doing this (although counting down instead of up), and it doesn't work properly for some reason.[/QUOTE]

I don't have to check I know it works lol


x2jump2 by N7Effect, on Flickr

This is actually a quadruple jump since the group doesn't start till first jump.
Make sure on landed or isn't jumping or whatever means make Doublejump Variable zero again to repeat. Erndog2k2012-07-18 05:09:13
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Wed Jul 18, 2012 5:42 am

Instead of adding to a variable, try subtracting from it.

Let's say you have a var "jumps_allowed" and set it to a initial value of 1.

Then;

If keyboard W was pressed
and player.platform movement "is jumping"
and player.jumps_allowed > 0


Then

Subtract 1 from player.jumps_allowed
Do the double jump

----

I think this way is better so you can have as many jumps as you want, since you can just add the max value whenever you want.

Also don't forget to reset the variable to it's initial value when player is on the ground.andreyin2012-07-18 05:43:59
B
106
S
35
G
37
Posts: 798
Reputation: 25,215

Post » Wed Jul 18, 2012 12:05 pm

[QUOTE=Erndog2k]I don't have to check I know it works lol[/QUOTE]
Oh for the love of peanuts...

I told you I was already doing it and something wasn't working. The entire reason I posted the capx was so people could spot where the problem was. Luckily for you I spotted the problem just now and have fixed it.

Now, moving on to the other problem. Fall through. Doing the jumps this way seems to block me from using fall through. I have this:

+Player.Platform is on floor
+Keyboard.Down arrow is down
+Keyboard.On X pressed
-Player.Fall Platform down through jump-thru

This worked when I was using "simulate jump", but not now.
I'm figuring it's because I'm forcing the VectorY up and down instead of letting the behavior handle it completely.inkBot2012-07-18 12:51:15
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Wed Jul 18, 2012 12:41 pm

@Erndog2k
The reason you look at capx's is because not everyone's events are set up the same way, so they need some suggestions that will work with their particular setup.

@inkBot
Of course, ironically, I don't have time to check the capx right now (on my way into work), but quick question: on your jump events, do you have a condition that says "+Keyboard.Down arrow is NOT down" ?

Sometimes, depending upon the way your events are setup, others can be overridden if they've got common conditions. Sometimes the best way to isolate them is to do inverted conditions.

Like I said, I can't check it now, but if you don't solve it later I'll give your capx a look when I get back.
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Wed Jul 18, 2012 12:54 pm

[QUOTE=TL22]... quick question: on your jump events, do you have a condition that says "+Keyboard.Down arrow is NOT down" ?[/QUOTE]

Nope. Here's an updated capx:
https://dl.dropbox.com/u/22615804/pendulum_fallthrough.capx
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Wed Jul 18, 2012 1:18 pm

Event 71 is setting the player's y vector to a small value all the time when you're not jumping. So the player is constantly falling and never actually on the ground.

And if you're using x for both falling through and jumping you'd want to set it up so you don't jump while down arrow is down.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Wed Jul 18, 2012 4:30 pm

[QUOTE=ramones] Event 71 is setting the player's y vector to a small value all the time when you're not jumping. So the player is constantly falling and never actually on the ground.[/QUOTE]
I've checked that and as far as the platform behaviour is concerned, when the character is grounded it "is on floor"

[quote]
And if you're using x for both falling through and jumping you'd want to set it up so you don't jump while down arrow is down.[/QUOTE]Not really an option. Being able to jump (either from standing or crouch) and fall through platforms using the same button is what I'm aiming for. It's also pretty standard control scheme layout.

Though you did give me an idea. I moved the events that pull the player down up to an "else" of 'player is on floor' removing them from the "jumping" group, and did this:

+Player.is on floor
+Keyboard.Down arrow is down
+Player.Is overlapping "platform" at offset (0,2)
-System.Set group "Jumping" Deactivated
++Keyboard.On X pressed
--Player.Fall down through jump-thru
--System.Wait 0.2 seconds
--System.Set group "Jumping" Activated

(In case the way I write events is confusing.
+ = condition, - action, ++ = sub event condition, -- = sub event action)

So what i'm doing is that while I'm standing on a platform and pressing down jumping is disabled, instead of disabling it when i'm pressing dow, period. I then reactivate jumping shortly after to allow midair jumps after falling through.

Now, whil this works, it's not without problems either. If I hold down the key after falling through, the player will start moving upwards as the jumping group is reactivated. Currently trying to fix. I'll see about getting a new capx up soon.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Next

Return to How do I....?

Who is online

Users browsing this forum: farfetchd83, makkancs and 24 guests