Is there a way to find out how many Augment slots an item has and be able to place that into a variable, or use it with a variable?
I have an event system that makes the player "punch" slots into their equipment to attach augments into them... It only works on the equipped item, but I'm ok with that. I'm coming to find out that there is a limitation built into how I designed the system. I have a variable that I can set and change that sets the maximum number of slots an item can have. As the player adds slots the number goes down until it's zero... This works great.
But this is where the limitation is. The system can only handle one item type at a time [1 weapon and 1 body and so on]. This is limiting to the player. I have thought of a way to fix this problem, but for the fix to work, I need to know how many augment slots are on the item at any given moment in the game.
How would I do that? I've tried looking through the plugin code, but I can't make heads or tails of it.
I appreciate any help you can provide.
EDIT: I think it has something to do with this code -
But I have no idea where to start with trying to use this. Is it this line?
I think if I can figure out how to get this line to work with a game variable I use in conditional branches and such I would be... Maybe.
There are several lines I can see that look promising, but I don't know how to use them.
EDIT2: I think I figured it out.... It took a little creative thinking and remembering what Robro told me about scripting, but I think I got it.
I took the code I was using to add the slots -
Modified it like so -
The initial test I did showed a promising result. I'll most likely be back if I run into any problems.
I have an event system that makes the player "punch" slots into their equipment to attach augments into them... It only works on the equipped item, but I'm ok with that. I'm coming to find out that there is a limitation built into how I designed the system. I have a variable that I can set and change that sets the maximum number of slots an item can have. As the player adds slots the number goes down until it's zero... This works great.
But this is where the limitation is. The system can only handle one item type at a time [1 weapon and 1 body and so on]. This is limiting to the player. I have thought of a way to fix this problem, but for the fix to work, I need to know how many augment slots are on the item at any given moment in the game.
How would I do that? I've tried looking through the plugin code, but I can't make heads or tails of it.
I appreciate any help you can provide.
EDIT: I think it has something to do with this code -
JavaScript:
ItemManager.checkAugmentSlots = function(item) {
if (DataManager.isItem(item)) return;
if (item.augmentSlots === undefined) {
var baseItem = DataManager.getBaseItem(item);
item.augmentSlots = JsonEx.makeDeepCopy(baseItem.augmentSlots);
}
item.augmentSlotEnable = item.augmentSlotEnable || [];
item.augmentSlotItems = item.augmentSlotItems || [];
var length = item.augmentSlots.length;
for (var i = 0; i < length; ++i) {
if (item.augmentSlotEnable[i] === undefined) {
item.augmentSlotEnable[i] = true;
}
if (item.augmentSlotItems[i] === undefined) {
item.augmentSlotItems[i] = 'none';
}
}
};
But I have no idea where to start with trying to use this. Is it this line?
JavaScript:
var length = item.augmentSlots.length;
I think if I can figure out how to get this line to work with a game variable I use in conditional branches and such I would be... Maybe.
There are several lines I can see that look promising, but I don't know how to use them.
EDIT2: I think I figured it out.... It took a little creative thinking and remembering what Robro told me about scripting, but I think I got it.
I took the code I was using to add the slots -
Code:
$gameActors.actor(1).equips()[0].augmentSlots.push("Armament");
Modified it like so -
Code:
◆Script:$gameActors.actor(1).equips()[0].augmentSlots.length;
The initial test I did showed a promising result. I'll most likely be back if I run into any problems.