I need to be able to restrict use of an item based on an arbitrary condition, such as a switch, variable, map ID, so on. I was able to achieve this using Bobstah's Enhanced Restrictions plugin. However, my game uses several Yanfly plugins, and Enhanced Restrictions doesn't seem to work together YEP_EquipCore and YEP_EquipRequirements. With BOB_EnhancedRestrictions, YEP_EquipCore, and YEP_EquipRequirements all enabled, when I try to unequip an item in the Equip menu, I get the following error:
TypeError: Cannot read property 'equipRequirements' of undefined
at Game_Actor.Game_BattlerBase.meetAllEquipRequirements (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/plugins/YEP_X_EquipRequirements.js:447:12)
at Window_EquipItem.isEnabled (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/plugins/YEP_X_EquipRequirements.js:566:24)
at Window_EquipItem.Window_ItemList.isCurrentItemEnabled (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:1939:17)
at Window_EquipItem.Window_Selectable.processOk (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:1146:14)
at Window_EquipItem.Window_Selectable.processHandling (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:1021:18)
at Window_EquipItem.Window_Selectable.update (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:978:10)
at file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_core.js:5745:19
at Array.forEach (native)
at WindowLayer.update (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_core.js:5743:19)
at file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_scenes.js:112:19rpg_managers.js:1722 SceneManager.catchExceptionrpg_managers.js:1683 SceneManager.update
The other strange part is when I select an equipped item, I dont get the "Remove" text from the EquipCore plugin. When I select an empty box, thats when the error crops up.
TLDR version: Can anyone help me to restrict item use based on switches or map IDs while remaining compatible with YanflyEngine? Thanks!!!
TypeError: Cannot read property 'equipRequirements' of undefined
at Game_Actor.Game_BattlerBase.meetAllEquipRequirements (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/plugins/YEP_X_EquipRequirements.js:447:12)
at Window_EquipItem.isEnabled (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/plugins/YEP_X_EquipRequirements.js:566:24)
at Window_EquipItem.Window_ItemList.isCurrentItemEnabled (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:1939:17)
at Window_EquipItem.Window_Selectable.processOk (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:1146:14)
at Window_EquipItem.Window_Selectable.processHandling (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:1021:18)
at Window_EquipItem.Window_Selectable.update (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_windows.js:978:10)
at file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_core.js:5745:19
at Array.forEach (native)
at WindowLayer.update (file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_core.js:5743:19)
at file:///C:/Users/Jeremy/Documents/RMMV/The%20Tower/js/rpg_scenes.js:112:19rpg_managers.js:1722 SceneManager.catchExceptionrpg_managers.js:1683 SceneManager.update
The other strange part is when I select an equipped item, I dont get the "Remove" text from the EquipCore plugin. When I select an empty box, thats when the error crops up.
TLDR version: Can anyone help me to restrict item use based on switches or map IDs while remaining compatible with YanflyEngine? Thanks!!!