The Situation
I'm trying to make a RPG Maker MZ plugin which change player's clothes based on equipped item.
The plugin works in combo with common event: the plugin assign a designated common event so it will be executed after an armor/weapon is equipped.
The common event is currently a hierarchy of ifs and case switches that control what faceset / spriteset to be used.
So far, I can make it partially work through this code
The Problem
That code doesn't change anything in the Menu and Equip Scene. The spriteset is changed successfully, but the faceset only changed when you exit Menu and Equip scene completely, then go back to the Menu/Equip Scene.
So in conclusion, the Common Event is working, but not executed in the supposed time and place.
I just realized that based on $gameTemp.reserveCommonEvent(ID) is exist to just queue the soon-to-be-executed common event. It doesn't execute that common event right away in the Equip Scene.
Is there any way to execute common event right away in Equip Scene?
I'm trying to make a RPG Maker MZ plugin which change player's clothes based on equipped item.
The plugin works in combo with common event: the plugin assign a designated common event so it will be executed after an armor/weapon is equipped.
The common event is currently a hierarchy of ifs and case switches that control what faceset / spriteset to be used.
So far, I can make it partially work through this code
JavaScript:
(function() {
Scene_Equip.prototype.onItemOk = function() {
SoundManager.playEquip();
this.executeEquipChange();
this.hideItemWindow();
$gameTemp.reserveCommonEvent(ID);
this._slotWindow.refresh();
this._itemWindow.refresh();
this._statusWindow.refresh();
};
})();
The Problem
That code doesn't change anything in the Menu and Equip Scene. The spriteset is changed successfully, but the faceset only changed when you exit Menu and Equip scene completely, then go back to the Menu/Equip Scene.
So in conclusion, the Common Event is working, but not executed in the supposed time and place.
I just realized that based on $gameTemp.reserveCommonEvent(ID) is exist to just queue the soon-to-be-executed common event. It doesn't execute that common event right away in the Equip Scene.
Is there any way to execute common event right away in Equip Scene?