A script that temporarily disables items in battle?

There is a part in my game where you fight a boss as an NPC (kinda like how FF14 sometimes does this) and I do not want the player to use the party's items while acting as this NPC. The NPC has ways to heal herself and recover from things.

The fight is fairly easy as you are playing someone with some unusual strength so use of items should not be necessary but I want to be on the safe side in case a player tries to use an item rather than the NPCs move.


Is there a script that can temporarily disable the use of items during battle?

A Google search is not getting me any results. Someone asked about this for VX in the past (not Ace) but I need one for VX Ace. The topic was filled with posts about changing scopes of items rather than what the OP was trying to do.

Whether it is accompanied by a script call that enables or disables items or it is applied to a state, it is fine either way as long as Aurelia cannot use items in her fight.
I’m not at my computer now so can’t offer any options.
Found this on a google search
Of course it needs to be fixed.
But it only allows specific item when the switch is on. A very similar thing can be done for items in general or the item command.
If you could modify/fix that, that would be awesome! Even an entirely brand new script would be helpful.

I am not in the biggest of hurry as I can test the fight without and just not use items. I just made sure to select a different save first so I can test with whatever script comes my way.

I already use script calls in common event parallel processes that change the occasion of a specific item (the Return Eagle) that teleports you to home controlled by switches when you are at a place that you cannot teleport home (such as in a different universe)

but making one for literally every item would be a pain in the ass and I would have to manually tell what occasion each item is when it is over.

A script that temporarily disables items would be super helpful.
For the map (and main menu) or for battles?
Battles. I do not need it menu disabled. Just during battle.
What about this scriptlet?

EDIT No. 1
Ruby:
# * BattleItems ACE - Kiwi Version * #
#   Scripter : Kyonides Arkanthes
#   2023-08-15

# A Game Switch enables / disables the access to your items during battles.

module BattleItems
  SWITCH_ID = 10
  def self.enabled?
    !$game_switches[SWITCH_ID]
  end

  def self.disabled?
    $game_switches[SWITCH_ID]
  end
end

class Window_ActorCommand
  def add_item_command
    add_command(Vocab::item, :item, BattleItems.enabled?)
  end
end

class Scene_Battle
  alias :kyon_no_battle_items_scn_btl_comm_item :command_item
  def command_item
    return if BattleItems.disabled?
    kyon_no_battle_items_scn_btl_comm_item
  end
end
Can you explain the script to me a bit?

I see a "SWITCH_ID = 10"

What is that for?

I also see two more "[SWITCH_ID]" which I assume is to enable and disable items.

I expected something along the lines of turn a switch on, items disabled, turn it back off, items enabled.


Can you provide instructions for use?

Please and thank you.
First of all, that's what the comment actually says. Since you got the idea already, you're good to go now. 😀
So I do not need anything in the "[Switch_ID]" brackets? I was under the impression that I needed to put ID's there.
It just means turn Game Switch 10 via event command on and you know the rest.
Here is Dekita's script in case somebody wants it fixed.
Ruby:
#===============================================================================
#                      http://dekitarpg.wordpress.com/                         
#===============================================================================
module BatItem
#=============================================================================== 
  #----------------------------------------------------------------------------- 
  # Switch_ID 
  #----------------------------------------------------------------------------- 
  Switch_ID = 50 
  #----------------------------------------------------------------------------- 
  # Array Of Items That Cannot Be Used When Switch_ID is ON !! 
  #----------------------------------------------------------------------------- 
  Items     = [1,2,3,4,5]
end
#===============================================================================
#                      http://dekitarpg.wordpress.com/                         
#===============================================================================
class Window_BattleItem < Window_ItemList
#=============================================================================== 
  #----------------------------------------------------------------------------- 
  # 
  #----------------------------------------------------------------------------- 
  alias :include_battle_item? :include? 
  #----------------------------------------------------------------------------- 
  # 
  #----------------------------------------------------------------------------- 
  def include?(item)   
    if $game_switches[BatItem::Switch_ID]     
      include_battle_item?(item) && !BatItem::Items.include?(item.id)   
    else     
      include_battle_item?(item)   
    end 
  end
end
#===============================================================================
#                      http://dekitarpg.wordpress.com/                         
#===============================================================================
BattleItems XP, VX and ACE can handle that using item note tags instead. I suspect people prefer that rather than handling Ruby Arrays. 😀
What about this scriptlet?

EDIT No. 1
Ruby:
# * BattleItems ACE - Kiwi Version * #
#   Scripter : Kyonides Arkanthes
#   2023-08-15

# A Game Switch enables / disables the access to your items during battles.

module BattleItems
  SWITCH_ID = 10
  def self.enabled?
    !$game_switches[SWITCH_ID]
  end

  def self.disabled?
    $game_switches[SWITCH_ID]
  end
end

class Window_ActorCommand
  def add_item_command
    add_command(Vocab::item, :item, BattleItems.enabled?)
  end
end

class Scene_Battle
  alias :kyon_no_battle_items_scn_btl_comm_item :command_item
  def command_item
    return if BattleItems.disabled?
    kyon_no_battle_items_scn_btl_comm_item
  end
end
I just got done testing this and it works! Thank You @kyonides

Original thread: https://forums.rpgmakerweb.com/threads/a-script-that-temporarily-disables-items-in-battle.160320/