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.

[FIXED] Need some help with Window_EquipRight

I'm having problems with my Window_EquipRight Script.
Here's the stuff I have:
DATABASE
Weapon => "Main-Wep"
Shield => "Sec-Wep"
Helmet => Removed
Body Armor => "Accessory" Surprising, I leave the Main Armor in the Body Armor section and it appears where the "Body" slot is but the "Body" slot is the default Accessory Section so it needs to be in that section but it stays in the the Accessory Section.
Accessory => "Body"
SCRIPTS Default Window_EquipRight
Code:
 

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

# ** Window_EquipRight

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

#  This window displays items the actor is currently equipped with on the

#  equipment screen.

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

 

class Window_EquipRight < Window_Selectable

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

  # * Object Initialization

  #     actor : actor

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

  def initialize(actor)

    super(272, 64, 368, 192)

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

    @actor = actor

    refresh

    self.index = 0

  end

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

  # * Item Acquisition

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

  def item

    return @data[self.index]

  end

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

  # * Refresh

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

  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])

    @data.push($data_armors[@actor.armor4_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(4, 32 * 3, 92, 32, $data_system.words.armor3)

    self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)

    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)

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

  end

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

  # * Help Text Update

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

  def update_help

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

  end

end

 
Default Window_EquipItem
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

 
My Window_EquipRight
Code:
 

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

# ** Window_EquipRight

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

#  This window displays items the actor is currently equipped with on the

#  equipment screen.

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

 

class Window_EquipRight < Window_Selectable

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

  # * Object Initialization

  #     actor : actor

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

  def initialize(actor)

    super(272, 64, 368, 192)

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

    @actor = actor

    refresh

    self.index = 0

  end

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

  # * Item Acquisition

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

  def item

    return @data[self.index]

  end

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

  # * Refresh

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

  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.armor3_id])

    @data.push($data_armors[@actor.armor4_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.armor3)

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

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

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

    draw_item_name(@data[3], 122, 32 * 2)

    draw_item_name(@data[4], 122, 32 * 3)

  end

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

  # * Help Text Update

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

  def update_help

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

  end

end

 
My Window_EqupItem
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 = 1

    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)

  end

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

  # * Help Text Update

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

  def update_help

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

  end

end

 
2cqzj92.jpg
No matter what I do, the initial Accessory with the Actor will always display and doesn't seem to be able to be un-equipped.
2cfa736.jpg
The Body Armor doesn't show and when it does show, it won't show the other stuff in the item window unless you move the cursor over one of the other slots such as Accessory.
2cfa736.jpg
This is the main part I've edited.

The stuff I need help with:
How to make the equipped Body Armor show and the other stuff that the party has within the item window
Items need to be in the righ section of each Window.
Example:
The Right Way=> Equipped Shield: Silver Shield Item Window: Round Shield : 1 Small Shield : 2
For Me=> Equipped Shield: Silver Shield Item Window: Steel Plate Armor : 2 Bronze Chestplate: 1
How to fix the Accessory Issue.
You may use my Window_EquipRight and Window_EquipItem and try to test it and fix it. I would appreciate it. :smile:
 

Atoa

Member

I didn't undestood what exactly you want.

You want to remove the shield and changing the order of armor and acessory?

Well, why you simply don't remove the acessory (the last slot), and change the name of the helmet slot to "acessory"?

For the RPG Maker, the helmet (or other armor) slot don't need *really* to be an helmet.
It's you that decides the name and icon of the equip, so if you name the helmet slot "accessory" and give all "helmet" graphics and accessory names, for the player it will be an acessory!

Or you could also check my script "ACBS", in this script theres an add-on, called "Advanced Actors Status" that allows you to completely customize the equipment slots. (i'm going to create an 'free' version of this add on later)

But if you *really* want to do it with your script, try look at the scene equip.
if i'm not wrong, is the refresh method that define wich item window will be shown, based on the index of the right window.
 
Alright, I'll try to fix up the database with the armor types.
But that was my fault, mainly what I'm asking is for someone to help fix the fact that when I put on initial armor for my guy, it won't show in the Window_EquipRight and the Window_EquipItem.
Plus, I have the Blizzard's Script for the Secondary Weapon in Blizz ABS, just in case if that intereferes with this.
I'm testing it out now, and I'm sorry that you didn't understand what I was asking for, I'm choppy when it comes to stuff like this :sad:
I took out my Window_EquipRight and put in the default and all I took out was: Line 36, 43, and 48.
...
Okay, now it's working perfectly, can't believe how simple my mistake was.
Thanks Atoa :thumb:
Alright, Topics Over.
 
Alright, I'll try to fix up the database with the armor types.
But that was my fault, mainly what I'm asking is for someone to help fix the fact that when I put on initial armor for my guy, it won't show in the Window_EquipRight and the Window_EquipItem.
Plus, I have the Blizzard's Script for the Secondary Weapon in Blizz ABS, just in case if that intereferes with this.
I'm testing it out now, and I'm sorry that you didn't understand what I was asking for, I'm choppy when it comes to stuff like this :sad:
I took out my Window_EquipRight and put in the default and all I took out was: Line 36, 43, and 48.
...
Okay, now it's working perfectly, can't believe how simple my mistake was.
Thanks Atoa :thumb:
Alright, Topics Over.

Sorry about double post. I clicked on submit abunch of times since it wasn't loading :|
 

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