MV Known problem, unknown solution

Hello makers,

testing my educational game I encountered the error shown in the image attached: it happens when starting a battle. I searched the forum and I found this "Cannot read proprerty..." error is quite common, so tried the solution I found: I updated the plugins, and the project too. But the problem is still there.
At this point I suppose that the problem is related to a specific resource/sprite/etc... but I can't understand which one.
Is there a way to figure it out what's causing the problem?
Thanks in advice for the help, and happy making to everybody!

EDIT: just found something strange: error is caused by a Troop (quite obvious, I found which one by disabling the others one by one), strange is that the Troop is perfectly configurated (I have many other quite identicals). Also, copy-and-pasting the Enemy and Troop in different positions will make the battle start, but with no Enemy sprite image (battle immediately ends with a victory). And this happens also when changing the troop enemy image with a working one...

I'll continue working on my project just marking these "problematic" Enemy and Troop lines as DEAD, and making again the same Enemy and Troop from scratch on blank lines, still I would like to know how to solve the problem just to avoid it in the future.

Does any of you experienced makers have any suggestion?

Bug.jpg
Hello makers,

testing my educational game I encountered the error shown in the image attached: it happens when starting a battle. I searched the forum and I found this "Cannot read proprerty..." error is quite common, so tried the solution I found: I updated the plugins, and the project too. But the problem is still there.
At this point I suppose that the problem is related to a specific resource/sprite/etc... but I can't understand which one.
Is there a way to figure it out what's causing the problem?
Thanks in advice for the help, and happy making to everybody!

EDIT: just found something strange: error is caused by a Troop (quite obvious, I found which one by disabling the others one by one), strange is that the Troop is perfectly configurated (I have many other quite identicals). Also, copy-and-pasting the Enemy and Troop in different positions will make the battle start, but with no Enemy sprite image (battle immediately ends with a victory). And this happens also when changing the troop enemy image with a working one...

I'll continue working on my project just marking these "problematic" Enemy and Troop lines as DEAD, and making again the same Enemy and Troop from scratch on blank lines, still I would like to know how to solve the problem just to avoid it in the future.

Does any of you experienced makers have any suggestion?

View attachment 194326
Is the troop trying to call an enemy that was deleted from the database?

Did you recently decrease the number of enemies in your database?
Moved to: Plugin Support
Can you please confirm what version of the editor you are using, as well as the version of your core files? The first can be seen just by looking in the editor (Help > About or something like that). For the second, you need to go to Game > Open Folder then go into your js folder and open the rpg_core.js file in a text editor. The version, if it's there, will be on the first few lines. If it's not there, it means you have 1.1
Sorry for posting in the wrong place!

@Shaz : I'm using RPG Maker MV version 1.6.2, and the same says rpg_core.js (v1.6.2). Also, I checked all the main plugin's versions, especially YanFly's: they are all updated.

@ThreeSixNine : yes, both things for sure. Considering (hopefully) finished the "building" part of my project, before starting testing I reorganized many thing in the database (this is my first project, and things were really messy). Maybe the problem started here?

Just tried rebuilding (in another lines of the database) Enemy, Troop and the Event related to this Troop/Battle, and everything seems to work...

So, what's the problem whit that "DEAD" lines? Are they lost forever?

Thanks guys!
My guess is that you've added enemies to that troop, then deleted one of them from the Enemies tab. You can't SEE it because the image will no longer be there in the Troops tab.

I suggest you go to the troop and clear/reset so it removes all the enemies (don't delete them manually one by one, because you can't see all of them and will miss the "problem" one). Then just add them back again.
and I found this "Cannot read proprerty..." error is quite common
you are under a slight misconception here.

what you have is not a common error, but a class of hundreds of errors that all result in the same error message.

and the key to that message is the last part of it: "of undefined".
This always means that the engine tried to access a data object that has been deleted.

and that is why a lot of people get that error: they delete things (directly or indirectly) and forget to check if the deleted object is still in use somewhere.
the solutions you tried are only from a small subset of that error class where compatibility between versions has introduced new objects or removed older objects, but most cases this happens after someone deleted still needed objects from database or elsewhere.
Thanks for the explanation, still I'd like to know if there is a way to solve the problem.

I mean, forgetting something in a complex thing like making a game (in this case, forgetting if a deleted object is used somewhere) seems to me quite easy to do, if not obvious.
So: is there a way to know which object cause the problem, or not? Is this problem present in RPG maker MZ too or is it fixed in some way?
Hi @Shaz,
don't know if this can be considered necroposting, if so sorry for that.
Question is that in my newest project I have a problem similar to that described in this thread.
First of all I inform you that I moved from MV to MZ, currently working on v1.7.0, rmmz_core.js is v1.6.0.
In my games during battles I have an event called each turn, but in many cases it happens that in the same turn TWO events are called, the one I want and ALSO an unwanted one which is not in the troop settings.
Yes, I made a mess this time too with troops and enemies, so I think that this time too it is a matter of resetting enemies/troop from database and doing them again from scratch. Question is: how can I reset them? In your post you said to
clear/reset so it removes all the enemies (don't delete them manually one by one, because you can't see all of them and will miss the "problem" one). Then just add them back again.
How can I perform such clear/reset? Do I have to do this in the game engine (where? how?)? Or were you talking about deleting them from within some system file? If so, which one?
Please help me, I don't wanna leave "dead" enemy or troop slots in my game this time (also I want to learn how to resolve this).
Many, many thanks in advice to you and to all of the RPGmakers out there that will help me!
How can I perform such clear/reset?
Pretty much the same way you would in any software.

Click on a database entry.

1700664140343.png


Press Delete. (or right-click -> Clear)

1700664436166.png
Thanks @ATT_Turan, just wanted to be sure it was that.
Many thanks and greetings from Italy

EDIT: the solution is here:

I remeber having had the same issue, but didn't remeber the solution.
Sorry for bothering with no reason, but many, many thanks anyway for the much appreciated help and quick answer

Original thread: https://forums.rpgmakerweb.com/threads/known-problem-unknown-solution.138115/