MV Yanfly Item Upgrade; display number of upgrade slots once increased from 0

So I'm using Yanfly's Item Upgrade Slots to create "Enchantments", and Attachable Augments to create "Orbs" which increase the number of available Enchantment slots of weapons and armors. Every weapon and armor piece starts with 0 Enchantment slots, and you have to find an Orb to attach that will give you the slots. I have it mostly working, the only issue is that when I attach the orbs, the number of available enchantment slots does not change. It only changes it if the weapon or armor already has at least 1 slot.

This is the code for the Alpha Orb;
Code:
<Augment Attach Eval: Orb>
   item.upgradeSlots += 1;
   item.originalUpgradeSlots = item.originalUpgradeSlots || DataManager.getBaseItem(item).upgradeSlots;
   item.originalUpgradeSlots++;
</Augment Attach Eval: Orb>

<Augment Attach: Orb>
   Price: +750
   Cannot Detach
</Augment Attach: Orb>
Is there another line of code I can put in that will make the number of available enchantment slots appear on an item that originally didn't have any?

Edit: Oh wait, I think I might not have explained my issue properly... as it is, the Alpha Orb does increase the number of available Enchantment slots, and as long as the item already had at least 1 slot to start with, the Enchantment Slot counter will increase. However, items that do not have any Enchantment slots will not display the Enchantment Slot counter at all, therefor the counter won't increase.
I think it might be because of how you're manipulating the originalUpgradeSlots property.

Instead of doing that, try just item.originalUpgradeSlots = item.upgradeSlots;
I think it might be because of how you're manipulating the originalUpgradeSlots property.

Instead of doing that, try just item.originalUpgradeSlots = item.upgradeSlots;
which line of code am I replacing with this?
The lines that manipulate originalUpgradeSlots.
The lines that manipulate originalUpgradeSlots.
So like this?
Code:
<Augment Attach Eval: Orb>
   item.upgradeSlots += 1;
   item.originalUpgradeSlots = item.upgradeSlots;
</Augment Attach Eval: Orb>
because that didn't work.
Then I don't know. Have you tried putting some console logs in there to display the values for your troubleshooting?

Someone else might have a better idea.
The code above works, but the code doesn't draw the menu IF the original item doesn't have slots.

I attached a possible fix.
Drop this plugin right under the original Upgrade slots one and it SHOULD work as intended.

Note: I don't think you need the originalUpgradeSlotslines in your code.
Let me know if this helps.

Good luck.
Note: I don't think you need the originalUpgradeSlotslines in your code.
In drawSlotsInfo(), it looks to me like originalUpgradeSlots is what's used to see how many slots the item has.

If you don't update that, it will show the base item's number of slots (e.g. 0).

1711932443931.png
Good point.

Looks like I'll have to make lots of edits to that snippet.
🙂

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-item-upgrade-display-number-of-upgrade-slots-once-increased-from-0.167285/