Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

removing equipment slots.

So in my game the characters ideally only have, a weapon, armor, sheild and an accessory (or 3 if possible).

Anyone know of a script that simply removes the helmet from the optional equipment, and adds an extra accessory or two. (if it doesn't add an accessory it's fine :])

I've tried to do this with guilaum777's multi slot script but i cant seem to make that the default set up for everyone.
 
der, what rpg maker program are you using?
If it's rpg maker vx. then I'm quite sure you could use some of the kgc script system, custom equipment scene script or something liek that.
I'm not too sure about rmxp, though.
 
I remember trying multiple accessory slots a while ago, and after failing miserably for a while, I found it's actually quite simple... can't remember the details though, as I haven't worked with RMXP in a long while.

However, if you just want to remove other slots, look into Scene_Equip and Window_EquipRight respectively. They should both contain some methods that each have five handlings depending on @equip_type - these are your slots. If you replace the third with what is the fifth, and delete 4 and 5 thereafter, you should be good.
Note that you can't just add oher accessory slots by coping the accessory option multiple times ^^"
 
yeah i tried the accessory adding before i posted, it didn't work :]. But Thank you, i assumed i could do it that way but didn't think i'd have to change the numbers up a bit.

EDIT: Stupid me, you must have ment the handlings, i know nothing of ruby, but I am planning on learning it. If you could explain a bit more in depth it would be fantastic.
 
The problem is that even now that I'm at home, I don't use RMXP anymore, si therefore I can't look at it. ^^" If you could supply the code for the metnioned classes, though, I could maybe help you out.
 

Star

Sponsor

I tried changing it to where it would do it. But as for Window_EquipItem I can't get the right stuff to appear in the correct slots

Only way I can think of doing it is to make all Body Armor using the Helmet Slot in the Database and all Accessories using the Body Armor Slot

and then using this script

Code:
class Window_EquipRight < Window_Selectable

  def refresh

    self.contents.clear

    @data = []

    @data.push($data_weapons[@actor.weapon_id])

    @data.push($data_armors[@actor.armor1_id])

    @data.push($data_armors[@actor.armor2_id])

    @data.push($data_armors[@actor.armor3_id])

    @item_max = @data.size

    self.contents.font.color = system_color

    self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)

    self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)

    self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)

    self.contents.draw_text(5, 32 * 3, 92, 32, $data_system.words.armor3)

    draw_item_name(@data[0], 92, 32 * 0)

    draw_item_name(@data[1], 92, 32 * 1)

    draw_item_name(@data[2], 92, 32 * 2)

    draw_item_name(@data[3], 92, 32 * 3)

  end

end

class Scene_Equip

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor_index : actor index

  #     equip_index : equipment index

  #--------------------------------------------------------------------------

  def initialize(actor_index = 0, equip_index = 0)

    @actor_index = actor_index

    @equip_index = equip_index

  end

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

    # Get actor

    @actor = $game_party.actors[@actor_index]

    # Make windows

    @help_window = Window_Help.new

    @left_window = Window_EquipLeft.new(@actor)

    @right_window = Window_EquipRight.new(@actor)

    @item_window1 = Window_EquipItem.new(@actor, 0)

    @item_window2 = Window_EquipItem.new(@actor, 1)

    @item_window3 = Window_EquipItem.new(@actor, 2)

    @item_window4 = Window_EquipItem.new(@actor, 3)

    # Associate help window

    @right_window.help_window = @help_window

    @item_window1.help_window = @help_window

    @item_window2.help_window = @help_window

    @item_window3.help_window = @help_window

    @item_window4.help_window = @help_window

    # Set cursor position

 

      @right_window.index = @equip_index

    refresh

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of windows

    @help_window.dispose

    @left_window.dispose

    @right_window.dispose

    @item_window1.dispose

    @item_window2.dispose

    @item_window3.dispose

    @item_window4.dispose

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    # Set item window to visible

    @item_window1.visible = (@right_window.index == 0)

    @item_window2.visible = (@right_window.index == 1)

    @item_window3.visible = (@right_window.index == 2)

    @item_window4.visible = (@right_window.index == 3)

    # Get currently equipped item

    item1 = @right_window.item

    # Set current item window to @item_window

    case @right_window.index

    when 0

      @item_window = @item_window1

    when 1

      @item_window = @item_window2

    when 2

      @item_window = @item_window3

    when 3

      @item_window = @item_window4

    end

    # If right window is active

    if @right_window.active

      # Erase parameters for after equipment change

      @left_window.set_new_parameters(nil, nil, nil)

    end

    # If item window is active

    if @item_window.active

      # Get currently selected item

      item2 = @item_window.item

      # Change equipment

      last_hp = @actor.hp

      last_sp = @actor.sp

      @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)

      # Get parameters for after equipment change

      new_atk = @actor.atk

      new_pdef = @actor.pdef

      new_mdef = @actor.mdef

      # Return equipment

      @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)

      @actor.hp = last_hp

      @actor.sp = last_sp

      # Draw in left window

      @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)

    end

  end

  end

You would also have to rename the System stuff under the Database
Helmet >>>> Body Armor
Body Armor >>>> Accessory

Here's the window_equipitem script incase BlueScope want's to fool with it.

Code:
#==============================================================================

# ** Window_EquipItem

#------------------------------------------------------------------------------

#  This window displays choices when opting to change equipment on the

#  equipment screen.

#==============================================================================

 

class Window_EquipItem < Window_Selectable

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor      : actor

  #     equip_type : equip region (0-3)

  #--------------------------------------------------------------------------

  def initialize(actor, equip_type)

    super(0, 256, 640, 224)

    @actor = actor

    @equip_type = equip_type

    @column_max = 2

    refresh

    self.active = false

    self.index = -1

  end

  #--------------------------------------------------------------------------

  # * Item Acquisition

  #--------------------------------------------------------------------------

  def item

    return @data[self.index]

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    if self.contents != nil

      self.contents.dispose

      self.contents = nil

    end

    @data = []

    # Add equippable weapons

    if @equip_type == 0

      weapon_set = $data_classes[@actor.class_id].weapon_set

      for i in 1...$data_weapons.size

        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)

          @data.push($data_weapons[i])

        end

      end

    end

    # Add equippable armor

    if @equip_type != 0

      armor_set = $data_classes[@actor.class_id].armor_set

      for i in 1...$data_armors.size

        if $game_party.armor_number(i) > 0 and armor_set.include?(i)

          if $data_armors[i].kind == @equip_type-1

            @data.push($data_armors[i])

          end

        end

      end

    end

    # Add blank page

    @data.push(nil)

    # Make a bit map and draw all items

    @item_max = @data.size

    self.contents = Bitmap.new(width - 32, row_max * 32)

    for i in 0...@item_max-1

      draw_item(i)

    end

  end

  #--------------------------------------------------------------------------

  # * Draw Item

  #     index : item number

  #--------------------------------------------------------------------------

  def draw_item(index)

    item = @data[index]

    x = 4 + index % 2 * (288 + 32)

    y = index / 2 * 32

    case item

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

    bitmap = RPG::Cache.icon(item.icon_name)

    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))

    self.contents.font.color = normal_color

    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)

    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)

    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)

  end

  #--------------------------------------------------------------------------

  # * Help Text Update

  #--------------------------------------------------------------------------

  def update_help

    @help_window.set_text(self.item == nil ? "" : self.item.description)

  end

end

 
 
Window_EquipItem class will be the last thing you need to modify, however, you see how stuff is handled in there already (@equip_type stores the equipped armors respectively: 0 is shield, 1 is armor, 2 is shield, 3 is accessory... or a different order in case I switches 1 and 2...).

However, what you need to change is mainly Window_EquipRight (for display and addression), as well as Scene_Equip (as some stuff is handled through there, iirc).
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top