[Help - Again(sorry)] YEP_ItemCore Compatability

Status
Not open for further replies.

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
162
Reaction score
30
First Language
English
Primarily Uses
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 --

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:



Screenshots:




 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,189
Reaction score
6,758
First Language
German
Primarily Uses
RMMV
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.
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
162
Reaction score
30
First Language
English
Primarily Uses
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()
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 :p

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.
 

Attachments

Last edited by a moderator:

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,126
Reaction score
4,827
First Language
english
Primarily Uses
RMMV

@lordvalinar, please avoid double posting, as it is against the forum rules. 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.
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
162
Reaction score
30
First Language
English
Primarily Uses
[dpost]@lordvalinar[/dpost]
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.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,129
Reaction score
7,795
First Language
English
Primarily Uses
RMMV

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

fighting game fans might really enjoy my game battle wise, and I feel non fighting fans might learn some stuff. thanks row system. pokes, neutral, and zoning time...
This community is awesome. They helped me get my eventing processes to work. I love you all.
suspended on twitter for calling an ahole an ahole & appealing the tweet; furious at myself for being even slightly upset with my suspension: oh no, you've been temporarily banned from hell. GET OVER IT, me.
how can you download the tiles from a forum post here? HELP
That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:

Forum statistics

Threads
94,250
Messages
919,395
Members
123,961
Latest member
safrasnativa
Top