Hi all,
I am working on a Script that will turn switches on and off depending on if party members are currently equipped with specific weapons/armour. Everything is going fine, except for one part. I want to make sure my script is usable with Yanfly's stuff or just the vanilla system and I'm stuck on this function I need to add a function call to at the bottom:
alias game_actor_change_equip_aee change_equip def change_equip(slot_id, item) if item.nil? && !@optimize_clear etype_id = equip_slots[slot_id] return unless YEA::EQUIP::TYPES[etype_id][1] elsif item.nil? && @optimize_clear etype_id = equip_slots[slot_id] return unless YEA::EQUIP::TYPES[etype_id][2] end @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil? game_actor_change_equip_aee(slot_id, item) endthis would be where my checking routine is called, that would check the party's current equipment. Can I just alias change_equip again, with my function appearing below this script in my script list. So... the vanilla change_equip function was aliased by Yanfly to include his processing, and now when I alias change_equip beneath this script I'll be updating Yanfly's code so it includes everything. Is that the right way to view aliasing? It can be daisy-chained? 🤔
I am working on a Script that will turn switches on and off depending on if party members are currently equipped with specific weapons/armour. Everything is going fine, except for one part. I want to make sure my script is usable with Yanfly's stuff or just the vanilla system and I'm stuck on this function I need to add a function call to at the bottom:
alias game_actor_change_equip_aee change_equip def change_equip(slot_id, item) if item.nil? && !@optimize_clear etype_id = equip_slots[slot_id] return unless YEA::EQUIP::TYPES[etype_id][1] elsif item.nil? && @optimize_clear etype_id = equip_slots[slot_id] return unless YEA::EQUIP::TYPES[etype_id][2] end @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil? game_actor_change_equip_aee(slot_id, item) endthis would be where my checking routine is called, that would check the party's current equipment. Can I just alias change_equip again, with my function appearing below this script in my script list. So... the vanilla change_equip function was aliased by Yanfly to include his processing, and now when I alias change_equip beneath this script I'll be updating Yanfly's code so it includes everything. Is that the right way to view aliasing? It can be daisy-chained? 🤔