remove additional equipment using events

Discussion in 'RPG Maker VX Ace' started by Neutimulus, Aug 1, 2019.

  1. Neutimulus

    Neutimulus Warper Member

    Likes Received:
    First Language:
    Primarily Uses:
    I used "Yanfly's Ace equip Engine" to add 5 to 7 additional equipment slots.

    I would like to be able to release it only through certain events when the equipment is worn in the additional equipment slot.
    So I gave the fixed effect to the equipment of the additional equipment slot.
    However, through the event, it is possible to release only the equipment slots 0 ~ 4 by default (weapons, shields, etc.).

    Perhaps it is possible to create an event that releases a device in a specific number of equipment slots through a script.
    But I do not know how to do it because I do not have enough knowledge of script.
    please help me
  2. Heirukichi

    Heirukichi Veteran Veteran

    Likes Received:
    First Language:
    Primarily Uses:
    The script you are using already provides a method for that. Line 619, the method is "change_equip". It is an aliased method (which means that it uses the same name of the one in the default engine), and it allows you to equip things in a certain slot. It takes two parameters: slot_id and item. Slot id is an integer representing your slot index (the first index is 0, which represents your weapon, the second is 1, and so on), while Item can either be a weapon or an armor.

    If it is a weapon you have to use $data_weapons[item_id], if it is an armor you have to use $data_armors[item_id]. The final result when trying to equip an item is this (in the example below I am using actor 3, slot 2 and armor 24):
    $game_actors[3].change_equip(2, $data_armors[24])
    Do not forget to change those values (3, 2 and 24) to fit your needs, and do not forget that when equipping an item you should remove the said item from the player inventory, when removing an item from the equipment slot, you should add that item to the player inventory. If you do not, your items will respectively have infinite uses or be permanently removed when removing them from the equipment.

Share This Page