Pretty much just what the title says. I need a short script snippet that forces the player to be unable to use left arrow and up arrow to control main character movement for...well...the duration of the game! :hhappy:
Disable "Up" and "Left" Map Movement
JS Plugin RequestsTry saving this as a .js file and importing as a plugin~
I.e. "get input direction; if it's forbidden then return 0 (no move); else return direction". RMMV uses numpad directions; 4 = left and 8 = up. 🙂
Code:
(function() {
'use strict';
const FORBID = [4, 8]; // forbidden player movement directions
let alias = Game_Player.prototype.getInputDirection;
Game_Player.prototype.getInputDirection = function() {
let out = alias.call(this);
if (FORBID.contains(out)) return 0;
return out;
};
})();
or this plugin to disable others if need later if need.
Original thread: https://forums.rpgmakerweb.com/threads/disable-up-and-left-map-movement.109994/