Currently, I am experimenting with JS notetags and I try to figure out which one I need to do the thing I want to do. I have an item which has no effects directly in the RPG maker engine, but is supposed to have effects inside a JS notetag, so I have full control over what's happening.
Trust me, it's supposed to be that way.
Now, this code is supposed to be inherited by other items using the Database Inheritance VisuStella MZ plugin. That way, I can keep the code for all items of that kind the same, which reduces maintenance. The problem is now that, no matter what I do, simply nothing happens, and I have no idea why. The only thing i can imagine is that the code gets never called in the first place.
So my question is:
- What is the correct note tag I need to use to make the effects actually happening?
P.S: yes, it's a bit more circuitous than probably needed, but I want it that way to reduce inconsistency in the long term and reduce time-wasting maintenance which would occur by copying the code over and over again. If I need to change the base mechanics, then I need to remake it for every item, which I want to make obsolete.
Code:
<JS Post-Apply>
console.log($dataItems[this.itemId()].meta.TpCost);
target.gainTp((parseInt($dataItems[this.itemId()].meta.TpCost)) * -1);
target.gainMp(parseInt($dataItems[this.itemId()].meta.MpRegen));
target.gainHp(parseInt($dataItems[this.itemId()].meta.HpRegen));
target.gainExp(parseInt($dataItems[this.itemId()].meta.ExpGain));
</JS Post-Apply>
Now, this code is supposed to be inherited by other items using the Database Inheritance VisuStella MZ plugin. That way, I can keep the code for all items of that kind the same, which reduces maintenance. The problem is now that, no matter what I do, simply nothing happens, and I have no idea why. The only thing i can imagine is that the code gets never called in the first place.
So my question is:
- What is the correct note tag I need to use to make the effects actually happening?
P.S: yes, it's a bit more circuitous than probably needed, but I want it that way to reduce inconsistency in the long term and reduce time-wasting maintenance which would occur by copying the code over and over again. If I need to change the base mechanics, then I need to remake it for every item, which I want to make obsolete.