Thanks for the script!
I'm using Yanfly's Ace Equip Engine, and when I am trying to select an item in the Equip menu, it doesn't display the accurate stats of each item when there are multiple copies. When equipped, the stat is accurate and variable, as desired. But in the selection menu, it only displays the stat increase for the item that was first viewed. I doucle-checked and I am sure that Ace Equip Engine is the problem, as the problem disappears without Ace Equip Engine installed. Moving the scripts around, above and below, has no effect.
So for example, I have a list of 3 hand-axes, which have a stat variance, and some other weapons, like so:
weapon1
hand-axe1
hand-axe2
hand-axe3
weapon3
When I move down from weapon1 to hand-axe1 (by moving the cursor, pushing the down button, etc.), it will show the stat difference between weapon1 and hand-axe1 normally. But when I move down from hand-axe1 to hand-axe 2, it will still show the stat values of hand-axe1, even if hand-axe2 is different. Same for moving down to hand-axe3. But when I get down to weapon3, weapon3 shows normally. Then when I scroll back up to hand-axe 3 from weapon3, it shows the stats for hand-axe3 normally. And when I move from hand-axe3 up to hand axe-2, it shows hand-axe3's stats even if hand-axe2 is different.
So there's an issue, for me, on proper display of stats that depends on scrolling between items and it only displaying the stats for the first variable item that was highlighted in the sequence of variable items, but it properly displays the item stats when scrolling between a non-variable and a variable item. It does not happen when scrolling between two different variable item types, such as hand-axes and battle-axes (both of which having varying stats).
I am not sure if you do compatability or anything, but if you could point me in the right direction on how to solve this, that would be great enough. Thanks!
EDIT UPDATE: Okay, in Ace Equip Engine, starting at line 1016, is class Window_EquipItem < Window_ItemList . I figured the problem was here, in how it identified items, etc.
Further down in this section, starting at line 1098 is:
#--------------------------------------------------------------------------
# overwrite method: update_help
#--------------------------------------------------------------------------
def update_help
super
return if @actor.nil?
return if @status_window.nil?
return if @last_item == item
@last_item = item
temp_actor = Marshal.load(Marshal.dump(@actor))
temp_actor.force_change_equip(@slot_id, item)
@status_window.set_temp_actor(temp_actor)
end
This seemed like a good place to look, because the problem seemed to be the window wasn't updating properly. I thought the problem was with the line "return if @last_item == item" because the script is not configured to properly tell if the item really is new with the new database ids, and maybe the window wasn't updating because it thought the items were the same. So I commented that line out to "# return if @last_item == item", and it solved the problem.
This is a question for an advanced scripter -- I'm not sure why Yanfly would be checking to see if the new item is the same as the old item, since there isn't really a way to scroll between the same item twice (unless you write a script that differentiates them, like item stat variance), and even if you did scroll between the same item twice, why not just update anyway? It would be great if someone could try and maybe explain this? Or maybe I have no idea what I'm talking about and stumbled on a solution by accident. Are there any repercussions to my change?
Anyway, problem solved (hopefully without introducing another error). FYI for others who experience a similar issue.