RPG Maker MZ

RPG Maker MZ

TypeError - Cannot read property 'expParams' of null
I made sure to check the database and here's what's up.
1 actor only. 1 actor in the starting party. I even cleared their data so that they don't have *any* weapons, armor, items, skills, or class.

If I remove even that single actor, the game will run perfectly, but with an invisible actor.

What in the world is wrong with it?
< >
Showing 1-9 of 9 comments
JohnDoeNews Apr 6, 2021 @ 10:53pm 
And if you remove the actor and then make a new one? (select it, delete it, then put in all the info again)

Thing is... Somewhere in your game, you've made a link to one of the extra parameters of you character. Can be Hit rate, target rate, experience rate, stuff like that.

But, for some reason, the info is not there.

This can happen when you try to read out the Hit Rate of Actor 6, while there is no actor 6, for example.

I can't tell you where you went wrong, but at least now you know what you are looking for... I hope.
JohnDoeNews Apr 6, 2021 @ 10:59pm 
Oh... Did you load an old save? Or try a new test game?

When you get an error like this, always try if you also get the error when starting a new game (so start at scene 1 in the testplay). Maybe only your save-file is corrupt.
coyote_craft Apr 7, 2021 @ 8:47am 
I don't think you can have an actor with no class.
Caethyril Apr 7, 2021 @ 4:44pm 
Yea, the error is because one or more actors have no valid class assigned, i.e. their class is null.
JohnDoeNews Apr 8, 2021 @ 3:19am 
Oh wow. I totally missed that. You encounter pretty much the same thing when you try to read parans of a deleted actor or non existend, but... Now I think about it, that is probably the same error.

You know how many I see people asking about this, and I always tell them the thing I said above. I have seen this error in my games a lot, but always because I have done something like \ia[\v[4]] or something. (I don't know the shortcut for hitrate from the top of my head, the armor one would be a little different.) But I never saw this at the beginning of the game.

Oh man, how many times did I point people in the wrong direction? :o Because a character with no class, is way more common than people refering somewhere to an actor with a higher ID than max actors.
Caethyril Apr 8, 2021 @ 5:16am 
Originally posted by JohnDoeNews:
Oh man, how many times did I point people in the wrong direction? :o
Well, your original suggestion to delete the actor and remake them should fix it, unless they've removed all classes from the database. I wouldn't worry about it too much. ^-^

The database records (actors, classes, items, etc) typically have ID 0 = null. Any attempt to address something beyond the maximum (or below 0) will return null or undefined (e.g. if you're indexing $dataStuff directly). Either will cause this kind of error, since these "empty" values can't have custom properties.

In this case: expParams ("experience parameters") is a property of a $dataClasses entry and defines the experience curve for a class. It gets checked whenever the game wants to know what level an actor is, e.g. on game start. A class also provides the basic parameter values for an actor (MHP, MMP, ATK, etc).
JohnDoeNews Apr 8, 2021 @ 7:30am 
Oh, that is not the experience rate? Oops.

I guess I get this error then because, no actor, also means no class. :p

Anyhow... Hope it is solved for the OP. :p
PervySage Aug 9, 2022 @ 7:35pm 
You can't have a character without a class and if all classes are removed it will cause all characters that exist in the database to have expParams of null. You can't simply create a class and assign it to the characters. You will have create a class and then create the character again.
SnakekillerX Jul 7, 2023 @ 12:18am 
Damn, this was my exact problem too years later.
Somehow an actor's class was changed to "?".. I don't even know how that was possible as I didn't anything to do with that character in quite some time..

So thanks for the tip.
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Apr 6, 2021 @ 5:16pm
Posts: 9