Cannot read property 'actor' of undefined

Greetings fellow developers!

I am developing my first RPG with RPG Maker MV, up until now I playtested it with a starting party of 4 actors, now I want to start with a single actor so I removed 3 actors from the starting party then when I playtest a new game, I get this:


TypeError
Cannot read property 'actor' of undefined
​
If I add 3 more actors to make a starting party of 4, the game works again, the error doesn't occur anymore.
So why does the game engine force me to start my game with a party of 4 actors?
How can I fix this error?
make them empty or run a event on booting (before fading in)
- party member 1, 2, 3

than face in if you play or have a cutscene.
I dont know why it does that if you make 1 actor (as I have as well).

I dont know if "Actor" and "Class" should exist, but empty them out should
do the trick normally, but running the event above as basic should work as well.
make them empty or run a event on booting (before fading in)
- party member 1, 2, 3

than face in if you play or have a cutscene.
I dont know why it does that if you make 1 actor (as I have as well).

I dont know if "Actor" and "Class" should exist, but empty them out should
do the trick normally, but running the event above as basic should work as well.

What do you mean "make them empty"?
I would prefer not add an event just for that, I want to keep the game script the cleanest possible.

Wait, do you mean clear all actors and classes from my database?!? Hell no, I don't want to delete all I created!
😮
What do you mean "make them empty"?
I would prefer not add an event just for that, I want to keep the game script the cleanest possible.

Wait, do you mean clear all actors and classes from my database?!? Hell no, I don't want to delete all I created!
😮
He means the list of your starting party within the Systems tab, top left side. Make sure that you've cleared all the names from that list that you don't want in the starting party.
Very odd, that is clearly not how it's intended to work.

I guess there is code somewhere in your game that was badly written and never tested without a full battlefront of four characters. Reading properties of undefined could mean in this case that e.g. a plugin you made or just put into the game is missing proper detection how many actors are in party or something similar to that.

~炬燵あ
So why does the game engine force me to start my game with a party of 4 actors?
it doesn't - YOU told it that it would have four actors in the statring party, and then deleted some of them.

Deleting an actor in the actor tab does not remove that actor from the starting party - it just deletes the actor data, causing that actor be be undefined.

as said above, to remove an actor from the starting party you need to remove the lines from the setting in the system tab.
and if you can't see them, temporary recreate the actors with names so the blank lines are visible again, remove them from the starting party and then remove them again from the actor tab.

Reading properties of undefined could mean in this case that e.g. a plugin you made or just put into the game is missing proper detection how many actors are in party or something similar to that.
no, undefined are not exclusive to plugins - they can happen whenever something is referenced that does not exist, and that can include database entries.
in this case deleted actors in the database, but the same would happen if you create a treasure chest with an item and then delete the item from the database - crash on opening the chest.
Main-post clearly states the actors were added to and removed from starting-party, that's the piece of information I try to work with. There is no reason to assume the data-array of actors got shortened.

~炬燵あ
Main-post clearly states the actors were added to and removed from starting-party, that's the piece of information I try to work with. There is no reason to assume the data-array of actors got shortened.

~炬燵あ
What main posts state is often not what was actually done, and in this case the clue is the error: that doesn't happen if you just remove actors from the starting party, but it *does* if you just remove actors from the tab.
He means the list of your starting party within the Systems tab, top left side. Make sure that you've cleared all the names from that list that you don't want in the starting party.
This is exactly what I did.
Very odd, that is clearly not how it's intended to work.

I guess there is code somewhere in your game that was badly written and never tested without a full battlefront of four characters. Reading properties of undefined could mean in this case that e.g. a plugin you made or just put into the game is missing proper detection how many actors are in party or something similar to that.

~炬燵あ
Following your reply, I turned off all of my plugins then playtested with a single starting actor again.
And it worked.
So you were right, the error was caused by some plugin(s).
Then I turned back on every plugin one by one and playtested between each one until I identified the plugin which caused the error.
Once the error occurred back, I turned off the last plugin that I had turned on then I turned on all of the remaining plugins and I playtested again in order to check if the error occurs only with one plugin.
It worked.
So only one plugin is at fault.
It is the ActorStepAnim plugin from Shaz.
For some reasons, this plugin requires a starting party of 4 actors and I don't know how to modify it to make it work with a starting single actor.

it doesn't - YOU told it that it would have four actors in the statring party, and then deleted some of them.

Deleting an actor in the actor tab does not remove that actor from the starting party - it just deletes the actor data, causing that actor be be undefined.

as said above, to remove an actor from the starting party you need to remove the lines from the setting in the system tab.
and if you can't see them, temporary recreate the actors with names so the blank lines are visible again, remove them from the starting party and then remove them again from the actor tab.


no, undefined are not exclusive to plugins - they can happen whenever something is referenced that does not exist, and that can include database entries.
in this case deleted actors in the database, but the same would happen if you create a treasure chest with an item and then delete the item from the database - crash on opening the chest.
I didn't, YOU assumed that I deleted some actors from my database even though I clearly stated that "I removed 3 actors from the starting party", not from the actors database.
Please pay attention before replying off the mark, especially if you want to scold.

Main-post clearly states the actors were added to and removed from starting-party, that's the piece of information I try to work with. There is no reason to assume the data-array of actors got shortened.

~炬燵あ
And you were right, this is indeed what I clearly stated and you actually helped me identify the faulty plugin, thank you. 😀
What main posts state is often not what was actually done, and in this case the clue is the error: that doesn't happen if you just remove actors from the starting party, but it *does* if you just remove actors from the tab.
Then this starting post is an exception because it states what was actually done, the clue was accurate.
It did happen after I just removed actors from the starting party and I didn't remove any actor from my database.
Then this starting post is an exception because it states what was actually done, the clue was accurate.
It did happen after I just removed actors from the starting party and I didn't remove any actor from my database.

Fair enough! When you said you were developing your first game I figured you hadn't put plugins in yet, so I thought your issue arose from using the default engine.

Actor Step Animation being the culprit seems odd, because it only has two function aliases in it and neither should cause an issue if you only have one party member. How strange.

Edit: Do you have an older version of it? Apparently this was fixed in an update on the 30th of October 2015:

1647005122045.png
Fair enough! When you said you were developing your first game I figured you hadn't put plugins in yet, so I thought your issue arose from using the default engine.

Actor Step Animation being the culprit seems odd, because it only has two function aliases in it and neither should cause an issue if you only have one party member. How strange.

Edit: Do you have an older version of it? Apparently this was fixed in an update on the 30th of October 2015:

View attachment 219399
Hmm... I don't even remember how I got this plugin...
Possibly it was included into the exta-plugins folder provided with RPG Maker MV?
Let me check...

Indeed, it is provided with RPG Maker MV.
I checked the plugin file properties and it was last modified 2015-10-21, which implies 9 days before the fix.
Do you have a link to download the revised version, please?

I found this, is it good?


Nevermind, just when I posted it, I read "Last Updated: 2021.03.22" so I guess it is the revised version. 😀
Hmm... I don't even remember how I got this plugin...
Possibly it was included into the exta-plugins folder provided with RPG Maker MV?
Let me check...

Indeed, it is provided with RPG Maker MV.
I checked the plugin file properties and it was last modified 2015-10-21, which implies 9 days before the fix.
Do you have a link to download the revised version, please?
I found this, is it good?


Nevermind, just when I posted it, I read "Last Updated: 2021.03.22" so I guess it is the revised version. 😀

Yeah, that one should work.
Yeah, that one should work.
It does.
I just replaced the faulty version with this one and the error doesn't occur anymore.
Thank you all for helping me solve my problem! 😀

Original thread: https://forums.rpgmakerweb.com/threads/cannot-read-property-actor-of-undefined.145658/