MV my common event has broken mouse and other events

I am using Yanfly's skill mastery levels and the skill tag is this

<After Eval>
if (user.skillMasteryLevel(item.id) >= 1) {
var commonEvent = $dataCommonEvents[22];
if (commonEvent) {
var eventId = this.isOnCurrentMap() ? this._eventId : 0;
this.setupChild(commonEvent.list, eventId);
}
}
<After Eval>

with the common event being this(not using script but basic functions)

If : Gold >= 0
Control Switches : #0001 Harvestablerank1 = ON
Text : None, Window, Bottom
: Skill level is one.
:End

the skill causes common event but after that I can no longer click any thing
and events will not play no matter what they are set to.
Not sure what's going on, but I'm surprised the event runs even once: your code assumes it's in a Game_Interpreter context (a.k.a. this value) but I believe this tag's context is actually Game_Action.
  • Are you sure the event only runs when the skill mastery check passes?
  • Maybe you've added a Common Event effect to the skill and actually it's running from there?
Try one of these instead~
  1. JavaScript:
    <After Eval>
    if (user.skillMasteryLevel(item.id) >= 1) {
      $gameTemp.reserveCommonEvent(22);
    }
    </After Eval>

  2. JavaScript:
    <After Eval>
    if (user.skillMasteryLevel(item.id) >= 1) {
      var ev = $dataCommonEvents[22];
      var pt = $gameParty.inBattle() ? $gameTroop._interpreter : $gameMap._interpreter;
      var id = pt.isOnCurrentMap() ? pt.eventId() : 0;
      pt.setupChild(ev.list, id);
    }
    </After Eval>
If your common event is autorun it will always run at the expense of anything else. Make sure you didn't set it to autorun.
ok I'll try the above and check if the common event is autorun.

Original thread: https://forums.rpgmakerweb.com/threads/my-common-event-has-broken-mouse-and-other-events.134840/