Forced Unequip of weapon/armor

Started by GrimTrigger, April 26, 2013, 12:52:57 pm

Previous topic - Next topic

GrimTrigger

Several instances in my game I'd like to be able to hand over my currently equipped weapon or remove my armor mid-cutscene. Having to end the scene, and manually remove it breaks a lot of immersion, and simply feels clumsy. Is there a way to do this so I can remove my equipped weapon, for the purpose of removing it from my inventory? Change weapon ==> decrease doesn't seem to handle equipped items.

ThallionDarkshine

Throw this little snippet in a new script slot:

class Game_Actor
  attr_writer :weapon_id, :armor1_id, :armor2_id, :armor3_id, :armor4_id
end


To unequip a weapon or armor, use this script call:
$game_actors[ACTOR_ID].weapon_id = 0

Replace ACTOR_ID with the id of the actor whose weapon you want to remove, and weapon_id with whatever you want to change (weapon_id, armor1_id, armor2_id, armor3_id, or armor4_id). If you want it to be unequipped and returned to the inventory, then just use a change weapon/armor ==> increase command.