Need help with YEP WeaponUnleash and DamageCore

Hey gamers,
I have run into an error when play testing one of my projects. Now, while doing a battle from the database, the problem does not happen. It only happens when playing the game.

When going into a battle, as soon as it starts, I am met with require(...).Window.get(...).isDevToolOpen

I will provide screenies below of what I have.

error1.PNG


Here is the skill in question. I used WeaponUnleash to replace the weapons attack with skill 85 - Thump 8
error2.PNG


Any and all help would be most appreciative. If I have not provided enough information, please let me know so I can clear it up ^_^
Plugin list and order would be nice. The problem is not in the notetag from what it looks like.
You cannot use "a" and "b" in Damage Core. It should be "user" and "target" respectively. And somehow I have never successfully used "randomInt" in MV, as it always shows an error :blink:
I think you should make some changes for your note tag.
Code:
<damage formula>
if (target.def <= (Math.floor(Math.random() * 20) + 1 + user.atk)){
value = Math.floor(Math.random() * 8) + 1 + user.atk;}
else{
value = 0;}
</damage formula>
Hope it works ☺️
Thanks for the quick replies ^_^!

Plugin list and order would be nice. The problem is not in the notetag from what it looks like.
No problem. The only ones not showing are SRD_SuperToolsEngine and SRD_HUDMaker which are at the very top.
MT Plugin ORder.PNG


You cannot use "a" and "b" in Damage Core. It should be "user" and "target" respectively. And somehow I have never successfully used "randomInt" in MV, as it always shows an error :blink:
I think you should make some changes for your note tag.
Code:
<damage formula>
if (target.def <= (Math.floor(Math.random() * 20) + 1 + user.atk)){
value = Math.floor(Math.random() * 8) + 1 + user.atk;}
else{
value = 0;}
</damage formula>
Hope it works ☺️

I tried this and I am still getting the same error. Thank you for the suggestion though. I thought a and b could be used. Didn't know you had to use target and user.
The "isDevTools is not a function" error can be solved by updating your plugins - more information here:
http://yanfly.moe/2018/08/27/lots-of-plugin-updates/

You cannot use "a" and "b" in Damage Core.

No, you can use "a" and "b" in the damage formula. Here is the function from YEP_DamageCore, using "a" and "b" is exactly the same as "user" and "target".

Spoiler
Code:
Game_Action.prototype.evalDamageFormula = function(target) {
  try {
    var item = this.item();
    var a = this.subject();
    var b = target;
    var user = this.subject();
    var subject = this.subject();
    var s = $gameSwitches._data;
    var v = $gameVariables._data;
    var sign = ([3, 4].contains(item.damage.type) ? -1 : 1);
    var value = 0;
    if (item.damage.custom) {
      eval(item.damage.formula);
      value = Math.max(value, 0) * sign;
    } else {
      value = Math.max(eval(item.damage.formula), 0) * sign;
    }
    return value;
  } catch (e) {
    if (item.damage.custom) {
      Yanfly.Util.displayError(e, item.damage.custom, 'DAMAGE FORMULA ERROR');
    } else {
      Yanfly.Util.displayError(e, item.damage.formula, 'DAMAGE FORMULA ERROR');
    }
    return 0;
  }
};

Your issue(s) is(are) in a notetag formula, but not the one that you showed.

1.) The error message that says "TypeError: Cannot read property 'hp' of undefined"
The notetag you showed doesn't say 'hp' anywhere, so the issue must be in a different formula.
2.) The error message that says "ReferenceError: If is not defined"
Javascript is case-sensitive, you've used "If" which it interprets to be a variable rather than "if" which is used for if-statements. The damage formula you showed doesn't have "If", so the issue is coming from a different formula
Your issue(s) is(are) in a notetag formula, but not the one that you showed.

1.) The error message that says "TypeError: Cannot read property 'hp' of undefined"
The notetag you showed doesn't say 'hp' anywhere, so the issue must be in a different formula.
2.) The error message that says "ReferenceError: If is not defined"
Javascript is case-sensitive, you've used "If" which it interprets to be a variable rather than "if" which is used for if-statements. The damage formula you showed doesn't have "If", so the issue is coming from a different formula

Thanks @Aloe Guvner ! I went through some of my other skills and have noticed that I have indeed used 'If' instead of 'if' with a few of the formulas. I just found it weird that it would even display the error even when a character does not even have the skill yet.

I will do some more testing and report back if there are no more issues.
I just found it weird that it would even display the error even when a character does not even have the skill yet.

Yeah, it's a bit weird, but it just depends on how the plugin author set it up. It would be nice if the error message said which skill had an error so you could try to narrow it down more easily.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-yep-weaponunleash-and-damagecore.103524/