MZ How do I create more parameters for equipment in MZ? (Solved)

How do I create more parameters for things such as items, weapons, and armor in MZ? I was able to easily do this in VX, but I can't figure out how to do this in MZ or MV.

Below is an example of some code that I would use in VX to get the extra parameters.

Code:
module RPG
  class BaseItem

     def fire_damage
      self.note.each_line { |line|
      return line.gsub('FireDamage = ', '').to_i if line.include?('FireDamage = ')
      }
      return 0
     end

    end
end
MV and MZ have something called "meta" for note tags. It doesn't really handle advanced note tags well (such as multi-line note tags), but for what you are using it for it's probably the easiest way to do it.

In the note tag you will do <firedamage:10> and then in javascript to access that value you will do:
JavaScript:
Number(object.meta.firedamage);
where object would be the item, armor, weapon, etc.
MV and MZ have something called "meta" for note tags. It doesn't really handle advanced note tags well (such as multi-line note tags), but for what you are using it for it's probably the easiest way to do it.

In the note tag you will do <firedamage:10> and then in javascript to access that value you will do:
JavaScript:
Number(object.meta.firedamage);
where object would be the item, armor, weapon, etc.

Thanks, @casper667 . Is there also a way to properly change the number in the note tag during the game? I'm also trying to make one for durability where when you use a weapon or get hit weapons and armor will have a chance to lose some durability.
Hm...
Maybe you can use a game variable there.
But every time you get the note tag value, you have to evaluate it.

<firedamage:$gameVariable.value(1)>

JavaScript:
eval(object.meta.firedamage);
The good thing is that you can use arrays(since you will be using eval...

It's not the best solution, but without a plugin, that is one of them.
I tested out the fire damage note, but it seems to be sending back a NaN error. If I change value += to 1000, it will add 1000 to all parameters, but it doesn't seem to recognize the 1000 in the weapon's notetag, <firedamage:1000>. Below is what I did code wise.

Code:
Game_Actor.prototype.paramPlus = function(paramId) {
    let value = Game_Battler.prototype.paramPlus.call(this, paramId);
    for (const item of this.equips()) {
        if (item) {
            value += item.params[paramId];
            value += Number(item.meta.firedamage);
        }
    }
    return value;
};
I tested out the fire damage note, but it seems to be sending back a NaN error. If I change value += to 1000, it will add 1000 to all parameters, but it doesn't seem to recognize the 1000 in the weapon's notetag, <firedamage:1000>. Below is what I did code wise.

Code:
Game_Actor.prototype.paramPlus = function(paramId) {
    let value = Game_Battler.prototype.paramPlus.call(this, paramId);
    for (const item of this.equips()) {
        if (item) {
            value += item.params[paramId];
            value += Number(item.meta.firedamage);
        }
    }
    return value;
};

I tried your code and I get a NaN message when the code reaches the armor that doesn't have your tag.
Here's a screenshot of the console log. I gave the sword a <firedamage:10> tag and added the value to the swords +12 atk stat.
I tried your code and I get a NaN message when the code reaches the armor that doesn't have your tag.
Here's a screenshot of the console log. I gave the sword a <firedamage:10> tag and added the value to the swords +12 atk stat.


My bad, lol! I didn't even think about the items that don't have the note tag. Thanks for pointing this out. I just tested it again and removed all of the armor, and everything is working great. I'll just have to place a condition so that it only works with items that have the note tag.

Anyways, thanks a lot for the help guys.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-create-more-parameters-for-equipment-in-mz-solved.126360/