Restart Common Event
Restart Common -2019/03/12Creator name: kido0617
Overview
Restart parallel common event from the beginning
Plugin Command
Code:
RestartCommon 3
Input common event number after RestartCommon
Note: Plugin works for RPG Maker MV version 1.6 or above
Spoiler Code:
/*---------------------------------------------------------------------------*
* 2019/03/12 kido0617
* http://kido0617.github.io/
*---------------------------------------------------------------------------*/
/*:
* @plugindesc Restart parallel common event (RPG Maker MV 1.6 or above)
* @author kido0617
* @help
* ・Plugin command
*Input common event number
*RestartCommon 3
*
*
*/
(function(){
const _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'RestartCommon') {
var id = Number(args);
if(!id) return;
var events = $gameMap._commonEvents;
if(!events) return;
for(var i = 0 ; i < events.length; i++){
if(events._commonEventId == id){
events.discardInterpreter();
events.refresh();
return;
}
}
}
};
Game_CommonEvent.prototype.discardInterpreter = function() {
this._interpreter = null;
};
})();
Credit and Thanks: kido0617
Terms of Use- Free for commercial and non-commercial use.
License - Public Domain
You can download js file from the thread attachment or Dropbox link: https://www.dropbox.com/s/ezedlrftchzph3l/RestartCommon.js?dl=1
本贴来自国际rpgmaker官方论坛作者:ovate处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/restart-common-event.107142/
页:
[1]