MZ Can anyone help me figure out what's causing this error?

I know I haven't been on this forum for a while, but I'm still working on my game. It's been over 2 years of effort, and I still likely have another 6 years to go before I'm ready to release it. Just wanted everyone to know I'm still around, still working, and still learning from things you guys post.

I have been getting an error today when doing play testing. It started appearing out of nowhere. I've been walking through my game so far and just balancing and fixing bugs. Been doing this for days without any problems. I was walking through one area of a map, with no cutscenes, nor was I interacting with any events. I was halfway through the map, had just come out of a normal battle encounter and as soon as it started to go back to the map, and the game crashed, but I couldn't quite make sense of the source of the problem (obviously I'm using visustella):
zzzzzzz4.jpg

I screen shot that, then played back through from the last save. Played through the map. No problems. Everything went as normal, including all fights with all random encounters, and continued on with the game.

I entered into a cutscene of a new map area, everything was fine. It transitioned to the next cutscene of another map area. Everything was fine. There a cutscene battle. Everything fine. Battle ends to go back to the map and it crashes with this same error message.

I'm really confused at the randomness of this. I don't recall having moved or renamed any files recently, nor do I understand why this has not happened at all until today. If anyone has any wisdom or advice they can share on this, I would be really grateful because I'm confused right now.

Thanks to everyone who takes the time to read this; I really appreciate your time.
At a glance, it appears that Events and Movement Core is trying to check whether or not your events need labels, and it's running into a snag because one of the events it's trying to check doesn't actually exist.

I couldn't tell you exactly why that's happening, but my first recommendation is to make sure that both that plugin and your core scripts are up to date. It would also be good to make sure that your other plugins are also up to date, just in case there's some type of conflict going on.

If all else fails, I do have a solution that you can try. However, it's sort of a band-aid fix, since it only addresses the error itself, and doesn't actually fix whatever is causing it to think that non-existent events exist in the first place. If you're interested, then paste this into a new .js file and add it to your project through the plugin manager (make sure it's below Events and Movement Core):
Spoiler: Code
JavaScript:
/*:
* @target MZ
* @plugindesc Event label crash fix for VisuMZ_1_EventsMoveCore
* @author Arthran
*
* @help
* ------------------------------------------------------------------------
* Terms of Use
* ------------------------------------------------------------------------
* - Free for any type of use.
* - Credit is not required.
*/

(() => {
    const _Spriteset_Map_isTargetEventValidForLabelWindow = Spriteset_Map.prototype.isTargetEventValidForLabelWindow;
    Spriteset_Map.prototype.isTargetEventValidForLabelWindow = function(targetEvent) {
        if (!targetEvent?.event()) {
            return false;
        }
        return _Spriteset_Map_isTargetEventValidForLabelWindow.call(this, targetEvent);
    };
})();

Please let me know how it goes, as I can't really test it myself (since I don't have your issue to begin with).
At a glance, it appears that Events and Movement Core is trying to check whether or not your events need labels, and it's running into a snag because one of the events it's trying to check doesn't actually exist.

I couldn't tell you exactly why that's happening, but my first recommendation is to make sure that both that plugin and your core scripts are up to date. It would also be good to make sure that your other plugins are also up to date, just in case there's some type of conflict going on.

If all else fails, I do have a solution that you can try. However, it's sort of a band-aid fix, since it only addresses the error itself, and doesn't actually fix whatever is causing it to think that non-existent events exist in the first place. If you're interested, then paste this into a new .js file and add it to your project through the plugin manager (make sure it's below Events and Movement Core):
Spoiler: Code
JavaScript:
/*:
* @target MZ
* @plugindesc Event label crash fix for VisuMZ_1_EventsMoveCore
* @author Arthran
*
* @help
* ------------------------------------------------------------------------
* Terms of Use
* ------------------------------------------------------------------------
* - Free for any type of use.
* - Credit is not required.
*/

(() => {
    const _Spriteset_Map_isTargetEventValidForLabelWindow = Spriteset_Map.prototype.isTargetEventValidForLabelWindow;
    Spriteset_Map.prototype.isTargetEventValidForLabelWindow = function(targetEvent) {
        if (!targetEvent?.event()) {
            return false;
        }
        return _Spriteset_Map_isTargetEventValidForLabelWindow.call(this, targetEvent);
    };
})();

Please let me know how it goes, as I can't really test it myself (since I don't have your issue to begin with).
Arthran, I apologize for taking so long to get back with you. Play testing through my game usually takes weeks. I'm a bit meticulous about it (I end up making a lot of changes and upgrades), so I wanted to continue through my play testing before I responded to you, especially since I won't be going through another play test for the better part of a year because the next section of my game is pretty big and I will need a long time to create it. I wanted to see if the issue came up again in my current play test without using your script. I have not experienced it since, but that does not mean the problem will not arise again.

Side Note: I had already updated all my VisuStella plugins before I made my OP.

Therefore, what I'm going to do is add your script in anyway, and if, by the time I get around to play testing the game again, I run into another error like that, I will screen shot it and respond here to let you know. I hope the admins will not flag me for necro or double posting at that time, since it will likely be quite some time before I get back with you if necessary.

I want to thank you very much for sharing this script with me, and I hope this will work.
Moved to: Plugin Support
Play testing through my game usually takes weeks.
Here is a suggestion of what a lot of people do:

1) create a cheat item that basically calls a common event for cheating.
2) The common event should either use show choices to ask for options, or transfer the player to a hidden cheat map containing chests with experience, gold and items, shops and transfers to all main maps of the game
3) place it in a chest on the starting map
4) remember to remove that chest before sending any demos or finished games out.

That way you can start a new game and cheat your way to whatever needs to be tested without weeks of regular play. It doesn't work for balance testing (obviously), but it will help with functional testing

Because there are quite a number of changes (especially when changing plugins) that require a new game to work correctly.

Original thread: https://forums.rpgmakerweb.com/threads/can-anyone-help-me-figure-out-whats-causing-this-error.158242/