[Help - Again(sorry)] YEP_ItemCore Compatability

Alright so I've run into one final snag. When equipping an item, YEP_ItemCore seems to grab the latest in the IDs (screenshots to follow), however I want to be able to grab the ID of the item selected in the window. Example:
Actor gets 2 swords, IDs assigned: 3001 and 3002 (they show up as 1/100 and 2/100 in the Weapons window or Equip window respectively).

I want to equip the 1st sword (3001), but when I do, the sword(ID 3002) is passed along instead... how do I fix this?

Link: (YEP_ItemCore)

EDIT(12:02p): Alright I've narrowed it down to the Window_ItemList's drawItemCarryNumber() function in YEP_ItemCore. It's how it assigns its groups or something. It seems to get the latest items created first (3003, 3002, 3001) and assigns them to the index of that item (+1). LINES 1407-1413 of YEP_ItemCore, to follow along.

-- Order of Item Assignment --
Spoiler
lnDzUXz.png

So I see 1 of 2 ways of doing this... 1) somehow save/change the load order of items (not sure where to do that), or 2) change the index to 3000 - ItemID... that should do it. Will brb with test.

EDIT2: Well changing index to ItemID - 3000 sort of worked.. but the items loaded are still backwards lol - Screenshot:
Spoiler
ZnpBNC0.png



Screenshots:
Spoiler
zdoLIiJ.png


3h4SCB8.png


1va3aX5.png
your problem starts higher - please read the output more carefully, it starts with "Invalid ID (NaN)", so all outputs after that error are not to be trusted anyway.

can you give us a screenshot of your plugin manager? In most cases when yanfly's plugins have problems, that is either plugins in wrong order or incompatibility between two or more plugins.
your problem starts higher - please read the output more carefully, it starts with "Invalid ID (NaN)", so all outputs after that error are not to be trusted anyway.

can you give us a screenshot of your plugin manager? In most cases when yanfly's plugins have problems, that is either plugins in wrong order or incompatibility between two or more plugins.
Ignore all the log stuff above the red boxes. I loaded up my functions with console.log() for troubleshooting. There are 4 sets of logs there that happen on "changeEquip()" is called and with the game loading (2 are just from that - setupstartingmembers? or something like that), and then 2 more when New Game is hit.
changeEquip()
Spoiler
Code:
LordV.Game_Actor_changeEquip = Game_Actor.prototype.changeEquip;
Game_Actor.prototype.changeEquip = function(slotId, item) {
    console.log("changeEquip called");
    var oldItem = this.equips()[slotId];
    var storage = oldItem ? $gameParty.getItemDataStorage(oldItem)[oldItem.id] : null;  
    var valid1 = storage ? 'valid' : 'invalid';
    var valid2 = item ? 'valid' : 'invalid';
    var oldItemId = oldItem ? oldItem.id : 'NaN';
    var itemId = item ? item.id : 'NaN';
    var oldS = storage ? storage.switches : [];
    var oldV = storage ? storage.variables : [];
    var curS = item ? $gameParty.getItemDataStorage(item)[item.id].switches : [];
    var curV = item ? $gameParty.getItemDataStorage(item)[item.id].variables : [];
    console.log("-- storage: "+valid1+" ID("+String(oldItemId)+") --");
    console.log(" -> switches(oldItem): "+String(oldS)+" variables(oldItem): "+String(oldV));
    console.log("-- newItem: "+valid2+" ID("+String(itemId)+") --");
    console.log(" -> switches(newItem): "+String(curS)+" variables(newItem): "+String(curV));
    // call original code
    LordV.Game_Actor_changeEquip.call(this, slotId, item);  
    var equips = this._equips[slotId];
    if (!this.equips()[slotId]) { // on Un-Equip (slot empty)      
        // Overwrite the equip and inventory arrays
        if (storage) {
            console.log(" -> Unequip: Storage: Valid: Switches("+String(storage.switches)+") Variables("+String(storage.variables)+")");
            $gameSystem.obvCopyAll(storage, equips, true);
        } else {
            console.log(" -> Unequip: Storage: Invalid");
        }
    } else { // Equip or Item Swap  
        // Copy the party inventory item's data to the equips slot
        storage = item ? $gameParty.getItemDataStorage(item)[item.id] : null;
        if (storage) {          
            console.log(" -> Equip: storage found! Switches("+String(curS)+") Variables("+String(curV)+")");
            $gameSystem.obvCopyAll(equips, storage, true);
        } else {
            console.log(" -> Equip: no storage");
            $gameSystem.obvClear(equips, 'all');
        }
    }
    console.log("--- End of File ---");
};
^ As you can see I put lots of console.logs 😛

I updated my post, I found out that the IDs are being assigned but the items show up in opposite order. And yeah sure. I only have 3 plugins because I'm developing my own and trying to make it compatible with YEP_ItemCore mainly. Here's the plugins anyways (mine has to be below Yanfly's script for any of this to work lol):

UPDATE:
Welp. I have a solution to the party inventory / equips windows (sort of) but it unfortunately doesn't change anything with the problem above. I was thinking that maybe saving a new array by index would allow an easy access to reference the item number by visuals (Look at the screen to see sword 1/100, sword 2/100, etc. and save your switch 1 = true on sword 1 (ID: 3003), but then it becomes unnecessarily complicated outside of the window screens and equipping sword 1, still equips sword (ID 3003) anyways which is -NOT- what I wanted...

So yeah. This update post is just to keep tabs that I'm still trying to figure it out, not giving up, but will be back in like 48-72 hours to check up if anyone else has a solution first.

@lordvalinar, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.


I've merged them for you this time, but if you have an update, please just edit your previous post to include instead of making a new one if 72 hours haven't yet passed.
Double-post notice: @lordvalinar
I've merged them for you this time, but if you have an update, please just edit your previous post to include instead of making a new one if 72 hours haven't yet passed.

Yes terribly sorry about that. Actually I just wanted to add in 1 more thing - and report this post to close. I have (FINALLY) found the solution to my problem, and the plugin is now... finally... complete.... *takes in a deep breath* This was a PITA xD but worth it I think.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/help-again-sorry-yep_itemcore-compatability.109639/