Is the .changeEquip function supposed to operate independently of inventory?
I am using the following code in my plugin and I noticed that every time it runs, I receive an additional copy of the item in the slot specified.
I had thought .changeEquip was dependent on inventory and that .forceChangeEquip was the function that operated independently of inventory.
Am I misunderstanding something, or is this not supposed to happen? The three weapons with the qty of x44 start out at 10 each, but when running the script they just keep adding up. Any thoughts?
Is it adding the items to my inventory because they are attached to a variable perhaps? Or is this just how changeEquip functions. I notice when I use forceChangeEquip instead, the stock doesn't increase when there is no item to remove, but neither does it when actual items are removed. :|
From what I am seeing, I am going to have to put every changeEquip function inside an if statement for if the item is present and the else if with forceChangeEquip being for when the item isn't present.
Or perhaps an extra if statement so that changeEquip only runs if there is an item to be exchanged with (as well as an item currently equipped?)
Please correct me if I am mistaken or doing something incorrectly/inefficiently.
I am using the following code in my plugin and I noticed that every time it runs, I receive an additional copy of the item in the slot specified.
Code:
if (this.equips()[0])
{ $gameVariables.setValue(81, this.equips()[0].id);
this.changeEquip(0, $dataWeapons[0]);
}
I had thought .changeEquip was dependent on inventory and that .forceChangeEquip was the function that operated independently of inventory.
Am I misunderstanding something, or is this not supposed to happen? The three weapons with the qty of x44 start out at 10 each, but when running the script they just keep adding up. Any thoughts?
Is it adding the items to my inventory because they are attached to a variable perhaps? Or is this just how changeEquip functions. I notice when I use forceChangeEquip instead, the stock doesn't increase when there is no item to remove, but neither does it when actual items are removed. :|
From what I am seeing, I am going to have to put every changeEquip function inside an if statement for if the item is present and the else if with forceChangeEquip being for when the item isn't present.
Or perhaps an extra if statement so that changeEquip only runs if there is an item to be exchanged with (as well as an item currently equipped?)
Please correct me if I am mistaken or doing something incorrectly/inefficiently.