I have an event where the player can change their class and after it I would like the character that just changed their class to have all their equipment unequipped. How can I do this?
Unequip all characters equipment after changing classes
RPG Maker VXAce Supportperhaps this small modification to a script snippet I found many years ago from Xypher.
Ruby:
# do command $game_party.unequip_all
# to remove equipment from all party members
# do command $game_party.unequip_actor(1)
# to remove all equipment from actor 1
class Game_Party < Game_Unit
def unequip_all
members.each do |i|
i.equip_slots.each do |j|
i.change_equip(j, nil)
end
end
end
def unequip_actor(actor_id)
actor = $game_actors[actor_id]
actor.equip_slots.each do |j|
actor.change_equip(j, nil)
end
end
end
Will this remove it and delete it or just put it in item/inventory
I can't remember, does changing classes automatically unequip anything you CAN'T wear? If so, you can make a dummy class that can't equip anything. You change their class to the dummy class, then to the class of their choice. This would only work if you're changing classes via events rather than scripts.
Original thread: https://forums.rpgmakerweb.com/threads/unequip-all-characters-equipment-after-changing-classes.170818/