How do I resolve 'TypeError: Cannot read property 'expParams' of undefined'

quackgyver

I make retro games for astrojone.com
Veteran
Joined
Jul 16, 2013
Messages
117
Reaction score
26
First Language
English
Primarily Uses
RMMV
When I try to playtest my game, I immediately get the error message "'TypeError: Cannot read property 'expParams' of undefined' ".

The console gives me the following:
rmmz_managers.js:2030 TypeError: Cannot read property 'expParams' of null at Game_Actor.expForLevel (rmmz_objects.js:4151) at Game_Actor.currentLevelExp (rmmz_objects.js:4171) at Game_Actor.initExp (rmmz_objects.js:4163) at Game_Actor.setup (rmmz_objects.js:4066) at Game_Actor.initialize (rmmz_objects.js:4033) at new Game_Actor (rmmz_objects.js:4018) at Game_Actors.actor (rmmz_objects.js:5224) at Game_Party.setupStartingMembers (rmmz_objects.js:5495) at Function.DataManager.setupNewGame (rmmz_managers.js:256) at Scene_Boot.startNormalGame (rmmz_scenes.js:339) SceneManager.catchNormalError @ rmmz_managers.js:2030

How can I resolve this problem?

Thanks in advance.
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
163
Reaction score
145
First Language
English
Primarily Uses
RMMV
Did you by chance delete all of the Actors, or do you still have at least one set up in System -> Actors?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,357
Reaction score
8,771
First Language
German
Primarily Uses
RMMV
basically any "of undefined" means that the system has a reference to something that no longer exists, usually because you deleted it (less likely because a plugin points to a wrong configuration).

in the case of "expParams" that usually is either an actor or a class - for example if you deletze classes and have an actor that still uses one of the deleted classes, or delete an actor that is still referenced in the game or something like that.
 

quackgyver

I make retro games for astrojone.com
Veteran
Joined
Jul 16, 2013
Messages
117
Reaction score
26
First Language
English
Primarily Uses
RMMV
Did you by chance delete all of the Actors, or do you still have at least one set up in System -> Actors?
I have one actor set up:
Screen Shot 2021-07-27 at 21.37.59.png
Screen Shot 2021-07-27 at 21.38.47.png
basically any "of undefined" means that the system has a reference to something that no longer exists, usually because you deleted it (less likely because a plugin points to a wrong configuration).

in the case of "expParams" that usually is either an actor or a class - for example if you deletze classes and have an actor that still uses one of the deleted classes, or delete an actor that is still referenced in the game or something like that.
I can't really find any references to nonexistent Database entries though.

The Classes-section looks fine:
Screen Shot 2021-07-27 at 21.40.21.png
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,357
Reaction score
8,771
First Language
German
Primarily Uses
RMMV
in the system 1 tab of the database, when you click below the actor "test", how many lines can you click on and mark, and how many lines don't get marked when clicked?
 

quackgyver

I make retro games for astrojone.com
Veteran
Joined
Jul 16, 2013
Messages
117
Reaction score
26
First Language
English
Primarily Uses
RMMV
in the system 1 tab of the database, when you click below the actor "test", how many lines can you click on and mark, and how many lines don't get marked when clicked?
I have only one actor in the Starting Party-box, and only one line is selectable in addition to that:

Screen Shot 2021-07-27 at 23.14.27.png

This is normal however, since double-clicking on the empty line below your actor is how you add additional actors.

No lines beyond these ones are clickable.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,357
Reaction score
8,771
First Language
German
Primarily Uses
RMMV
No lines beyond these ones are clickable.
yes, that is correct - but originally there were four actors, and if you delete the actor in the actor tab before removing them here, those three more actors become invisible references that can be clicked.
and that was my first idea as to where the reference that is causing the error came from.

still the error trace says that the engine cannot load the experience formula for an actor.
the experience settings are in the class of the actor.
so one part of the following sequence is somehow missing:

- experience data for a class
- class data for an actor
- actor data

The only thing you can do now is recreate that data until the error goes away.
then you'll know which part is missing and can continue looking for the reference
1) create actor 2-4, name them a,b,c and test.
error goes away? check starting party and anything that might use an actor.
error still there? create classes 2-4 and assign them to the new actors, test.
error still there? check the experience curves for all classes and anything that references them.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,526
Reaction score
1,569
First Language
Spanish
Primarily Uses
RMVXA
"Cannot read property expParams of null"

......and, who is this 'null'?
that should be your first question.

find the line calling to expParams, and IT should be tied to another expression that'd usually return an actor.
in this case, I guess, game_party[something].
if you have only one actor, and the code calls for game_party[something-greater-than-1], then game_party[inexistent-slot] is returning null.
and there's your culprit.

that's *debugging*: identify, retrace, and repair.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,192
Reaction score
15,545
First Language
English
Primarily Uses
RMMV
Put names in your first 8 actor slots, then check the System tab again. If you see any that you don't want there, delete them from the system tab first.

At what point does this happen? When you first launch the game? When you choose New Game or Continue? When you enter a battle? When you open the menu?
 

Latest Threads

Latest Posts

Latest Profile Posts

Just for the record you CAN use the "Exclude unused files" successfully to trim a project down seriously even if you're doing calls to various assets via plugins and such. BUT you need to do a full playtest of pretty much every option to ensure you did get every one of those other assets added in. Then I dumped the assets into a fresh copy of the project and yay it was like 400 Meg......
party time.png
If you've played Knight Shift Chapter 1 this image'll mean something to you. If not, that's also fine!
Here's a medical question for ya: Why do I start lightly coughing after I drink coffee?
Well, someone "reviewed" my game. Didn't credit me anywhere in the video and spent 2 minutes insulting it. Going to ignore that and move on.
To cut down on map lag, I've been researching how to implement a lighting layer as a single map overlay instead of a bunch of individual lights. Hopefully I'll have a screenshot soon!

Forum statistics

Threads
117,266
Messages
1,105,962
Members
153,441
Latest member
19TaTo94
Top