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.

Customizable Equip Screen

ENHANCED EQUIP MENU

Well... I was editing the equip menu from my game, as some of you might know, and I sort of went out of control with it. This is the outcome. It still looks like the DMS, but you can change around things... uh... look in the features section.

I tried to keep this as easy to use as possible. All the customization stuff is at the top of "Window_EquipLeft".

Please keep in mind that this is my first script, and I expect you to be huge on the comments and criticism. It's the only way I am gunna get better, folks!

FEATURES (CUSTOMIZABLE PARTS)

- Easy font / font size change.
- Editable stat increase arrow. You may change it to whatever you want. (Strength: 250 --> 260)
- Color code the increase arrow and the new stat. (Agility: 70 --> 90)
- 3 different definable colors for;
* Stat increase.
* Stat goes down.
* Stat stays the same.
- The ability to display all 7 stats, (strength, dexterity, agility, intelligence, attack power, physical defense, and magical defense) in any order, and spaced apart to your liking.

* All of this ONLY applies to the equip screen.
** The windows themselves weren't changed, so even though you can display all the stats as far apart as you want, they may get cut off if you push it.

SCRIPT

Anyway, enough of my jabbering. This is what you came here for; or maybe it was your curiousity?

Just slap this above 'main'.
Code:
#============================================================
#   Enhanced Equip Window
#------------------------------------------------------------------------------------------------------------------------
#   By Trance
#   Version 1.1
#   January 2nd, 2007 [happy new year!]
#------------------------------------------------------------------------------------------------------------------------
#   This script will allow you to easily customize your equip screen.
#   I simply changed the equip screen around, so it should be
#   fully compatable with more or less everything (but not custom
#   menu systems, of course! =P). I have tried to make this as
#   simple and well organized as possible, so even a complete newb
#   (like myself) can understand it. Note, that the default settings
#   make the equip screen look like it was unchanged--however with
#   all stats displayed.
#============================================================
#  History
#------------------------------------------------------------------------------------------------------------------------
#    1.0
#        - Released.
#    1.1
#        - Fixed a minor bug where the arrow would show up, even if
#        the stat was turned off.
#============================================================
#  Customization
#------------------------------------------------------------------------------------------------------------------------
#   Okay, this is what you have to change around to create your
#   very own, personalized equipment window!
      $desired_font = "Arial"
      $desired_font_size = 14
#   Odvious, hmm? These are the font, and font size.
      $desired_arrow_style = "→"
#   This is the arrow that will be showing up during equipment
#   changes. You can change it to whatever you want, though
#   other smart choices may be "→", ">>>", or "=>".
      $color_coded_bonuses = true 
#   If this option is set to true, when you are equiping a new item,
#   the arrow pointing to your stat increase will change color 
#   depending on if the stat is going up, down, or staying the same.
#   Note, also that the stat increase also changes color.
      $stat_goes_up_color = Color.new(0, 200, 0)
      $stat_goes_down_color = Color.new(200, 0, 0)
      $stat_stays_the_same_color = Color.new(150, 150, 150)
#   Rather self explanitory. If 'color_coded_bonuses' is off, these
#   color changes do not apply.
      $display_str = [true, 1] # Strength
      $display_dex = [true, 2] # Dexterity
      $display_agi = [true, 3] # Agility
      $display_int = [true, 4] # Intelligence
      $display_atk = [true, 5] # Attack Power
      $display_pdef = [true, 6] # Physical Defense
      $display_mdef = [true, 7] # Magical Defense
#   The settings here that are true will be displayed on the equip
#   screen. The second number is the order in which they will
#   appear. Make sure it is set to '0' if false. Don't make it higher
#   than '7', unless you want a 'crash my game script'. But you odviously
#   wouldn't do this scince there is only seven options.
      $list_start_y_pos = 25
      $seperation_distance = 15
#   This is how far apart the stats that are visible will apear, and
#   how high/low the list will start.
#============================================================
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
class Window_EquipLeft < Window_Base
  def initialize(actor)
    super(0, 64, 272, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $desired_font  # "Equip" left side (Status) window font
    self.contents.font.size = $desired_font_size
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 4, 20)
    if $display_str[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_str[1]), 3)
    end
    if $display_dex[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_dex[1]), 4)
    end
    if $display_agi[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_agi[1]), 5)
    end
    if $display_int[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_int[1]), 6)
    end
    if $display_atk[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_atk[1]), 0)
    end
    if $display_pdef[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 1)
    end
    if $display_mdef[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 2)
    end
  
    if @new_str != nil and $display_str[0] == true
      if $color_coded_bonuses == true
        if @new_str > @actor.str
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        elsif @new_str == @actor.str
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        elsif @new_str < @actor.str
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
    end
  end
    if @new_dex != nil and $display_dex[0] == true
      if $color_coded_bonuses == true
        if @new_dex > @actor.dex
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        elsif @new_dex == @actor.dex
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        elsif @new_dex < @actor.dex
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
    end
  end
    if @new_agi != nil and $display_agi[0] == true
      if $color_coded_bonuses == true
        if @new_agi > @actor.agi
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        elsif @new_agi == @actor.agi
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        elsif @new_agi < @actor.agi
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
    end
  end
    if @new_int != nil and $display_int[0] == true
      if $color_coded_bonuses == true
        if @new_int > @actor.int
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        elsif @new_int == @actor.int
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        elsif @new_int < @actor.int
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
    end
  end
    if @new_atk != nil and $display_atk[0] == true
      if $color_coded_bonuses == true
        if @new_atk > @actor.atk
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        elsif @new_atk == @actor.atk
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        elsif @new_atk < @actor.atk
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
    end
  end
    if @new_pdef != nil and $display_pdef[0] == true
      if $color_coded_bonuses == true
        if @new_pdef > @actor.pdef
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        elsif @new_pdef == @actor.pdef
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        elsif @new_pdef < @actor.pdef
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
    end
  end
    if @new_mdef != nil and $display_mdef[0] == true
      if $color_coded_bonuses == true
        if @new_mdef > @actor.mdef
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        elsif @new_mdef == @actor.mdef
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        elsif @new_mdef < @actor.mdef
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
    end
  end
  end
  #--------------------------------------------------------------------------
  # * Set parameters after changing equipment
  #     new_atk  : attack power after changing equipment
  #     new_pdef : physical defense after changing equipment
  #     new_mdef : magic defense after changing equipment
  #--------------------------------------------------------------------------
  def set_new_parameters(new_str, new_dex, new_agi, new_int, new_atk, new_pdef, new_mdef)
    if @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int or @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
      @new_str = new_str
      @new_dex = new_dex
      @new_agi = new_agi
      @new_int = new_int
      @new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      refresh
    end
  end
end

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

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)
    @item_window5 = Window_EquipItem.new(@actor, 4)
    # 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
    @item_window5.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
    @item_window5.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)
    @item_window5.visible = (@right_window.index == 4)
    # 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
    when 4
      @item_window = @item_window5
    end
    # If right window is active
    if @right_window.active
      # Erase parameters for after equipment change
#============================================================
#   CHANGED!
#============================================================
      @left_window.set_new_parameters(nil, nil, nil,nil,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
#============================================================
#   CHANGED!
#============================================================
      new_str = @actor.str
      new_dex = @actor.dex
      new_agi = @actor.agi
      new_int = @actor.int
      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
#============================================================
#   CHANGED!
#============================================================
      @left_window.set_new_parameters(new_str, new_dex, new_agi, new_int, new_atk, new_pdef, new_mdef)
#============================================================
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @left_window.update
    @right_window.update
    @item_window.update
    refresh
    # If right window is active: call update_right
    if @right_window.active
      update_right
      return
    end
    # If item window is active: call update_item
    if @item_window.active
      update_item
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when right window is active)
  #--------------------------------------------------------------------------
  def update_right
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(2)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If equipment is fixed
      if @actor.equip_fix?(@right_window.index)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Activate item window
      @right_window.active = false
      @item_window.active = true
      @item_window.index = 0
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::R)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To next actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Switch to different equipment screen
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To previous actor
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Switch to different equipment screen
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Activate right window
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play equip SE
      $game_system.se_play($data_system.equip_se)
      # Get currently selected data on the item window
      item = @item_window.item
      # Change equipment
      @actor.equip(@right_window.index, item == nil ? 0 : item.id)
      # Activate right window
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      # Remake right window and item window contents
      @right_window.refresh
      @item_window.refresh
      return
    end
  end
end

COMPATABILITY

This is just an edit of the main menu. It works with more or less everything.

SCREENSHOTS

You only need one. This is how it looks with the default settings:

http://img412.imageshack.us/img412/7668/changesep8.png[/IMG]
CLOSING

This is my first script, and I realize that is isn't very space effective. If somebody more experienced wants to fix that, that would be awesome. If you do though, PM it to me, so I can keep it on the first post.

@ Thanks to Mac for a quick script edit.
 

Mac

Member

This is a very nice first script...this is going to help loads of people that want to make their own style of equip menu. You could actually have this all in one script by getting it to overwrite the original data of the script...but either way works well.

Congrats!
 

Mac

Member

Just put this above main

Code:
#============================================================
#   Enhanced Equip Window
#------------------------------------------------------------------------------------------------------------------------
#  By Trance
#   Version 1.0
#   January 2nd, 2007 [happy new year!]
#------------------------------------------------------------------------------------------------------------------------
#   This script will allow you to easily customize your equip screen.
#   I simply changed the equip screen around, so it should be
#   fully compatable with more or less everything (but not custom
#   menu systems, of course! =P). I have tried to make this as
#   simple and well organized as possible, so even a complete newb
#   (like myself) can understand it. Note, that the default settings
#   make the equip screen look like it was unchanged--however with
#   all stats displayed.
#============================================================
#  Customization
#------------------------------------------------------------------------------------------------------------------------
#   Okay, this is what you have to change around to create your
#   very own, personalized equipment window!
      $desired_font = "Arial"
      $desired_font_size = 14
#   Odvious, hmm? These are the font, and font size.
      $desired_arrow_style = "→"
#   This is the arrow that will be showing up during equipment
#   changes. You can change it to whatever you want, though
#   other smart choices may be "→", ">>>", or "=>".
      $color_coded_bonuses = true 
#   If this option is set to true, when you are equiping a new item,
#   the arrow pointing to your stat increase will change color 
#   depending on if the stat is going up, down, or staying the same.
#   Note, also that the stat increase also changes color.
      $stat_goes_up_color = Color.new(0, 200, 0)
      $stat_goes_down_color = Color.new(200, 0, 0)
      $stat_stays_the_same_color = Color.new(150, 150, 150)
#   Rather self explanitory. If 'color_coded_bonuses' is off, these
#   color changes do not apply.
      $display_str = [true, 1] # Strength
      $display_dex = [true, 2] # Dexterity
      $display_agi = [true, 3] # Agility
      $display_int = [true, 4] # Intelligence
      $display_atk = [true, 5] # Attack Power
      $display_pdef = [true, 6] # Physical Defense
      $display_mdef = [true, 7] # Magical Defense
#   The settings here that are true will be displayed on the equip
#   screen. The second number is the order in which they will
#   appear. Make sure it is set to '0' if false. Don't make it higher
#   than '7', unless you want a 'crash my game script'. But you odviously
#   wouldn't do this scince there is only seven options.
      $list_start_y_pos = 25
      $seperation_distance = 15
#   This is how far apart the stats that are visible will apear, and
#   how high/low the list will start.
#============================================================
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
class Window_EquipLeft < Window_Base
  def initialize(actor)
    super(0, 64, 272, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $desired_font  # "Equip" left side (Status) window font
    self.contents.font.size = $desired_font_size
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 4, 20)
    if $display_str[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_str[1]), 3)
    end
    if $display_dex[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_dex[1]), 4)
    end
    if $display_agi[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_agi[1]), 5)
    end
    if $display_int[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_int[1]), 6)
    end
    if $display_atk[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_atk[1]), 0)
    end
    if $display_pdef[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 1)
    end
    if $display_mdef[0] == true
      draw_actor_parameter(@actor, 8, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 2)
    end
  
    if @new_str != nil
      if $color_coded_bonuses == true
        if @new_str > @actor.str
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        elsif @new_str == @actor.str
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        elsif @new_str < @actor.str
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
    end
  end
    if @new_dex != nil
      if $color_coded_bonuses == true
        if @new_dex > @actor.dex
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        elsif @new_dex == @actor.dex
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        elsif @new_dex < @actor.dex
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_dex[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_dex[1]), 36, 32, @new_dex.to_s, 2)
    end
  end
    if @new_agi != nil
      if $color_coded_bonuses == true
        if @new_agi > @actor.agi
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        elsif @new_agi == @actor.agi
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        elsif @new_agi < @actor.agi
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_agi[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_agi[1]), 36, 32, @new_agi.to_s, 2)
    end
  end
    if @new_int != nil
      if $color_coded_bonuses == true
        if @new_int > @actor.int
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        elsif @new_int == @actor.int
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        elsif @new_int < @actor.int
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
    end
  end
    if @new_atk != nil
      if $color_coded_bonuses == true
        if @new_atk > @actor.atk
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        elsif @new_atk == @actor.atk
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        elsif @new_atk < @actor.atk
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_atk[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_atk[1]), 36, 32, @new_atk.to_s, 2)
    end
  end
    if @new_pdef != nil
      if $color_coded_bonuses == true
        if @new_pdef > @actor.pdef
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        elsif @new_pdef == @actor.pdef
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        elsif @new_pdef < @actor.pdef
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_pdef[1]), 36, 32, @new_pdef.to_s, 2)
    end
  end
    if @new_mdef != nil
      if $color_coded_bonuses == true
        if @new_mdef > @actor.mdef
          self.contents.font.color = $stat_goes_up_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        elsif @new_mdef == @actor.mdef
          self.contents.font.color = $stat_stays_the_same_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        elsif @new_mdef < @actor.mdef
          self.contents.font.color = $stat_goes_down_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
        end
      elsif
      self.contents.font.color = system_color
      self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 40, 32, $desired_arrow_style, 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_mdef[1]), 36, 32, @new_mdef.to_s, 2)
    end
  end
  end
  #--------------------------------------------------------------------------
  # * Set parameters after changing equipment
  #     new_atk  : attack power after changing equipment
  #     new_pdef : physical defense after changing equipment
  #     new_mdef : magic defense after changing equipment
  #--------------------------------------------------------------------------
  def set_new_parameters(new_str, new_dex, new_agi, new_int, new_atk, new_pdef, new_mdef)
    if @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int or @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
      @new_str = new_str
      @new_dex = new_dex
      @new_agi = new_agi
      @new_int = new_int
      @new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      refresh
    end
  end
end

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

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)
    @item_window5 = Window_EquipItem.new(@actor, 4)
    # 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
    @item_window5.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
    @item_window5.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)
    @item_window5.visible = (@right_window.index == 4)
    # 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
    when 4
      @item_window = @item_window5
    end
    # If right window is active
    if @right_window.active
      # Erase parameters for after equipment change
#============================================================
#   CHANGED!
#============================================================
      @left_window.set_new_parameters(nil, nil, nil,nil,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
#============================================================
#   CHANGED!
#============================================================
      new_str = @actor.str
      new_dex = @actor.dex
      new_agi = @actor.agi
      new_int = @actor.int
      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
#============================================================
#   CHANGED!
#============================================================
      @left_window.set_new_parameters(new_str, new_dex, new_agi, new_int, new_atk, new_pdef, new_mdef)
#============================================================
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @left_window.update
    @right_window.update
    @item_window.update
    refresh
    # If right window is active: call update_right
    if @right_window.active
      update_right
      return
    end
    # If item window is active: call update_item
    if @item_window.active
      update_item
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when right window is active)
  #--------------------------------------------------------------------------
  def update_right
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(2)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If equipment is fixed
      if @actor.equip_fix?(@right_window.index)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Activate item window
      @right_window.active = false
      @item_window.active = true
      @item_window.index = 0
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::R)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To next actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Switch to different equipment screen
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To previous actor
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Switch to different equipment screen
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Activate right window
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play equip SE
      $game_system.se_play($data_system.equip_se)
      # Get currently selected data on the item window
      item = @item_window.item
      # Change equipment
      @actor.equip(@right_window.index, item == nil ? 0 : item.id)
      # Activate right window
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      # Remake right window and item window contents
      @right_window.refresh
      @item_window.refresh
      return
    end
  end
end

All i did was put it into one script and walla simple as. This really could use a little cleaning up still but the basic of what you want you have done. So well done.
 

Mac

Member

XD No problem, but yeah i guess you could clear these up a little with global variables and stuff...but really its fine. Nice work!
 
Very nice first script ^_^ Your comments show that you knew what you were doing when you were makin it. I'll keep an eye on you to see other scripts by you as you get better :)
 
Indepth Code Analysis


Coding
  • Try to limit the use of global variables, you can use a Module with Constants instead. The reason is that using a global variable uses more memory than say an instance variable. And really the only time a global is needed are for $data_ and $game_ objects, and a few other special cases.
    You can use a module to hold constants rather than using a global variable for example your code would look like this
    Code:
    module Equip_Setup
      Font = 'Arial'
      Font_Size = 14
    end
    And then when you want to reference your constant then call it from the module by doing (Module_Name)::(Constant) for example to get the font do Equip_Setup::Font
  • Code Indentation is a bit off in some places
  • Ok what's with this (line in red)
    Code:
        if @new_str != nil and $display_str[0] == true
          if $color_coded_bonuses == true
            if @new_str > @actor.str
              self.contents.font.color = $stat_goes_up_color
              self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
              self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
            elsif @new_str == @actor.str
              self.contents.font.color = $stat_stays_the_same_color
              self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
              self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
            elsif @new_str < @actor.str
              self.contents.font.color = $stat_goes_down_color
              self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
              self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
            end
    [B][COLOR=Red]      elsif[/COLOR][/B]
          self.contents.font.color = system_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_str[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.font.color = normal_color
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_str[1]), 36, 32, @new_str.to_s, 2)
        end
      end
    That should have given a Syntax Error, but if it didn't then it should have, that line should be changed to else and also in other places as well
  • Now in the Scene_Equip you have there, you should remove the methods that were not edited since 1) not needed and 2) it will increase compatibility, so remove all of the methods except refresh as I see you edited that.
  • When checking if an object is true the == true on the if statement is not needed (Just a pointer)
  • You have some code that can be condensed mainly the part where you draw the stat values
    Code:
        if @new_int != nil and $display_int[0] == true
          if $color_coded_bonuses == true
            if @new_int > @actor.int
              self.contents.font.color = $stat_goes_up_color
              self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
              self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
            elsif @new_int == @actor.int
              self.contents.font.color = $stat_stays_the_same_color
              self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
              self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
            elsif @new_int < @actor.int
              self.contents.font.color = $stat_goes_down_color
              self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
              self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
            end
          elsif
          self.contents.font.color = system_color
          self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
          self.contents.font.color = normal_color
          self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
        end
      end
    Now see some parts of this code is always executed and they can be moved outside the if statement, like this
    Code:
    if @new_int != nil and $display_int[0] == true
      if $color_coded_bonuses == true
        if @new_int > @actor.int
          self.contents.font.color = $stat_goes_up_color
        elsif @new_int == @actor.int
          self.contents.font.color = $stat_stays_the_same_color
        elsif @new_int < @actor.int
          self.contents.font.color = $stat_goes_down_color
        end
        self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
        self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
      elsif
        self.contents.font.color = system_color
        self.contents.draw_text(160, $list_start_y_pos+($seperation_distance*$display_int[1]), 40, 32, $desired_arrow_style, 1)
        self.contents.font.color = normal_color
        self.contents.draw_text(200, $list_start_y_pos+($seperation_distance*$display_int[1]), 36, 32, @new_int.to_s, 2)
      end
    end
  • This ties into my last statement I'll tell you about the conditional operator (?)
    The conditional operator is a tertiary operator meaning that it needs three inputs the format is like this
    Code:
    (conditional) ? (if true do this) : (if false do this)
    You can also do put them together
    Code:
    (conditional) ? ((conditional) ? (if true do this) : (if false do this)) : (if false do this)
    This is the same exact thing as doing this
    Code:
    if (condition)
      (if true do this)
    else
     (if false do this)
    end
    and the second looks like so
    Code:
    if condition
      if (condition)
        (if true do this)
      else
        (if false do this)
      end
    else
      (if false do this)
    end
Overall, nice first script with a little more polishing it can be even better I will be looking forward to other scripts by you :)
 

Jason

Awesome Bro

Cool script, I'm definitely using it !
Is there a way you could make it so when you press left and right it flicks through your party members? similar to Final Fantasy X ?
 

Sodon

Member

I was trying to use this with GUILLAUME777's Multi-Slot but it doesn't work right... It seems this script corrects what the MS script does - for example, it tries to find a shield for the second armor slot, even if I've defined that to be a helmet (for someone with only one weapon and no shield slot).
 
Hey...sorry I'm kind of necro posting.

Great script!  But would it be possible to make an optimization option?  I think it's...Phylomortis that has a way of making an optimization button.  And it is just code that you put into the already existing scripts, not a separate script, so I'm thinking it might be pretty easy to implement it into this script...but since I'm an idiot it's not easy for me lol.

I'll try to find the site where I got the code...I can't quite remember where it is.
 

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