Item Core Independent item Bug?

Hello!
Is anyone have a fix for this? Or is it intended?

Thanks!
depends on the exact bug? are those seperate potions with the same name?
or does it stack? etc.

are your plugin in the correct order (if you use alot of YEP_ (yanfly) than make sure its
in the correct order to work properly.

if you use others as well, try shifting or turn them off and see if it is working correctly.
It's the same Potion item, with 'Independent item' set to ON from the plugin.

I have tried to turn off every other plugin except the CoreEngine, and the problem still persists. Guess it's a bug then. (more info: it works with shop event, but not with 'Change Item...' event and item drop from the enemy)
have you started a new playtest every time you turned off another plugin?
because most plugins store their data inside the savefiles, and loading an old save can bring back that plugins problems.
Yup, just tried to start the new playtest with 'New Game' and the problem still occurs.
then please give a screenshot of your plugin manager, and please tell us what exactly on the inventory screenshot you consider an error - there are several possibilities there, and at least one of them is an intentional feature from what I remember.
Alright. This is it, the plugin manager.
What I consider error: the new item should not be added beyond the inventory limit. In the screenshot, you can see that it goes to 8/3 from the intended limit 3/3.
we need the full list of the plugin database. to see if other plugin canconflict the independent items.
After a quick inspection of yanfly ItemCore code, it seems that the parameters Max Items, Max Weapons and Max Armors are only used in two functions. One draw the carried amount in windows and the other disable item in shop. This looks consistent with what you said.

Thus, even if it looks weird, it is not a bug but intentional.

if you want to trash all items that the player will receive in excess, you can use the code below, place it in a new plugin below ItemCore.
I've also fixed the issue it generates with the battle rewards display with this script, but it is possible that it will not work if you are using a custom victory reward info.

Then, I can't promise that this script will fix all of your expectations. You better have to learn a bit of JS if you want to hack yanfly plugins.


JavaScript:
var Imported = Imported || {};
var Yanfly = Yanfly || {};

if (Imported.YEP_ItemCore){

Game_Party_gainIndependentItem = Game_Party.prototype.gainIndependentItem;
Game_Party.prototype.gainIndependentItem = function(item, amount, includeEquip) {
  var max = this.getIndependentItemTypeMax(item);
  var cur = this.getIndependentItemTypeCur(item);
  if (max - cur < amount) amount = max - cur;
  Game_Party_gainIndependentItem.call(this,item,amount,includeEquip)
};

BattleManager_displayDropItems = BattleManager.displayDropItems;
BattleManager.displayDropItems = function() {

  maxItem = Yanfly.Param.ItemMaxItems;
  maxWeapon = Yanfly.Param.ItemMaxWeapons;
  maxArmor = Yanfly.Param.ItemMaxArmors;
  var items = this._rewards.items;

  cured_items = [];
  for (var i=0; i<items.length; i++){
    var curItem = items[i];
    if ( DataManager.isIndependent(curItem) ){
      var cur = $gameParty.getIndependentItemTypeCur(curItem);
      if ( DataManager.isItem(curItem) && maxItem > cur) {
        cured_items.push(curItem);
        maxItem -= 1;
      } else if ( DataManager.isWeapon(curItem) && maxWeapon > cur ){
        cured_items.push(curItem);
        maxWeapon -= 1;
      } else if (DataManager.isArmor(curItem) && maxArmor > cur){
        cured_items.push(curItem);
        maxArmor -= 1;
      };
    };
  };
  this._rewards.items = cured_items;
  BattleManager_displayDropItems.call(this);

};

}
That is what I had in mind when I wrote about the intentional feature above, the item core does not delete given items simply because there is a risk of such a thing breaking the game (if you needed all versions of an item you could find to get through the game) and because it would have been destroying rewards that the player expects after solving quests etc.
After reading and giving it some thoughts...

One way is to delete any excess amount.

The other possibility, now I see that it will be bad if the new item is gone forever without confirmation/prompt to choose which item to bring forward. This is not a bug then, my bad. Thank you all!

Original thread: https://forums.rpgmakerweb.com/threads/item-core-independent-item-bug.121356/