Im pretty new to RPGMaker so bear with me. Im trying to make a character that uses items to use their skills. Im trying to use the notetags.
Like So
The items exist as follows
When I try to use the notetag, they work fine, but once they use the ability, this happens.
Here is the stacktrace
Ive tried figuring out what the issue is, but im not great with javascript.
I found this for the paying skill cost, where item does not seem to be defined, but im unsure how to fix it. Any help would be greatly appreciated.
Code:
<Item Cost: 1 Item>
Like So
Code:
<Item Cost: 1 Mandrake>
<Item Cost: 1 Sage>
The items exist as follows
When I try to use the notetag, they work fine, but once they use the ability, this happens.
Here is the stacktrace
Code:
at Game_Actor.eval (eval at VisuMZ.<computed> (VisuMZ_1_SkillsStatesCore.js:1), <anonymous>:12:20)
at Game_Actor.Game_BattlerBase.<computed>.<computed> (VisuMZ_1_SkillsStatesCore.js:3081)
at Game_Actor.Game_BattlerBase.<computed>.<computed> [as paySkillCost] (VisuMZ_3_LimitedSkillUses.js:552)
at Game_Actor.Game_Battler.useItem (rmmz_objects.js:3820)
at Function.BattleManager.startAction (rmmz_managers.js:2746)
at Function.BattleManager.<computed> [as startAction] (VisuMZ_1_BattleCore.js:19990)
at Function.BattleManager.<computed> [as processTurnCTB] (VisuMZ_2_BattleSystemCTB.js:1690)
at Function.BattleManager.<computed> [as processTurn] (VisuMZ_2_BattleSystemCTB.js:1690)
at Function.BattleManager.updateTurn (rmmz_managers.js:2616)
at Function.BattleManager.<computed> [as updateTurnCTB] (VisuMZ_2_BattleSystemCTB.js:1690)
Ive tried figuring out what the issue is, but im not great with javascript.
I found this for the paying skill cost, where item does not seem to be defined, but im unsure how to fix it. Any help would be greatly appreciated.
Code:
// Declare Variables
const user = this;
const skill = arguments[0];
const cost = arguments[1];
// Process Payment
{ // Check Item Costs
for (let id in cost.items) {
const obj = $dataItems[id];
if (obj && item.consumable) {
if (item.itypeId !== 2) {
const costAmount = cost.items[id];
$gameParty.loseItem(obj, costAmount);
}
}
}
}
{ // Check Weapon Costs
for (let id in cost.weapons) {
const obj = $dataWeapons[id];
if (obj) {
const costAmount = cost.weapons[id];
$gameParty.loseItem(obj, costAmount);
}
}
}
{ // Check Armor Costs
for (let id in cost.armors) {
const obj = $dataArmors[id];
if (obj) {
const costAmount = cost.armors[id];
$gameParty.loseItem(obj, costAmount);
}
}
}