Preventing Unarmed Combat

I'd like a script that removes that ability to fight with no weapons.

Basically, I want weapons to be not unequipable and only allow the players to change their weapons, so they can't fight with nothing.

Ex. Hero has a Sword and an Axe. Hero can only switch between the two weapons but is unable to unequip his weapon.

Before you say, this CANNOT be done through default. Choosing the "Seal Equip" option makes it so that your weapon can't be changed OR unequiped, which does not help since I have multiple weapons.

If the player chooses the option "Remove All", everything EXCEPT the weapon will be wiped from the slots, too.
I THINK you just need to go through your Window_EquipItem script and change the def include?(item) method to return false on nil item.

So change this:

#-------------------------------------------------------------------------- # * Include in Item List? #-------------------------------------------------------------------------- def include?(item) return true if item == nil return false unless item.is_a?(RPG::EquipItem) return false if @slot_id < 0 return false if item.etype_id != @actor.equip_slots[@slot_id] return @actor.equippable?(item) endto this:
Code:
  #--------------------------------------------------------------------------  # * Include in Item List?  #--------------------------------------------------------------------------  def include?(item)    return false if item == nil # <-- change this line    return false unless item.is_a?(RPG::EquipItem)    return false if @slot_id < 0    return false if item.etype_id != @actor.equip_slots[@slot_id]    return @actor.equippable?(item)  end
Untested, but I think it'll work.
If that doesn't work you can use Yanfly's equip engine. I don't know if it's a bug or it's just me, but once you equip something on a actor they can't be weaponless.
I THINK you just need to go through your Window_EquipItem script and change the def include?(item) method to return false on nil item.

So change this:

#-------------------------------------------------------------------------- # * Include in Item List? #-------------------------------------------------------------------------- def include?(item) return true if item == nil return false unless item.is_a?(RPG::EquipItem) return false if @slot_id < 0 return false if item.etype_id != @actor.equip_slots[@slot_id] return @actor.equippable?(item) endto this:
Code:
  #--------------------------------------------------------------------------  # * Include in Item List?  #--------------------------------------------------------------------------  def include?(item)    return false if item == nil # <-- change this line    return false unless item.is_a?(RPG::EquipItem)    return false if @slot_id < 0    return false if item.etype_id != @actor.equip_slots[@slot_id]    return @actor.equippable?(item)  end
Untested, but I think it'll work.
I did as you said but it still let me unequip my weapon. I'll try Yanfly's script and see if it works.

EDIT: I already have Yanfly's equip engine and I never bothered to look at the customizable options... Whoops. Oh well, I got the problem fixed. Thanks!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/preventing-unarmed-combat.26238/