Restart Common Event

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
605
Reaction score
1,003
First Language
English
Primarily Uses
N/A
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
 

Attachments

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Did you know that we use robotic spy animals to learn about how different species behave in the wild? We're only a step away from robotic spy humans, and then Terminator. :p
Not being able to do a commission/request after all and having to give back the money is so heartbreaking.

Sometimes I'm just way too eager to help people out and suddenly find myself in a very deep hole because I'm not gonna be able to finish it. I really hope I don't come across as unprofessional to these people and in general. =n="
Learning Action Sequences!
ANY FEEDBACK APPRECIATED!

Online Platformer TEST DEMO 0.1 - 4 simple Maps. Just jumping test. (I still have 2 minor problems to fix).
So ms store had an idea to nuke the the entire app when the file integrity is slightly broken.

Forum statistics

Threads
98,044
Messages
948,794
Members
129,307
Latest member
kayahowayarshh
Top