Ladder Animations NightMare!

Get help using Construct 2

Post » Sat Mar 24, 2012 10:27 am

Hey fellow C2 Guru's I am in need of your assistance. I have a bit of ladder logic that works based on gravity, which allows the player to climb up with overlapping and object and when they are not to reset the gravity back to default. I have attached a screenshot of my entire ladder code.

The problem I am having is when the player is overlapping the object I set a boolean on the player "onLadder" to true (the default is false) and then to play "Climb" animation. Now when the player is ON the ladder it plays the animations perfectly as long as I do NOT move :( As soon as I move it defaults back to frame 1 of the climb animation and he just appears to slid up or down.

What I need is to have the player on the ladder and if he is not climbing then pause the animation on that frame and if he moves again to continue playing from that frame..... I have been fighting with this for ages and it is doing my head in. So any and all help would be fantastic and I would be greatful for you ending my ladder torment lol.

Thanks in advance!

[Old Image Removed]ColPhilBilko2012-03-25 12:06:34
Posts: 8
Reputation: 1,348

Post » Sat Mar 24, 2012 12:42 pm

First, I think you made stuff a bit complicated.
You don't really need to change gravity, just to control vector Y
If you want your character to not fall always set vector Y to 0 and for moving up and down it looks like you found out (:

Anyway, the thing I don't quite understand is why you spawing the Ladder1 object. What is it for ?

Second, if you give me a stripped version of your capx, just with your character some animation, a ground and a ladder object, I can more easily tweak things to show you.

That's all (:
Posts: 1,488
Reputation: 16,594

Post » Sun Mar 25, 2012 12:12 pm

Ok I simplified it quite a bit as the old way was just not working correctly, however I am still having issues getting the climb animation to fire.

Here is the new system:

I am trying to get an animation called "Climb" to fire and play when moving up or down the ladder and pause when not moving, but no matter what I do, I can not get this to work correctly.

Also As the system is right now when I let go of the up or down arrow the character falls off the ladder, I want him to stay on the ladder unless he is either at the top or bottom.

As usual any and all help is greatly appreciated.

Posts: 8
Reputation: 1,348

Post » Sun Mar 25, 2012 2:32 pm

A ladder system that works

1.object ladder
2. object player

if player overlays ladder
                           -> Platform disbled
sub event
on key pressed Up -> Set player.animation to "climb"
                     player.y = y+1 (or whatever you want)
on key pressed down -> same theory as above

Now to "dismount"

find out x,y of locations where you want to exit

player.y > location.y -> platform enabled
                           player.animation = "default"
The above MAY work, i did not test it since i do not have construct at hand right now.. if no one posts any solution until i'm home i may post a working example.

rgros2012-03-25 14:33:24
Posts: 69
Reputation: 1,491

Post » Sun Mar 25, 2012 2:46 pm

I don't see where you are setting the player animation to "Climb" anywhere. Did you delete it from event where the player is overlapping lader_climb? (I would think it would come right before or after the setting X action.

Anyway, here is a sample that I was playing around with. When the player overlaps the ladder the platform behavior is disabled and he starts climbing. When Space is pressed if the player is climbing then the platform behavior is enabled and climbing is turned off. So there is no dismount area. The player can dismount anytime and suffer the consequences. But it does stay put on the ladder.


Note if player is red default animation is playing, if purple climb animation is playing.

EDIT:This was created with R83, so you would need to update C2 if you haven't already. Here are my events:

kittiewan2012-03-25 14:56:33
Posts: 281
Reputation: 12,448

Post » Mon Mar 26, 2012 6:22 pm

Thanks for all your help guys, I had to get help re-writing most of my logic lol I just was way to over complicated. It is all sussed now.

Thanks again.
Posts: 8
Reputation: 1,348

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests