Temporarily Seal 'Item' Command based on state/switch

Joined
Aug 6, 2016
Messages
95
Reaction score
5
First Language
English
Primarily Uses
Guys, I'd like to make a state where the one who is inflicted by it can't use items... Just like Embargo in Pokemon.


So the Item command should be  grayed or disappeared temporarily, then it can reappear later when the state wore off or when a switch is activated.


I prefer using state, but if it's too difficult then using switch is okay.


Please help.. Thanks in advance.
 

Wavelength

Pre-Merge Boot
Global Mod
Joined
Jul 22, 2014
Messages
4,611
Reaction score
3,863
First Language
English
Primarily Uses
RMVXA
In Window_ActorCommand, here's the method responsible for adding the 'Item' command to the list:


  #--------------------------------------------------------------------------
  # * Add Item Command to List
  #--------------------------------------------------------------------------
  def add_item_command
    add_command(Vocab::item, :item)
  end


The add_command method can be given a third parameter (normally defaults to "true" when there is no third parameter) which specifies the condition for enabling the command.


So you could do something like add_command(Vocab::item, :item, !$game_switches[12]) to say that the Item command should only be enabled when Switch #12 is OFF (remove the exclamation point if you want it to only be enabled when Switch #12 is ON instead).  Replace the original add_command line with that.


I think that @actor is also defined within this class, so you can probably handle it with a State with something like add_command(Vocab::item, :item, !(@actor.state?(15))) to disable the command when the actor trying to use it is affected with State #15.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I am feeling better about my update schedule, I feel like I am actually getting consistent work done even if it isn’t big updates.
It's a joy to work on a well-made map. I am not regretting this commission in the least!
I'm currently being attacked by the RPG Maker Hydra: fixing one problem only to have two more rise to take its place.
Hey you! Yeah YOU! Whatcha doin' not backing up your projects? You a masochist or sumthin'? GO BACK UP YOUR PROJECTS! Sheeesh... Didn't think I'd hafta spell it out for yas.
now I need to determine, how MV determines if an auto tile is complete or not.
Edit:From what I can tell it uses Autotile kinds to do that.
Edit 2: The editor determines it and packs picture data for the engine....

Forum statistics

Threads
94,291
Messages
919,729
Members
124,039
Latest member
Skagamine
Top