[RMXP] How do I make an item that the player cannot unequip?

Keki3

Warper
Member
Joined
Mar 28, 2019
Messages
2
Reaction score
0
First Language
Spanish
Primarily Uses
RMXP
Hello!
I am making a game in RMXP in which the first "weapon" the player has is their fist, and I want to make it so that the player cannot unequip it. How do I do it?
 

Ebanyle

açspasl~d~dfflass
Veteran
Joined
Sep 2, 2016
Messages
338
Reaction score
200
First Language
Portuguese
Primarily Uses
RMVXA
Right next to the equipment in the Actors section in database, mark the box to fix an equipment
20190406_211908.png
 

Keki3

Warper
Member
Joined
Mar 28, 2019
Messages
2
Reaction score
0
First Language
Spanish
Primarily Uses
RMXP
Thanks Ebanyle. But I forgot to say something, sorry, I want it to be exchangable with other weapons, so that the player can change it for another weapon, I only want it to be not unequipable for when the player doesn't have any other weapons.
 

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
155
First Language
English
Primarily Uses
RMXP
So.... it's not that it is a FIXED weapon. Just that the weapon slot can never be emptied by the player.

Now, I don't know if you want ONLY the lead actor, various actors, or ALL actors to not be able to unequip their weapon, so...........

Code:
# Fill this Array with the IDs of your actors (from the Database)
# that cannot unequip their weapon.  OR, you can empty the array
# if ALL the actors can't unequip
  NEVER_EMPTY_ACTORS = [1,2,7]



#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias never_empty_weapon_scene_equip_update_item update_item
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # Hehe... do a test to see if the ACTOR is the script's target
    id = @actor.id                                        # Get Actor ID
    never_flag = false                                    # System doesn't run?
    if NEVER_EMPTY_ACTORS.nil?                            # If it's 100% nil
      never_flag = true                                   # System needs to run
    elsif NEVER_EMPTY_ACTORS == []                        # If array is empty
      never_flag = true                                   # System needs to run
    elsif NEVER_EMPTY_ACTORS.include?(id)                 # If specific actor...
      never_flag = true                                   # System needs to run
    end
    # Here, we run the test IF the system is used
    if never_flag == true                                 # If actor in play
      if Input.trigger?(Input::C)                         # If hitting select
        if @right_window.index == 0                       # If weapon slot
          if @item_window.item.nil?                       # If choosing nuthin
            $game_system.se_play($data_system.buzzer_se)  # Play Buzzer
            return                                        # And Exit......
          end
        end
      end
    end
    # Ye olde code ^_^
    never_empty_weapon_scene_equip_update_item
  end
end
Oh. And ye standard installation instructions:
Paste this below Scene_Debug and Above Main. If used with other Scene_Equip Scripts, place this below those. It should not interfere with basic operations except the unequiping of weapons as designed.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top