YEP_X_ItemUpgradeSlots bug?

Sorry for my bad English before.

I want to make a game that can upgrade your weapon using YEP_X_ItemUpgradeSlots.
The upgrade add prefix 'Silver', reset all STATS and SLOTS, and give +1 slot. Upgrade effect look like these in the Notebox:
1576834041998.png

and I have these error:
1576834176125.png


I don't know whether its my fault or the plugin its self.
I don't have those plugins, but 'cannot read property ... of undefined' means there's a null value somewhere - something that it expects is text, but is empty. I'm thinking toLocaleString might have something to do with your computer's language, but that's only a guess.
Hi, there's no such command line as 'reset SLOTS', that's why its crash.
Beside, the 'slots: x' command doesn't change the number of slots on the item, but rather the upgrade slots consuption. Meaning that putting 'slots: 0' or 'slots: 1' won't do anything, but if you put 'slots: 2', this item will take 2 slots when upgrading an equipment.

Hope that helped.
Plugin link: http://www.yanfly.moe/wiki/Item_Upgrade_Slots_(YEP)

The line of code it's erroring on seems to be this:
JavaScript:
text = Yanfly.Util.toGroup(item.upgradeSlots);
Apparently the item does not have an upgradeSlots value. I'm not sure why or how that could be the case, though. Some ideas:
  • When testing, do you choose New Game on the title screen? If you continue from a previous save after having made plugin changes, that can cause a lot of interesting errors! 👋

  • Screenshot(s) of your Plugin Manager, showing all the plugins active in your project, might help. Yanfly's plugins have a recommended order. You can click+drag to rearrange plugins in the Plugin Manager, just remember to save your project afterwards so the changes are seen during test.

  • Does the error occur with all upgrade items, or just this one? If you try to apply the upgrade to a different item, does that work? 🙂

  • From the video on the plugin page it seems the <Upgrade Effect> tag should be placed on items. It's not clear from your cropped screenshot which notebox that is, though. It might help if you screenshot both noteboxes: the upgrade item and a target weapon?
Hi, there's no such command line as 'reset SLOTS', that's why its crash.
Actually, there is. 😅 From the plugin documentation (see page linked above):
Reset Stat - Resets 'Stat' back to base stat values. *Note1
...
Note1: 'Stat' is to be replaced by 'MaxHP', 'MaxMP', 'ATK', 'DEF', 'MAT',
'MDF', 'AGI', 'LUK', 'SLOTS', 'ALL' or 'CURRENT'. 'ALL' affects all stats.
'CURRENT' affects only non-zero stats. This effect will also increase the
boost count (+x) by 1 and update the item's name.
Your'e right @caethyril! I did checked too fast.
It is because I've test the notetag above and reproduced the same crash and resolved it by removing the 'reset SLOTS' command... I gave a quick look in the plugin files, didn't see it so I assumed it was the faulty line.

EDIT: I ran a few test and the problem seems to come from the Slots variance as reseting the slots refer to the baseItem.originalUpgradesSlots which is undefined if a variance has been applyed upon item initialization. Set the variance to 0 in the plugin parameter and 'reset slots' will work fine.
Thanks for replying.

  • When testing, do you choose New Game on the title screen? If you continue from a previous save after having made plugin changes, that can cause a lot of interesting errors! 👋
I always choose 'newgame' when testing my game.

  • Screenshot(s) of your Plugin Manager, showing all the plugins active in your project, might help. Yanfly's plugins have a recommended order. You can click+drag to rearrange plugins in the Plugin Manager, just remember to save your project afterwards so the changes are seen during test.
1577063785404.png


  • Does the error occur with all upgrade items, or just this one? If you try to apply the upgrade to a different item, does that work? 🙂
I had tried on several item, and it doesn't work at all.

  • From the video on the plugin page it seems the <Upgrade Effect> tag should be placed on items. It's not clear from your cropped screenshot which notebox that is, though. It might help if you screenshot both noteboxes: the upgrade item and a target weapon?
1577064005304.png

1577064114935.png


I ran a few test and the problem seems to come from the Slots variance as reseting the slots refer to the baseItem.originalUpgradesSlots which is undefined if a variance has been applyed upon item initialization. Set the variance to 0 in the plugin parameter and 'reset slots' will work fine.
That's same way if you use Reset FULL and i don't want to use it. I just want to reset slotted upgrades.

EDIT: If there no other way in these case, I use Reset FULL and change several gameplay mechanics.
Can you please elaborate on what you're trying to do?
Exemple: if you have a weapon with 3/3 slots and you put that upgrading item on it, what is the final result you're expecting? A 'silver' weapon with 4/4 slots?
Theres 'Material' upgrade and 'Mod' upgrade for weapon and armor.
'Material' upgrade: reset slotted mod, change prefix and add slot.
'Mod' upgrade: upgrade stats (slots excluded)
ok, and what are your plugin settings: 'Default slots' and 'slots variances'?
Default slots is 3 and slot variance is 2. So, a weapon can have 1 up to 5 slots.
1577115117265.png
Hello again!
As I said previously, this won't work with slots variances without modifying some script lines in the plugin file... So you can either remove the variance or use this in the notetage instead:
Code:
<Upgrade Effect>
  Eval: item.upgradeSlots = item.originalUpgradeSlots;
</Upgrade Effect>
This line will bring back the slots to their original value (including variance).
Thanks in advance. I will try it soon.
Hello again!
As I said previously, this won't work with slots variances without modifying some script lines in the plugin file... So you can either remove the variance or use this in the notetage instead:
Code:
<Upgrade Effect>
  Eval: item.upgradeSlots = item.originalUpgradeSlots;
</Upgrade Effect>
This line will bring back the slots to their original value (including variance).
It's working.
I'm trying same thing by modifying some script lines in the plugin file, but you made it more simple by using notetag. While doing that, I gave up on add more slots because it can be too complicated in the future. Just reset slotted upgrade is fine.

Many thanks to @TSR , @caethyril and @Shaz for replying.
This may out of the topics.
Can I predefined Prefix or Suffix using YEP_x_ItemUpgradeSlots plugin on dropped weapon/armor?

For example:
Weapon=Sword
Prefix=Mighty
Suffix=Steel
Result ---> Mighty Steel Sword

Original thread: https://forums.rpgmakerweb.com/threads/yep_x_itemupgradeslots-bug.116445/