じ☆ve冰风 发表于 2026-7-28 15:57:24

Stop PC/NPC Movement

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.


本贴来自国际rpgmaker官方论坛作者:Jackkel Dragon处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/stop-pc-npc-movement.50032/
页: [1]
查看完整版本: Stop PC/NPC Movement