So, I'm trying to set the item count of all items into an array. Unfortunately, there tend to be tons of different items, so I created an array in a variable to store the item counts in.
Now, I realize you can do this by setting a different variable to a different item's count and then adding the variable's value to the array. However, halfway through I realized this process would be long and painful, so I tried creating a different way to set the values.
The latest iteration of code I've gotten is:
var itemDummy = 7;
var itemCount;
$gameVariables.setValue(11, []);
while (itemDummy < 15) {
itemCount = $gameParty.numItems(itemDummy, false);
$gameVariables.value(11).push(itemCount);
itemDummy++;
}
This, like all my other attempts, only results in the array being created but without any values being set, despite my having items. I suspect it's the itemCount code that's the problem, but I don't know what else to do. Can anyone help?
Now, I realize you can do this by setting a different variable to a different item's count and then adding the variable's value to the array. However, halfway through I realized this process would be long and painful, so I tried creating a different way to set the values.
The latest iteration of code I've gotten is:
var itemDummy = 7;
var itemCount;
$gameVariables.setValue(11, []);
while (itemDummy < 15) {
itemCount = $gameParty.numItems(itemDummy, false);
$gameVariables.value(11).push(itemCount);
itemDummy++;
}
This, like all my other attempts, only results in the array being created but without any values being set, despite my having items. I suspect it's the itemCount code that's the problem, but I don't know what else to do. Can anyone help?