- Joined
- Mar 17, 2012
- Messages
- 681
- Reaction score
- 446
- First Language
- English
- Primarily Uses
- RMVXA
Tena koutou kind folks,
I'm trying to make it so that if you have a certain kind of item equipped in one of your accessory slots, you cannot equip another in the other. I'm using Yanfly's Equip Engine to give multiple slots. I like the idea of the items still being in the list, just disabled, which is why I decided to edit the 'enable?' method. I've aliased it because Yanfly edits it in his Equip Engine.
So, I thought I'd use a notetag, <equiptype: a>, where a is the name. For example, I have multiple coloured shawls, so their notetag would be <equiptype: shawl>, and if a Red Shawl was equipped in accessory slot 1, you couldn't have a Green Shawl equipped in accessory slot 2.
Here's what I have so far:
It's not throwing an error or anything, it's just not working. I also feel a bit weird about all the nested if statements.
I'm trying to make it so that if you have a certain kind of item equipped in one of your accessory slots, you cannot equip another in the other. I'm using Yanfly's Equip Engine to give multiple slots. I like the idea of the items still being in the list, just disabled, which is why I decided to edit the 'enable?' method. I've aliased it because Yanfly edits it in his Equip Engine.
So, I thought I'd use a notetag, <equiptype: a>, where a is the name. For example, I have multiple coloured shawls, so their notetag would be <equiptype: shawl>, and if a Red Shawl was equipped in accessory slot 1, you couldn't have a Green Shawl equipped in accessory slot 2.
Here's what I have so far:
Code:
class Window_EquipItem < Window_ItemList
#--------------------------------------------------------------------------
# * Display in Enabled State?
#--------------------------------------------------------------------------
alias amn_windowequipitem_enable? enable?
def enable?(item)
return true if !doubleup?(item)
end
def doubleup?(item)
return false if item == nil
if item.note =~ /<equiptype:\s+(\w+)>/i
inote = $1
if @actor.equips[4].note =~ /<equiptype:\s+(\w+)>/i
et = $1
if et == inote
return true
else
return false
end
else
return false
end
else
return false
end
end
end
