Yanfly enemy base params crashing game

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,327
Reaction score
1,286
First Language
Finnish
Primarily Uses
RMMV
Everytime with a battle.

[ERROR 4/23/2018 03:53:44pm] TypeError: this.currentClass is not a function
at Game_Enemy.classBasedParameterValue (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/plugins/YEP_X_EnemyBaseParam.js:257:20)
at Game_Enemy.paramBase (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/plugins/YEP_X_EnemyBaseParam.js:236:22)
at Game_Enemy.Game_BattlerBase.param (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/plugins/YEP_BaseParamControl.js:660:19)
at Game_Enemy.Game_BattlerBase.param (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/plugins/Ramza_DualWield.js:602:47)
at Game_Enemy.get (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/rpg_objects.js:2135:42)
at Game_Enemy.Game_BattlerBase.recoverAll (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/rpg_objects.js:2623:20)
at Game_Enemy.Game_BattlerBase.recoverAll (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/plugins/YEP_BattleEngineCore.js:3570:44)
at Game_Enemy.Game_BattlerBase.recoverAll (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/plugins/YEP_X_StateCategories.js:237:44)
at Game_Enemy.Game_BattlerBase.recoverAll (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/plugins/YEP_X_LimitedSkillUses.js:744:44)
at Game_Enemy.setup (chrome-extension://kmcklefpbipcgojefbeoemppffjeofpm/www/js/rpg_objects.js:4311:10)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Are your plugins in the right order?
If you've added a plugin recently, are you starting a new game or resuming a previously-saved game?
Is it any battle, against any enemy, or only specific ones?
Do you need to set up enemy notes, and have you set them up correctly?

Got a link to the plugin in question?
 

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,327
Reaction score
1,286
First Language
Finnish
Primarily Uses
RMMV
Are your plugins in the right order?
If you've added a plugin recently, are you starting a new game or resuming a previously-saved game?
Is it any battle, against any enemy, or only specific ones?
Do you need to set up enemy notes, and have you set them up correctly?

Got a link to the plugin in question?
I haven't added or changed anything recently. It seems to happen on everyone with the base parameters now.

http://yanfly.moe/2017/05/31/yep-139-enemy-base-parameters-rpg-maker-mv/
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
It is trying to do something different because your enemy is > level 99
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
this says otherwise:

Code:
Game_Enemy.prototype.classBasedParameterValue = function(paramId) {
  var classId = this.enemy().classBasedParam[paramId];
  var cl = $dataClasses[classId];
  if (Imported.YEP_X_ClassBaseParam && cl.baseParamFormula[paramId] !== '') {
    var formula = cl.baseParamFormula[paramId];
    return this.customEnemyBaseParamFormula(formula, paramId);
  } else {
    if (this.level > 99) {
      var i = this.currentClass().params[paramId][99];  <<<<<<<<<<<<< this is the line causing the error
      var j = this.currentClass().params[paramId][98];
      i += (i - j) * (this.level - 99);
      return i;
    } else {
      return cl.params[paramId][this.level];
    }
  }
};
So that bit of code only gets run if either you don't have the YEP_X_ClassBaseParam or the class of your enemy doesn't have that parameter set up, AND the enemy level is > 99.

Unless you have a different version of the plugin and it's a different line causing the error.
 

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,327
Reaction score
1,286
First Language
Finnish
Primarily Uses
RMMV
this says otherwise:

Code:
Game_Enemy.prototype.classBasedParameterValue = function(paramId) {
  var classId = this.enemy().classBasedParam[paramId];
  var cl = $dataClasses[classId];
  if (Imported.YEP_X_ClassBaseParam && cl.baseParamFormula[paramId] !== '') {
    var formula = cl.baseParamFormula[paramId];
    return this.customEnemyBaseParamFormula(formula, paramId);
  } else {
    if (this.level > 99) {
      var i = this.currentClass().params[paramId][99];  <<<<<<<<<<<<< this is the line causing the error
      var j = this.currentClass().params[paramId][98];
      i += (i - j) * (this.level - 99);
      return i;
    } else {
      return cl.params[paramId][this.level];
    }
  }
};
So that bit of code only gets run if either you don't have the YEP_X_ClassBaseParam or the class of your enemy doesn't have that parameter set up, AND the enemy level is > 99.

Unless you have a different version of the plugin and it's a different line causing the error.

It's 1.01 and accoarding to the player they're lvl 55 only.
 

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,327
Reaction score
1,286
First Language
Finnish
Primarily Uses
RMMV
I don't use 1.61 since the core updates plugin by Yanfly causes game crashes and it's not very optimal on desktops without it.
 

Luckysince97

Veteran
Veteran
Joined
Feb 6, 2018
Messages
102
Reaction score
27
First Language
French
Primarily Uses
RMMZ
well even if u dont use 1.6.1. it migth be a good try to copy ure game check the plugin your having problem with in a copied version with an update version of the plugin see for your self if it still doing the same thing... what are u losing to try...!:p:thumbsup-left:
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
Do you also have an enemy levels plug-in. If so that might be raising your levels higher than you think or higher than it is displaying.
 
Last edited:

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,327
Reaction score
1,286
First Language
Finnish
Primarily Uses
RMMV
Do you also have an enemy levels plug-in. If so that might be raising your levels higher than you think or higher than it is displaying.
Yes, I have it but if the players are about 55 then the enemy is no way able to be 99?
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
Yes, I have it but if the players are about 55 then the enemy is no way able to be 99?
Well, it depends on how you set up the enemies in your project, only you can know that. As long as Shaz investigated the same version plugin that you have, her investigation must be accurate (because code doesn't lie).
It is up to you to recreate the situation that the player faced and determine what enemy level they were fighting, which is normal bug-finding procedure.

However, there could be other factors such as plugin order or incompatibilities.

For example, if you are using the Yanfly Difficulty Slider plugin, if the player sets it to 200% then the enemies would be 2x the level behind the scenes.
 

OpenTangent

Villager
Member
Joined
Mar 15, 2020
Messages
13
Reaction score
3
First Language
English
Primarily Uses
RMMV
"this.currentClass is not a function"
This seems to be a bug in YEP_X_EnemyBaseParam. As previous stated it only seems to occur when the enemy level is set higher than 99. The workaround is to set [Maximum level] and [Maximum cap] to 99 in the YEP_EnemyLevels plugin.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,018
Messages
1,018,357
Members
137,803
Latest member
andrewcole
Top