Hi all,
So I'm trying to modify the equip scene with some new stats (weapon base damage and the like), but I only want them to show when the weapon slot is highlighted (because there's no point showing it for armour that is never going to affect the value), but I'm having trouble finding the right condition to check the current equip slot.
What conditional would I have to use to check the currently highlighted Equip Slot in the Equip_Slots window, if it's possible?
Thanks a bunch :D
Show Different Stats based on Current Equip Slot
● ARCHIVED · READ-ONLY
-
-
Is it the Window_EquipStatus you're making the changes to? I don't have Ace in front of me, so I'm going by memory, and I've done HUGE mods to the equip scene in my game and the classes really don't represent the originals very much at all.
I think, by default, the current equip slot is not available in this window. However, it IS shared between the Category and List windows. You COULD check to see how that happens (I think when a new category is selected, it updates a variable in the equip list window, and that's how it knows whether to show weapons or shields or whatever). You could DUPLICATE that logic into the equip status window (so from the category - or it might be part of the Scene_Equip script - when it updates the equip list category/slot, make it also update the equip stats category/slot, and then in the equip stats window, duplicate the logic from the equip list window to accept and act on this new value). -
Yeah it is the Window_EquipStatus I'm fiddling with. I'll give your idea a look tomorrow and report back if I hit more trouble :) thank you for the help!
-
Still no luck :(
I'm pulling the slot_id into the EquipStatus window with an accessor, but I'm getting a "no implicit conversion from nil to integer" error when I try to check against this slot_id value. I think this is because the status window is drawn before the slot window. If i put a catch in to check for the slot window it just draws no parameters at all :/
I can't rearrange the draw order because the slot window width is based on the size of the status window, so would the only way around this be to draw the slot window based on different values and the change the draw order? -
just use "return if slot_id.nil?" or something similar (It fixes a lot of these problems I find, if you return or don't do your new code while the value of whatever variable your using has not been used yet).
-
Yeah, chances are the window will be redrawn again before you get a chance to see it, because as soon as the category screen is drawn, the slot will be allocated. Its default will be 0, so you COULD put that into your init method as an alternative.
If the above ideas don't work, let us know and we'll look into it a bit further :) -
Thank you for all the help both, your comment about the window regularly being redrawn led me to the answer :) Aliasing the Window_EquipSlot update method and adding a new line in there solved my problem.
Some of these things are really simple as long as you do it in the right method :p Thank you again! :D