Ledge hanging and Falling help

Get help using Construct 2

Post » Sun Jun 08, 2014 9:50 pm

Hi guys!
So I'm having a small problem with the ledge hanging/falling.
What I would like to accomplish is to have the player to hang on the ledge for x seconds as long as shift key is pressed but even if the key still pressed, the character falls.

I tried doing it with the variable I'm using for LedgeGrabbing.
It was something like: PlayerHelper is Grabbing ---- Wait X Seconds Then set isGrabbing to False.
But with no results.

Also tried setting the ledgehelper collision to false and then once its falling again set it back to true. But again no luck.

Thanks in advance for checking the file out. !

Cheers!

here is the capx file.
https://www.dropbox.com/s/dzhuzf07xi617qj/test_01.capx

Controls are:

left and right keys for movement
up key for jumping
up plus left or right key for wall jump
wall glide pressing left or right facing the wall
shift key for ledge grab
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Mon Jun 09, 2014 12:52 pm

still looking at your capx..nice job !!:)
but i would first try changing the 1st Event in the Group"Grab Ledge/Hang/Climb"

"Shift is down (inversed)" event to

"Shift is released--> "

this event triggers differently to what you have

see what that does...
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Mon Jun 09, 2014 11:18 pm

Thanks mystazsea !
Still, I'm not able to fall off the ledge after x amount of time.

I tried adding in the Catch a Ledge section a System Wait after Set Grabbing to True and then turn this variable to false but with no results.
The only way that seemed to work so far was to turn off the collision of the ledgehelper and then back on. but once I turn it back, I cant grab ledges anymore.

Cheers!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Tue Jun 10, 2014 4:56 pm

Shameless bumpy bump!
I really need someone to point me out the right directions because Im completely lost here. Technically it should work the same way as I did the wall glide but is not working. Ive been trying every single method I could think off but no luck.

Thanks in advance!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jun 11, 2014 12:25 am

Finally, I got it!
Actually the idea came after helping someone else! :D

What I did was to destroy the ledgehelper after x seconds of grabbing the ledge and after the Player starts falling, re spawn it after x seconds in order to avoid colliding with the ledge again. If a fall is too short, I re-spawn the ledgehelper on the floor as well.
I don't know if this is the way of doing it but so far it works fine. If anyone got any other ideas please let me know.

Thanks!!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jun 11, 2014 12:34 am

Nevermind, is not a great solution since during debug I see an exponential increase in the number of ledgehelpers created.
So I still need help :(
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Wed Jun 11, 2014 6:31 am

Fraktal Zero, its much easier than that.

ive made a copy of your event for grabbing and disabled yours so you can see whats different
--> added a "Trigger Once while true" to the Shift grab Keypress
This makes sure that its not a loop kept active by keeping Shift down
then
-->added a Timer to the Player detect "GrabTimer" every time the player does actually grab a ledge
its set to 4 seconds ..you can change this if you like
on the "Grabtimer" expring the Ledge Grabb Boolean is made false dropping the player

but can reactivate on each new shift press

Hope that helps

new ledge grab.capx
You do not have the required permissions to view the files attached to this post.
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Wed Jun 11, 2014 11:15 pm

Ha! Big thanks mystazsea!! That works perfectly!
Never thought of adding a Timer. Actually I didn't even remember that Behaviour. Also I learned more than a few new things
thanks to you.
Thanks again!

:)

Cheers
B
43
S
12
G
14
Posts: 488
Reputation: 10,570


Return to How do I....?

Who is online

Users browsing this forum: mikehive and 41 guests