RPG Maker Forums

Restart Common -2019/03/12

Creator 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

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[0]);
      if(!id) return;
      var events = $gameMap._commonEvents;
      if(!events) return;
      for(var i = 0 ; i < events.length; i++){
        if(events[i]._commonEventId == id){
          events[i].discardInterpreter();
          events[i].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

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,469
Members
137,821
Latest member
Capterson
Top