Help With "Cannot Read Property '0' Undefined"

I've read some other posts concerning this, but I was not able to figure out the source of my specific problem. I wondered if anyone might be able to read the error I was getting on this, and help point me in the right direction for what I should be looking for.

zzzzzzz1.jpg

As a side note, I am only getting this error when starting a new game. My previous saves (for testing) work fine, so I'm not sure what it is I changed to cause this, but I am certain I did not change any of my plugins, meaning that I did not add or take away any plugins.

Also, I'm using VisuStella if that helps. (Which should be obvious from the "VisuMZ") It's weird that it is pulling up errors on the EventsMoveCore because I haven't changed any settings on that since I started working on the game last year.

Any help would be much appreciated because I'm stuck.
I know you said you haven't added/removed any plugins, but have you tried disabling move core and any other plugins (probably best to try one at a time) to isolate the problem? Sorry, I know that's not terribly helpful, but maybe it will get some progress in the right direction.
"Of undefined" is the key part of the error message.
It basically means that the engine tried to access a data object that does not exist.

in general, possible reasons for this are:
1) you deleted an object in the database that is still referenced somewhere - like creating a treasure chest with an item, and then deleting that item from the database. You'll get an of undefined when opening the chest.

2) wrong configuration of a plugin
Many configurations in plugins use numbers as ID references. Place such a number to a reference that does not exist and you'll get there.

3) incompatible plugins
plugins add themselves into the engine by replacing part of the code. And while all plugins check for the original engine, they can never guess changes done by other plugins. And that can cause conflicts.

That said, the error is somewhere in the movecore.
I don't know that specific plugin but it is highly likely that one of the events on your first map contains the wrong reference.
So that is where you have to check for the mistakes first.
which would also explain why it is only on new game, your savedgames are already on later maps.

and it is also likely that the event with the error contains a script call with a part .0 or a positional reference like .pos or .x or .y etc.
I know you said you haven't added/removed any plugins, but have you tried disabling move core and any other plugins (probably best to try one at a time) to isolate the problem? Sorry, I know that's not terribly helpful, but maybe it will get some progress in the right direction.
I did as you instructed, and the game does start if I disable the EventsMoveCore. If I turn it back on, it errors out again. I haven't changed anything on it since I installed it almost a year ago. I believe I changed the size of one of the fonts when I first installed, and I haven't touched it since. I have kept everything default on that plugin.

in general, possible reasons for this are:
1) you deleted an object in the database that is still referenced somewhere - like creating a treasure chest with an item, and then deleting that item from the database. You'll get an of undefined when opening the chest.
The way I test my game is to play through it many times. The last playthrough I have done has only added in new items, new skills, and new events. I haven't deleted any items, so it worked fine from the start. I'm open to searching for something I may have changed in my most recent update (which spans over a few weeks), but I added so much, I don't know where to begin.

The game opens on a completely black room I made for an intro. It only sets some variables at the beginning, and then puts on some text to start the story. I checked all the variables in that room's only startup autorun event, and everything is as it was the last time I restarted. However, the error shows up before anything loads. It just instantly goes into the error--I even put in some text into the autorun that sets the variables (which is the first thing that happens when the game loads), and none of the text would come up, which means this erroring out before ANY event in the game loads.
2) wrong configuration of a plugin
Many configurations in plugins use numbers as ID references. Place such a number to a reference that does not exist and you'll get there.
That sounds reasonable. However, I'm having difficulty finding anything in the EventsMoveCore that has a reference to anything like that. There are no resources in that; it's mostly just value options. The only thing I could find was a "Preloaded Maps" option that is default set to 1. I tried to set it to 2, but I got the same result. I don't even know what that's referring to.

3) incompatible plugins
plugins add themselves into the engine by replacing part of the code. And while all plugins check for the original engine, they can never guess changes done by other plugins. And that can cause conflicts.
But I have played through multiple instances of this game without any changes to the plugins. So this means that I must have changed some value I was not aware of that affected the initial loading process. Now, I'm not a scripter; I'm not very good with that stuff, and only know the basics, so I don't mess with those.

I guess I don't know where to start looking from here, and could really use some help from anyone; any guesses would be helpful. Does RPGMaker load in all the events that will be used in the game upon loading? Or does it just use them when they occur?
zzzzzzz1.jpg
Just in case, I'll post a screen shot of my initial event; although, after this test, I do not believe this has anything to do with it. As you can see, this is just some basics, and should not affect anything in the items or skills to cause that error.

NOTE: I also tried putting the player in another map area and starting a new game. Same result.

I'm a little desperate now because essentially blocks me from doing anything else with my game. I am appreciative of any advice. 😳 Thank you to all who have commented.
I guess I don't know where to start looking from here,
I told you where to start looking after the three general overviews.

from everything you described it has to be an event on the first map
from everything you described it has to be an event on the first map
I agree with that. If it's not an event on your first map, maybe a common event, possibly tied to a region? Maybe even one of the items or skills? It's something being called at the start of a new game...I think (disclaimer: not an expert). Most of troubleshooting is just isolating the problem; what have you changed since the last time it worked? That can be a tough question, especially if its been a bit or if you added a lot, so maybe start with, what do you know you haven't changed? You could try putting in default values throughout the plugin, but I would guess that will give you the same results. What if you delete that first event? The last item you added? Obviously, your game probably needs those, but maybe just make a backup and edit out things you've changed one at a time until the game works again. Good luck; I hope it's up and running again soon!
If you're able/willing to upload the project somewhere, so I can take a look at it, I'm reasonably confident that I can figure out the issue for you. But otherwise, all I can tell you is that the issue possibly involves common events in some way. VisuStella's obfuscation nonsense makes the stack trace kinda hard to decipher.
I'm sorry it's taken so long to get back with you all. I appreciate all your suggestions, and though this may be frustrating to some who have given me so much advice, I have still not solved the problem. I wanted to take time to do a lot of testing before I responded (and to not run into any forum rule landmines about double posting).

Before I wrote any of this thread, I knew there was a problem with the initiation of the game itself. Other people had errors popup DURING the game, whereas mine was more unique in that it was popping up BEFORE the game even started. That's why I was somewhat in disagreement with Andar's suggestion, although I appreciate it, but I decided to try every possible avenue, so I tested everything I could think of based on all your suggestions.

To address the "first map" issue -- technically, my first map is NOT my introduction map to the game. It's a map I have called "QuickRef," which is a map that contains a bunch of events I common use, so I can just copy and paste them as needed. Of course, this could potentially cause problems if I am loading up the game and it errors out before starting, so I tried deleting it (without saving the game), and still go the error 0 message.

Next, while QuickRef was deleted, I went to my first map, which is a black area for the start of the game that only has one event to set all the variables I need. I deleted that event, and tried to start the game. Still got error 0.

I restored the game without saving to its original. I checked out ALL of the events in QuickRef, including ALL the common events that were called through them. I went through every line. Could not find any discrepancies.

I also tried deleting the Visu-EventsMoveCore plugin, and reisntalling it. Still error 0.

Again, the only thing that makes the game work is shutting off or deleting EventsMoveCore. I agree that there is something the game is looking for on that, but I'm not sure what it is.

I decided to check out the EventsMoveCore options in the comment events tab, and I did not even know that you could use that to call up so many events. (I haven't learned everything about VisuStella options yet.) That's going to be fun to use later, but I haven't called up anything using that plugin.

It was also suggested that something may have to do with regions. I haven't learned how to use regions in my game yet, so I haven't used anything with regions, so that eliminates that problem.

Also, the suggestion about common events calling up something that does not exist simply does not make sense to me. I have checked many of the common events I have added to the game since my last playthrough, and the problem is that, even if there was an error, it should not show that error until the game loads, and then only when that common event is called up.

This has to be something so stupidly simple, that I am going to smack my head against a wall when I figure it out, but at this point, I'm getting close to a place where I would be open to have someone else take a look at it, although I am really not very comfortable with it. I won't turn the charity however, since it is vital that I fix this.
---------------------
---------------------
All this was what I was about to write, and then I decided to do the other thing suggested, which was to copy/paste the game into a separate file and start deleting things, so I first decided to delete the entire common events list. And the game started up!

Aha! A clue. Which means you guys were right. I figured I should write this down so anyone else who reads this might know what steps to take if they have the same problem I did. So let's figure this out. Testing deleting certain chucks of events...

I found it! It actually correlates to another post of a problem I had recently:
I have a Common Event that was set to "parallel" with a switch to activate it. Am I misunderstanding this? I thought that it would only run parallel if the switch was on? Apparently, it's running nonstop, even before the game starts. Am I to understand that the common event will run constantly no matter what if you have "trigger" set to "parallel?" As soon as I set it to "None," the game started up with no problem. Then how was it able to run on previously saved games?

Furthermore, what in the... what would cause an error on the EventsMoveCore?! How does that even make sense? It has NOTHING to do with that! Nevermind... if you answer it, I probably won't understand it anyway.

I need this common event to run when the switch is activated. I need it to check if a state is still active on an actor, and to revert back to normal form (i.e. change actor image) when the state is removed. Is there a way I can run a loop in the common event instead, so that way the game doesn't spaz on me? I'm not sure what the solution is for that one. 😳

Thanks so much for all your help guys--you've been amazing. 🙂
You could search the database for where the switch you're using to control the common event is used. It shouldn't be running unless that switch is on. Of course, funny things happen sometimes, so that might not do the trick either. You could always try it with a fake switch -- one down the list your game hasn't used for anything -- and see if it still autostarts. That sounds like a frustrating problem, but I'm glad you're making some progress!
Apparently, it's running nonstop, even before the game starts. Am I to understand that the common event will run constantly no matter what if you have "trigger" set to "parallel?"
no, such a common event will run ONLY if the switch that is assigned to trigger it is turned on.

as soon as you turn the common event to parallel, it will run on the first map with that switch ON - which never meant the first map in your maplist, but the first map processed in your game. The map that has your starting player point.

Usually all switches are off on new game - UNLESS there is a plugin that turns them on before newgame.
If the common event is running, then that switch is ON - and if you didn't turn it on in an event, then you have a plugin that turns it on.

Which gets to the next point, same as with another comment from you:
(I haven't learned everything about VisuStella options yet.)
Whenever you use ANY plugin, you always have to check all its options. And if you don't know what an option does then you have to inform yourself before using that plugin.
You simply CANNOT add a plugin and ignore it, simply because it might have options that cause errors or that will do unexpected things because you forgot to configure them correctly.

and switches and variables used by plugins are prime candidates for that - either because the plugin might change them without your knowledge, or because they are intended to control aspects of the plugin and you accidentally turn them if they are configured to a switch or variable you use for something else.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-cannot-read-property-0-undefined.145039/