Ladder Regions! Help!

darrigaz

  • Posts: 124
Hiya

I'm trying to make a game with the ability to do 4 directional movement, jumping, shooting and ladders, without using pre-made behaviours (I need more flexibility to do some alert/not alert based stealth elements) I've managed to get about 60% of the way to finishing my basic controls but I'm stuck on the ladders.

I've created regions inside the level called "Ladders 0" and "Ladders 1" and am using some "when player enters/exits region" blocks to set an "is on ladder" var that triggers the alternate ladder controls and it seems to sort of work. However, I want to set all the ladder regions in my game to be usable at the same time and at the moment I only seem to be able to get one or other to work (by adding a "set ladders to region" event to the level's on created block). Is anyone able to make suggestions of how to keep all the ladder regions in my level working?

Any words of wisdom gratefully appreciated.

Thanks

P.S. I've attached all the code on my level so you can point out where I'm messing up?

Tuo

  • *
  • Posts: 2469
Are the ladders already made? If so, why not use collisions instead?
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

darrigaz

  • Posts: 124
I tried using collisions but couldnt work out how to do a test for "is not colliding" with the ladder actors. If you can tell me how to do that it'd be a perfectly viable solution.

Tuo

  • *
  • Posts: 2469
What you do is to have a boolean (or other attribute). Set it to "false" at the END of your "always" statement and in the collision code, set it to "true". Then, in the "always" where you use it, check to see if it is "true". The collision coding takes place between the end and start of the "always" statement, so if you are on a ladder, it will be true; otherwise, it will be false.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

darrigaz

  • Posts: 124
Ahh! Wonderful! Thanks! I tried that previously but evidently didn't put my "on ladder = false" far enough down the chain. Stuff the regions!

In the interests of expanding my knowledge is there a way of doing it with regions?

Tuo

  • *
  • Posts: 2469
There basically has to be a way of doing it, but even after two years of programming in Stencyl, I have yet to find a single time when I have needed to use regions in my own games or demos.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)