MZ Disable moving up without ladders

I want to create fake 2D platform effect, can I disable move up arrow? I want it to be usable (going up) only on specific tiles (ladders). Anyone can help, please?

Edit: I know I can set this on tiles (just down, left and right arrow), but I want other events to move freely on the map, so can't use this metod.
Yes! I believe there is a way to do it. (I've never tried it before, but I think I know what you need...?)

If you go to Conditional Branches, there should be something that lets you pick:
"If Player presses (button)" (For you, that would be the arrow key), then: (Whatever you want here)
In that specific instance, I think you can just tell the game to not let the player go up.
@PoptartPresident, I tried, but it won't work. Still goes up, but thanks 🙂
This appears to work for MV for whatever reason lol. Idk about MZ though. But might be worth trying. Note that the areas where up key is enabled are regions with ID 1 or anything else you want. Forgot to mention- this is a parallel event.
1603129634497.png
Ooh it didn't work?

Here's what I was able to do, and it won't let the player move upwards.
Did you make sure it was triggered by player touch?
Screen Shot 2020-10-19 at 12.46.04 PM.png


Alternatively, you could also make it to where an empty event is triggered by the "Same as character" so that it gets in the way of the character if they try to move past it. Like an invisible barrier. It could help give the illusion that they can't go up the ladder.


Sorry if it's not what you're exactly looking for, I'm just trying to see some more possible alternatives to get what you want.
This appears to work for MV for whatever reason lol. Idk about MZ though. But might be worth trying. Note that the areas where up key is enabled are regions with ID 1 or anything else you want. Forgot to mention- this is a parallel event.
View attachment 164448
It almost worked, but if I keymap that key different than "up", movement goes crazy (goeas random and "stuck" like with the key is pressed non-stop). Looks like I need to find the piece of code that corresponds to going up. Still have no solution for that, meh.
Maybe this will work?...
If nothing else works, you could use Yanfly's Region Restrictions plug-in. Hopefully you find a better solution though because this could become tedious if you have many levels. :LZSbleh:
I haven't tested, but you could try saving this as a .js file and importing as a plugin:
JavaScript:
(alias => {
  Game_Player.prototype.executeMove(direction) {
    if (direction !== 8 || this.isOnLadder()) alias.apply(this, arguments);
    else this.setDirection(8);  // face up if trying to move up when not on ladder
  };
})(Game_Player.prototype.executeMove);

Original thread: https://forums.rpgmakerweb.com/threads/disable-moving-up-without-ladders.128892/