Stop Movement v1
RPG Maker MV Plugin
Jackkel Dragon
Introduction
A simple plugin to allow the developer to stop PC/NPC movement based on switches. (PC movement by events can still be run while player movement is restricted.)
How to Use
- Copy the plugin code into a .js file and add it to your project's "js/plugins/" folder. (Be sure to use the name given in the code's header!)
- Load the plugin in RPG Maker MV's plugin manager for your project.
- Set the switches used to stop PC/NPC movement. Set to -1 for unused.
Updates
- v1: First release. November 9th, 2015.
Plugin Code
v1
Spoiler Code:
//=============================================================================// StopMovement.js//=============================================================================/*: * @plugindesc Stops player/NPC movement based on switches. * @author Jackkel Dragon * * @param PC Switch ID * @desc The ID of the switch that stops player movement. * @default -1 * * @param NPC Switch ID * @desc The ID of the switch that stops NPC movement. * @default -1 * * @help This plugin does not provide plugin commands. */(function() { var parameters = PluginManager.parameters('StopMovement'); var PCswitchId = Number(parameters['PC Switch ID'] || -1); var NPCswitchId = Number(parameters['NPC Switch ID'] || -1); var _Game_Player_moveByInput = Game_Player.prototype.moveByInput; Game_Player.prototype.moveByInput = function() { if ($gameSwitches.value(PCswitchId)) return; _Game_Player_moveByInput.call(this); } var _Game_Event_updateSelfMovement = Game_Event.prototype.updateSelfMovement; Game_Event.prototype.updateSelfMovement = function() { if ($gameSwitches.value(NPCswitchId)) return; _Game_Event_updateSelfMovement.call(this); }})();
复制代码
Credits
This plugin is essentially a remake of Yanfly's VXAce script "Stop All Movement". Credit for the original script/idea goes to Yanfly.
Terms
Free to use, even for commercial projects. Credit Yanfly in your game's credits.