RPG Maker Forums

CallCommonEventByName

Creator name: Mokusei Penguin

Overview
Plugin command that calls Common Event by name.

Features
Use "Plugin Command" to call the name of a common event

For example- CallCommon [insert common event name]


Calls the common event name "arg1"

※ About CallCommon

Since it's called by Common Event name, there's no need to modify even if the ID changes.

If there are multiple common events with the same names, the most recent will be called.
(This includes deleting the previous event, if you create a new common event of the same name, you can overwrite it.)

Credit and Thanks: Mokusei Penguin

Terms of Use- Free for commercial and non-commercial use.

License - MIT License: http://opensource.org/licenses/mit-license.php

Code:
//=============================================================================
// CallCommonEventByName.js
//=============================================================================
// Copyright (c) 2015 Mokusei Penguin
// Released under the MIT license
// http://opensource.org/licenses/mit-license.php
//=============================================================================
 
/*:
 * @plugindesc 【MPP ver.1.1】 Plugin command that calls Common Event by name.
 * @author Mokusei Penguin
 *
 * @help Use "Plugin Command" to call the name of a common event
 * 『Plugin Command』
 * Ex- CallCommon arg1
 * Calls the common event named arg1
 *
 * ※ About CallCommon
 *
 * Since it's called by Common Event name, there's no need to modify even if the ID changes.
 *
 * If there are multiple common events with the same names, the most recent will be called.
 * (This includes deleting the previous event,
 *  If you create a new common event of the same name, you can overwrite it.)
 *
 * ================================
 * Author : Mokusei Penguin
 * URL : http://woodpenguin.blog.fc2.com/
 */
 
(function() {
 
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _Game_Interpreter_pluginCommand.call(this, command, args);
    if (command === 'CallCommon' && args.length > 0) {
        for (var i = $dataCommonEvents.length - 1; i > 0; i--) {
            var event = $dataCommonEvents[i];
            if (event.name === args[0]) {
                var eventId = this.isOnCurrentMap() ? this._eventId : 0;
                this.setupChild(event.list, eventId);
                break;
            }
        }
    }
};
 
})();
You can download js file from the thread attachment or Dropbox link: https://www.dropbox.com/s/ee4swtzvt41j56s/CallCommonEventByName.js?dl=1

Latest Threads

Latest Posts

Latest Profile Posts

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.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,035
Messages
1,018,459
Members
137,821
Latest member
Capterson
Top