Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Resource icon

Common Event Logger 1.2

No permission to download

Mr. Trivel

Praised Adventurer
Xy$
0.00
Mr. Trivel submitted a new resource:

Common Event Finder - Common event executed and you have no idea where? Now you'll know.

Name: Common Event Finder
Version: 1.0
Author: Mr. Trivel
Created: 2016-02-12

What does it do?
Prints all executing common events to console.

Screenshots:


Plugin:

How to download Plugin. Click the link above, there will be a button named Raw, press Right Click -> Save As.

Legal:

Free for non-commercial games.
Free for commercial games.
Read more about this resource...
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
Thank you for this. I really needed the code, I've modified it a bit to suit my needs.
If you don't mind I'd like to share the code I've modified a bit.

This code will also store last calling event ID & Item ID to game variables set in the plugin manager:
JavaScript:
//=============================================================================
// MrTS_CommonEventDebug.js
//=============================================================================

/*:
* @plugindesc Logs all executing common events to console.
* Add-on: Store last calling event ID & Item ID to game variables
*
* @author Mr. Trivel (add-on by CT_Bolt)
*
* @param On
* @desc Default: true
* @default true
*
* @param Game Variable ID (Event ID)
* @desc Set Game Variable ID to hold calling Event ID
* (Note: If set to 0 this will not do anything)
* @default 0
*
* @param Game Variable ID (Item ID)
* @desc Set Game Variable ID to hold calling Item ID
* (Note: If set to 0 this will not do anything)
* @default 0
*
* @help
* --------------------------------------------------------------------------------
* Free for commercial and non-commercial use.
* Version 1.0
* --------------------------------------------------------------------------------
*
* --------------------------------------------------------------------------------
* Open console by pressing F8.
* --------------------------------------------------------------------------------
*
* --------------------------------------------------------------------------------
* Version History
* --------------------------------------------------------------------------------
* 1.0 - Release
*    ---Add-On (Store last calling Event ID & Item ID to Game Variables)
*/

(function() {
    var parameters = PluginManager.parameters('MrTS_CommonEventDebug');
    var paramOn = Boolean((parameters['On'] || "true").toLowerCase() === "true");
        var gameVarID = Number(parameters['Game Variable ID (Event ID)']);
        var gameVar2ID = Number(parameters['Game Variable ID (Item ID)']);

    var _GameInterpreter_setupChild = Game_Interpreter.prototype.setupChild;
    Game_Interpreter.prototype.setupChild = function(list, eventId) {
        _GameInterpreter_setupChild.call(this, list, eventId);
        if (paramOn){
              console.log((eventId === 0 ? "Battle" : "EventID: " + eventId)  + " executed CE ID #" + this._params[0]);
               if (gameVarID === 0) {
               }else{
                 $gameVariables.setValue(gameVarID, eventId);
               }
            }
    };

    var _GameAction_applyGlobal = Game_Action.prototype.applyGlobal;
    Game_Action.prototype.applyGlobal = function() {
        this.item().effects.forEach(function(effect) {
            if (effect.code === Game_Action.EFFECT_COMMON_EVENT) {
              if (paramOn){
                    console.log("ItemID: " + this.item().id + " executed CE ID #" + effect.dataId);
                     if (gameVar2ID === 0) {
                     }else{
                       $gameVariables.setValue(gameVar2ID, this.item().id);
                     }
                  }
            }
        }, this);
        _GameAction_applyGlobal.call(this);
    };
})();

Edit:
I've made a demo for collecting apples that uses this: click here to view


Thanks again for all your help (cool)(thumbsup)
 
Last edited:
Top