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.

Custom Menu Script Please

I will post in the menu request thing when that becomes unlocked, but heres the menu I want for my game:
When you press Esc (or menu assigned button) instead of calling a menu screen, three menu windows come in from the left side, right side and top of the screen.

The top window is only thin, and is where you scroll along, horizontally, to select what you want (Equip, Item etc.), but I don't want the Skill part there. And when you move over it, the selection gets bigger in width and higlights like the current menu does.

The window on the left of the screen should be tall and thin,(but shouldn't take up the whole heigt of the screen) and hosts the player battler graphic (which is always going to be thief03).

The window on the right is actually whats on the menu, it is what you actually function on.

Extra Features:
A bottom window must ALWAYS be up. It just show the party character sprite and its HP and SP in bars.

Windows must have compatibility for window skins, and should be transparent.

Windows should be not much bigger than they need to be. The bottom one only has to have room for 2 party members, nothing else.

Thanks,
BP
 
OK, and here's a legend:
Green = Field, so you can actually see behind.
Blue = These windows are only seen when the menu is called
Yellow = These windows (including gold and step count) are visible at all times, except in battles.

General rundown:
http://img225.imageshack.us/img225/1503/cmsir8.png[/IMG]

Controls (these may be hard to make):
When you scroll along the menu (using left and right arrows) the menu below changes as you move, NOT when you press the action key. Status and skill menu shouldn't be there. When you press the down key, it takes you to the menu itself.

For example, with the equip menu, you pass over it from the top, then press the down key to go to the menu. You equip items like normal, but you have a scrollbox on the right hand of the screen, and you scroll to find the item, this is just to save space. I want the itme menu to have the same scrolling feature, it can be a list that fits about ten items before it starts to scroll.
When you use an item, it asks you to select who to use it on, get rid of the character sprites, just make it the character name showing up in a scroll list.

Player Info: The player information box is a small box that displays the character sprite, and the HP and SP bars. It also displays the characters name, but otherwise no text. Press a command button (e.g C) to go down to the next character, and another one (e.g Z) to go to the previous character. This box also changes to the character you select when equipping a weapon or using a item. (This box is used seen even when the menu is of)

The battler graphic box: This displays the battler graphic of the player selected in the player info box.


Other Info:
Must be compatible with Ccoas UMS and this sideview battle script:
Code:
class Bitmap
if not method_defined?('original_draw_text')
  alias original_draw_text draw_text
  def draw_text(*arg)

    original_color = self.font.color.dup
    self.font.color = Color.new(0, 0, 0, 128)

    if arg[0].is_a?(Rect)
      arg[0].x += 2
      arg[0].y += 2
      self.original_draw_text(*arg)
      arg[0].x -= 2
      arg[0].y -= 2
    else
      arg[0] += 2
      arg[1] += 2
      self.original_draw_text(*arg)
      arg[0] -= 2
      arg[1] -= 2
    end

    self.font.color = original_color
    self.original_draw_text(*arg)

  end
end
def gradation_rect(x, y, width, height, color1, color2, align = 0)
  if align == 0
    for i in x...x + width
      red   = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
      green = color1.green +
              (color2.green - color1.green) * (i - x) / (width - 1)
      blue  = color1.blue +
              (color2.blue - color1.blue) * (i - x) / (width - 1)
      alpha = color1.alpha +
              (color2.alpha - color1.alpha) * (i - x) / (width - 1)
      color = Color.new(red, green, blue, alpha)
      fill_rect(i, y, 1, height, color)
    end
  elsif align == 1
    for i in y...y + height
      red   = color1.red +
              (color2.red - color1.red) * (i - y) / (height - 1)
      green = color1.green +
              (color2.green - color1.green) * (i - y) / (height - 1)
      blue  = color1.blue +
              (color2.blue - color1.blue) * (i - y) / (height - 1)
      alpha = color1.alpha +
              (color2.alpha - color1.alpha) * (i - y) / (height - 1)
      color = Color.new(red, green, blue, alpha)
      fill_rect(x, i, width, 1, color)
    end
  elsif align == 2
    for i in x...x + width
      for j in y...y + height
        red   = color1.red + (color2.red - color1.red) *
                ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        green = color1.green + (color2.green - color1.green) *
                ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        blue  = color1.blue + (color2.blue - color1.blue) *
                ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        alpha = color1.alpha + (color2.alpha - color1.alpha) *
                ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        color = Color.new(red, green, blue, alpha)
        set_pixel(i, j, color)
      end
    end
  elsif align == 3
    for i in x...x + width
      for j in y...y + height
        red   = color1.red + (color2.red - color1.red) *
              ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        green = color1.green + (color2.green - color1.green) *
              ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        blue  = color1.blue + (color2.blue - color1.blue) *
              ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        alpha = color1.alpha + (color2.alpha - color1.alpha) *
              ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
        color = Color.new(red, green, blue, alpha)
        set_pixel(i, j, color)
      end
    end
  end
end
end

module RPG
class Sprite < ::Sprite
  def damage(value, critical)
    dispose_damage
    if value.is_a?(Numeric)
      damage_string = value.abs.to_s
    else
      damage_string = value.to_s
    end
    bitmap = Bitmap.new(160, 48)
    bitmap.font.name = "Arial Black"
    bitmap.font.size = 32
    bitmap.font.color.set(0, 0, 0)
    bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
    bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
    bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
    bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
    if value.is_a?(Numeric) and value < 0
      bitmap.font.color.set(176, 255, 144)
    else
      bitmap.font.color.set(255, 255, 255)
    end
    bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
    if critical
      bitmap.font.size = 20
      bitmap.font.color.set(0, 0, 0)
      bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
      bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
      bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
      bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
      bitmap.font.color.set(255, 255, 255)
      bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
    end
    @_damage_sprite = ::Sprite.new
    @_damage_sprite.bitmap = bitmap
    @_damage_sprite.ox = 80 + self.viewport.ox
    @_damage_sprite.oy = 20 + self.viewport.oy
    @_damage_sprite.x = self.x + self.viewport.rect.x
    @_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
    @_damage_sprite.z = 3000
    @_damage_duration = 40
  end
  def animation(animation, hit)
    dispose_animation
    @_animation = animation
    return if @_animation == nil
    @_animation_hit = hit
    @_animation_duration = @_animation.frame_max
    animation_name = @_animation.animation_name
    animation_hue = @_animation.animation_hue
    bitmap = RPG::Cache.animation(animation_name, animation_hue)
    if @@_reference_count.include?(bitmap)
      @@_reference_count[bitmap] += 1
    else
      @@_reference_count[bitmap] = 1
    end
    @_animation_sprites = []
    if @_animation.position != 3 or not @@_animations.include?(animation)
      for i in 0..15
        sprite = ::Sprite.new
        sprite.bitmap = bitmap
        sprite.visible = false
        @_animation_sprites.push(sprite)
      end
      unless @@_animations.include?(animation)
        @@_animations.push(animation)
      end
    end
    update_animation
  end
  def loop_animation(animation)
    return if animation == @_loop_animation
    dispose_loop_animation
    @_loop_animation = animation
    return if @_loop_animation == nil
    @_loop_animation_index = 0
    animation_name = @_loop_animation.animation_name
    animation_hue = @_loop_animation.animation_hue
    bitmap = RPG::Cache.animation(animation_name, animation_hue)
    if @@_reference_count.include?(bitmap)
      @@_reference_count[bitmap] += 1
    else
      @@_reference_count[bitmap] = 1
    end
    @_loop_animation_sprites = []
    for i in 0..15
      sprite = ::Sprite.new
      sprite.bitmap = bitmap
      sprite.visible = false
      @_loop_animation_sprites.push(sprite)
    end
    update_loop_animation
  end
  def animation_set_sprites(sprites, cell_data, position)
    for i in 0..15
      sprite = sprites[i]
      pattern = cell_data[i, 0]
      if sprite == nil or pattern == nil or pattern == -1
        sprite.visible = false if sprite != nil
        next
      end
      sprite.visible = true
      sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
      if position == 3
        if self.viewport != nil
          sprite.x = self.viewport.rect.width / 2
          sprite.y = self.viewport.rect.height - 160
        else
          sprite.x = 320
          sprite.y = 240
        end
      else
        sprite.x = self.x + self.viewport.rect.x -
                    self.ox + self.src_rect.width / 2
        sprite.y = self.y + self.viewport.rect.y -
                    self.oy + self.src_rect.height / 2
        sprite.y -= self.src_rect.height / 4 if position == 0
        sprite.y += self.src_rect.height / 4 if position == 2
      end
      sprite.x += cell_data[i, 1]
      sprite.y += cell_data[i, 2]
      sprite.z = 2000
      sprite.ox = 96
      sprite.oy = 96
      sprite.zoom_x = cell_data[i, 3] / 100.0
      sprite.zoom_y = cell_data[i, 3] / 100.0
      sprite.angle = cell_data[i, 4]
      sprite.mirror = (cell_data[i, 5] == 1)
      sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
      sprite.blend_type = cell_data[i, 7]
    end
  end
end
end

class Game_Actor < Game_Battler
  def screen_x
    if self.index != nil
    n_split = [($game_party.actors.length * 0.5).ceil, 4].min
    case n_split
    when 1
      n_index = self.index * 2
    when 2
      if self.index < ($game_party.actors.length - 2)
        n_index = 0.5 + (2 * self.index)
      else
        if $game_party.actors.length == 3 then
          n_index = (self.index * 2) + 2
        elsif $game_party.actors.length == 4 then
          n_index = self.index * 2
        end
      end
    when 3
        n_index = self.index + (0.25 * (self.index + 1))
      if $game_party.actors.length == 5
      if self.index < 2
        n_index = self.index + (0.25 * (self.index + 1))
      else
        n_index = self.index + (0.25 * (self.index + 2)) + 1
      end
      end
    when 4
      n_index = self.index
      if $game_party.actors.length == 7
      if self.index < 3
        n_index = self.index
      else
        n_index = self.index + 1
      end
      end
    end
      return (n_index - ((n_index / 4).floor) * 4) * ((160 / (4)) / 5) + 480 + ((n_index / 4).floor * 60)
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y
    n_split = [($game_party.actors.length * 0.5).ceil, 4].min
    case n_split
    when 1
      n_index = self.index * 2
    when 2
      if self.index < ($game_party.actors.length - 2)
        n_index = 0.5 + (2 * self.index)
      else
        if $game_party.actors.length == 3 then
          n_index = (self.index * 2) + 2
        elsif $game_party.actors.length == 4 then
          n_index = self.index * 2
        end
      end
    when 3
        n_index = self.index + (0.25 * (self.index + 1))
      if $game_party.actors.length == 5
      if self.index < 2
        n_index = self.index + (0.25 * (self.index + 1))
      else
        n_index = self.index + (0.25 * (self.index + 2)) + 1
      end
      end
    when 4
      n_index = self.index
      if $game_party.actors.length == 7
      if self.index < 3
        n_index = self.index
      else
        n_index = self.index + 1
      end
      end
    end
    return (n_index - ((n_index / 4).floor) * 4) * ((160 / (4)) * 1.6) + 270 - ((n_index / 4).floor * (110 - (4 * 20)))
end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    # パーティ内の並び順から Z 座標を計算して返す
    if self.index != nil
      return self.index
    else
      return 0
    end
  end
end

class Game_Enemy < Game_Battler
  def screen_x
    n_split = [($game_troop.enemies.length * 0.5).ceil, 4].min
    case n_split
    when 1
      n_index = self.index * 2
    when 2
      if self.index < ($game_troop.enemies.length - 2)
        n_index = 0.5 + (2 * self.index)
      else
        if $game_troop.enemies.length == 3 then
          n_index = (self.index * 2) + 2
        elsif $game_troop.enemies.length == 4 then
          n_index = self.index * 2
        end
      end
    when 3
        n_index = self.index + (0.25 * (self.index + 1))
      if $game_troop.enemies.length == 5
      if self.index < 2
        n_index = self.index + (0.25 * (self.index + 1))
      else
        n_index = self.index + (0.25 * (self.index + 2)) + 2
      end
      end
    when 4
      n_index = self.index
      if $game_troop.enemies.length == 7
      if self.index < 3
        n_index = self.index
      else
        n_index = self.index + 1
      end
      end
    end
    return (n_index - ((n_index / 4).floor) * 4) * ((-160 / (4)) / 5) + 160 - ((n_index / 4).floor * 60)
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Y 座標の取得
  #--------------------------------------------------------------------------
  def screen_y
    n_split = [($game_troop.enemies.length * 0.5).ceil, 4].min
    case n_split
    when 1
      n_index = self.index * 2
    when 2
      if self.index < ($game_troop.enemies.length - 2)
        n_index = 0.5 + (2 * self.index)
      else
        if $game_troop.enemies.length == 3 then
          n_index = (self.index * 2) + 2
        elsif $game_troop.enemies.length == 4 then
          n_index = self.index * 2
        end
      end
    when 3
        n_index = self.index + (0.25 * (self.index + 1))
      if $game_troop.enemies.length == 5
      if self.index < 2
        n_index = self.index + (0.25 * (self.index + 1))
      else
        n_index = self.index + (0.25 * (self.index + 2)) + 1
      end
      end
    when 4
      n_index = self.index
      if $game_troop.enemies.length == 7
      if self.index < 3
        n_index = self.index
      else
        n_index = self.index + 1
      end
      end
    end
    return (n_index - ((n_index / 4).floor) * 4) * ((160 / (4)) * 1.6) + 270 - ((n_index / 4).floor * (110 - (4 * 20)))
  end
  #--------------------------------------------------------------------------
  # ● バトル画面 Z 座標の取得
  #--------------------------------------------------------------------------
  def screen_z
    return @member_index + 1
  end
end

#==============================================================================
# â–  Sprite_Battler
#------------------------------------------------------------------------------
#  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
# スプライトの状態を自動的に変化させます。
#==============================================================================

class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :battler                  # バトラー
  attr_accessor :moving        # Is the sprite moving?
  attr_reader   :index
  attr_accessor :target_index
  attr_accessor :direction
  attr_accessor :pattern
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     viewport : ビューポート
  #     battler  : バトラー (Game_Battler)
  #--------------------------------------------------------------------------
  def initialize(viewport, battler = nil)
    super(viewport)
    change
    @old = Graphics.frame_count  # For the delay method
    @goingup = true    # Increasing animation? (if @rm2k_mode is true)
    @once = false      # Is the animation only played once?
    @animated = true   # Used to stop animation when @once is true
    self.opacity = 0
    @index = 0
    @pattern_b = 0
    @counter_b = 0
    @trans_sprite = Sprite.new
    @trans_sprite.opacity = 0
    @bar_hp_sprite = Sprite.new
    @bar_hp_sprite.bitmap = Bitmap.new(64, 10)
    @bar_sp_sprite = Sprite.new
    @bar_sp_sprite.bitmap = Bitmap.new(64, 10)
    @color1 = Color.new(0, 0, 0, 192)
    @color2 = Color.new(255, 255, 192, 192)
    @color3 = Color.new(0, 0, 0, 192)
    @color4 = Color.new(64, 0, 0, 192)
    @old_hp = -1
    @old_sp = -1
    @battler = battler
    @battler_visible = false
    @first = true
    @pattern = 0
    if $target_index == nil
      $target_index = 0
    end
    @battler.is_a?(Game_Enemy) ? enemy_pose(0, 1) : pose(0, 1)
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    if self.bitmap != nil
      self.bitmap.dispose
    end
    if @trans_sprite.bitmap != nil
      @trans_sprite.bitmap.dispose
    end
    @trans_sprite.dispose
    @bar_hp_sprite.bitmap.dispose
    @bar_hp_sprite.dispose
    @bar_sp_sprite.bitmap.dispose
    @bar_sp_sprite.dispose
    super
  end
  
  def change(frames = 0, delay = 0, offx = 0, offy = 0, startf = 0, once = false)
    @frames = frames
    @delay = delay
    @offset_x, @offset_y = offx, offy
    @current_frame = startf
    @once = once
    @goingup = true
    @animated = true
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    bar_check = true if @_damage_duration == 1
    super
    @trans_sprite.blend_type = self.blend_type
    @trans_sprite.color = self.color
    if @_collapse_duration > 0
      @trans_sprite.opacity = self.opacity
    else
      @trans_sprite.opacity = [self.opacity, 160].min
    end
    if (@_damage_duration == 0 and bar_check == true) or @first == true
      @first = false if @first == true
      bar_check = false
      @bar_must_change = true
    end
    @bar_hp_sprite.opacity = self.opacity
    @bar_sp_sprite.opacity = self.opacity
    # バトラーが nil の場合
    if @battler == nil
      self.bitmap = nil
      @trans_sprite.bitmap = nil
      loop_animation(nil)
      return
    end
    # ファイル名か色相が現在のものと異なる場合
    if @battler.battler_name != @battler_name or
       @battler.battler_hue != @battler_hue
      # ビットマップを取得、設定
      @battler_name = @battler.battler_name
      @battler_hue = @battler.battler_hue
      if @battler.is_a?(Game_Actor)
        @battler_name = @battler.character_name
        @battler_hue = @battler.character_hue
        @direction = 4
      else
        @direction = 6
      end
        self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
        @width = bitmap.width / 4
        @height = bitmap.height / 4
        @frame_width = @width
        @frame_height = @height
        self.ox = @width / 2
        self.oy = @height
        @pattern = @current_frame
        @direction = @offset_y
        sx = @pattern * @width
        sy = (@direction - 2) / 2 * @height
        self.src_rect.set(sx, sy, @width, @height)
        @current_frame = (@current_frame + 1) unless @frames == 0
        @animated = false if @current_frame == @frames and @once
        @current_frame %= @frames
        @trans_sprite.bitmap = self.bitmap
        @trans_sprite.ox = self.ox
        @trans_sprite.oy = self.oy
        @trans_sprite.src_rect.set(sx, sy, @width, @height)
      # 戦闘不能または隠れ状態なら不透明度を 0 にする
      if @battler.dead? or @battler.hidden
        self.opacity = 0
        @trans_sprite.opacity = 0
        @bar_hp_sprite.opacity = 0
        @bar_sp_sprite.opacity = 0
      end
    self.x = @battler.screen_x
    self.y = @battler.screen_y
    self.z = @battler.screen_z
  end
  change_sp_bar if @old_sp != @battler.sp
  if delay(@delay) and @animated
      @pattern = @current_frame
      @direction = @offset_y
      sx = @pattern * @width
      sy = (@direction - 2) / 2 * @height
      self.src_rect.set(sx, sy, @width, @height)
      @current_frame = (@current_frame + 1) unless @frames == 0
      @animated = false if @current_frame == @frames and @once
      @current_frame %= @frames
      @trans_sprite.ox = self.ox
      @trans_sprite.oy = self.oy
      @trans_sprite.src_rect.set(sx, sy, @width, @height)
    end
    # アニメーション ID が現在のものと異なる場合
    if @battler.damage == nil and
       @battler.state_animation_id != @state_animation_id
      @state_animation_id = @battler.state_animation_id
      loop_animation($data_animations[@state_animation_id])
    end
    # 表示されるべきアクターの場合
    #if @battler.is_a?(Game_Actor) and @battler_visible
      # メインフェーズでないときは不透明度をやや下げる
      #if $game_temp.battle_main_phase
        #self.opacity += 3 if self.opacity < 255
      #else
        #self.opacity -= 3 if self.opacity > 207
      #end
    #end
    # 明滅
    if @battler.blink
      blink_on
    else
      blink_off
    end
    # 不可視の場合
    unless @battler_visible
      # 出現
      if not @battler.hidden and not @battler.dead? and
         (@battler.damage == nil or @battler.damage_pop)
        appear
        @battler_visible = true
      end
    end
    # 可視の場合
    if @battler_visible
      # 逃走
      if @battler.hidden
        $game_system.se_play($data_system.escape_se)
        escape
        @trans_sprite.opacity = 0
        @battler_visible = false
      end
      # 白フラッシュ
      if @battler.white_flash
        whiten
        @battler.white_flash = false
      end
      # アニメーション
      if @battler.animation_id != 0
        animation = $data_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
      end
      # ダメージ
      if @battler.damage_pop
        damage(@battler.damage, @battler.critical)
        @battler.damage = nil
        @battler.critical = false
        @battler.damage_pop = false
      end
      if @bar_must_change == true
        @bar_must_change = false
        if @old_hp != @battler.hp
          change_hp_bar
        end
        if @battler.damage == nil and @battler.dead?
          if @battler.is_a?(Game_Enemy)
            $game_system.se_play($data_system.enemy_collapse_se)
          else
            $game_system.se_play($data_system.actor_collapse_se)
          end
          collapse
          @battler_visible = false
        end
      end
    end
    # スプライトの座標を設定
    @trans_sprite.x = self.x
    @trans_sprite.y = self.y
    @trans_sprite.z = self.z
    @bar_hp_sprite.x = @battler.screen_x - 32
    @bar_hp_sprite.y = @battler.screen_y - (@height +18) if @height != nil
    @bar_hp_sprite.z = 100
    @bar_sp_sprite.x = @battler.screen_x - 32
    @bar_sp_sprite.y = @battler.screen_y - (@height + 8) if @height != nil
    @bar_sp_sprite.z = 100
  end
  
  #--------------------------------------------------------------------------
  # - Move the sprite
  #   x : X coordinate of the destination point
  #   y : Y coordinate of the destination point
  #   speed : Speed of movement (0 = delayed, 1+ = faster)
  #   delay : Movement delay if speed is at 0
  #--------------------------------------------------------------------------
  def move(x, y, speed = 1, delay = 0)
    @destx = x
    @desty = y
    @move_speed = speed
    @move_delay = delay
    @move_old = Graphics.frame_count
    @moving = true
  end
  
  #--------------------------------------------------------------------------
  # - Move sprite to destx and desty
  #--------------------------------------------------------------------------
  def update_move
    return unless @moving
    movinc = @move_speed == 0 ? 1 : @move_speed
    if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0
      self.x += movinc if self.x < @destx
      self.x -= movinc if self.x > @destx
      self.y += movinc if self.y < @desty
      self.y -= movinc if self.y > @desty
      @move_old = Graphics.frame_count
    end
    if @move_speed > 1  # Check if sprite can't reach that point
      self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and
                         (@destx - self.x).abs <= @move_speed
      self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and
                         (@desty - self.y).abs <= @move_speed
    end
    if self.x == @destx and self.y == @desty
      @moving = false
    end
  end
  
  #--------------------------------------------------------------------------
  # - Pause animation, but still updates movement
  #   frames : Number of frames
  #--------------------------------------------------------------------------
  def delay(frames)
    update_move
    if (Graphics.frame_count - @old >= frames)
      @old = Graphics.frame_count
      return true
    end
    return false
  end
  
  def change_hp_bar
    j = false
   @old_hp = @battler.hp if @old_hp == -1
    i = @old_hp
    loop do
      i -= 10
      if i < @battler.hp
        i = @battler.hp
        j = true
      end
      rate = i.to_f / @battler.maxhp
      @color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
      @color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
      @bar_hp_sprite.bitmap.clear
      @bar_hp_sprite.bitmap.fill_rect(0, 0, 64, 10, @color1)
      @bar_hp_sprite.bitmap.fill_rect(1, 1, 62, 8, @color2)
      @bar_hp_sprite.bitmap.gradation_rect(2, 2, 60, 6, @color3, @color4, 1)
      #@bar_hp_sprite.bitmap.fill_rect(2, 2, 60, 6, @color3)
      @bar_hp_sprite.bitmap.gradation_rect(2, 2, 64 * rate - 4, 6, @color5, @color6, 0)
      #@bar_hp_sprite.bitmap.fill_rect(2, 2, 64 * rate - 4, 6, @color5)
      @bar_hp_sprite.opacity = self.opacity
      Graphics.update
      if j == true
        j = false
        break
      end
    end
    @old_hp = @battler.hp
  end
  
  def change_sp_bar
    j = false
   @old_sp = @battler.sp if @old_sp == -1
    i = @old_sp
    loop do
      i -= 10
      if i < @battler.sp
        i = @battler.sp
        j = true
      end
      rate = i.to_f / @battler.maxsp
      @color7 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
      @color8 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
      @bar_sp_sprite.bitmap.clear
      @bar_sp_sprite.bitmap.fill_rect(0, 0, 64, 10, @color1)
      @bar_sp_sprite.bitmap.fill_rect(1, 1, 62, 8, @color2)
      @bar_sp_sprite.bitmap.gradation_rect(2, 2, 60, 6, @color3, @color4, 1)
      #@bar_hp_sprite.bitmap.fill_rect(2, 2, 60, 6, @color3)
      @bar_sp_sprite.bitmap.gradation_rect(2, 2, 64 * rate - 4, 6, @color7, @color8, 0)
      #@bar_hp_sprite.bitmap.fill_rect(2, 2, 64 * rate - 4, 6, @color5)
      @bar_sp_sprite.opacity = self.opacity
      Graphics.update
      if j == true
        j = false
        break
      end
    end
    @old_sp = @battler.sp
  end
  
  def enemy                                             #
    $target_index += $game_troop.enemies.size
    $target_index %= $game_troop.enemies.size
    return $game_troop.enemies[$target_index]           #
  end                                                   #
  
  def actor                                             #
    $target_index += $game_party.actors.size
    $target_index %= $game_party.actors.size
    return $game_party.actors[$target_index]            #
  end
  
  def index=(index)
    @index = index
    update
  end
  
    def pose(number, frames = 4)
    case number
    when 0
      change(frames, 4, 0, 4, 0)
    when 1
      change(frames, 4, 0, 4)
    when 2
      change(frames, 4, 0, 6)
    else
      change(frames, 4, 0, 0, 0)
    end
  end
  
    def enemy_pose(number ,enemy_frames = 4)
    case number
    when 0
      change(enemy_frames, 4, 0, 6, 0)
    when 1
      change(enemy_frames, 4, 0, 4)
    when 2
      change(enemy_frames, 4, 0, 6)
    else
      change(enemy_frames, 4, 0, 0, 0)
    end
  end
  
  def default_pose
    pose(0, 1)
  end
end

#==============================================================================
# â–  Spriteset_Battle
#------------------------------------------------------------------------------
#  バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
# スの内部で使用されます。
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_reader   :viewport1                # エネミー側のビューポート
  attr_reader   :viewport2                # アクター側のビューポート
  attr_accessor :actor_sprites
  attr_accessor :enemy_sprites
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    # ビューポートを作成
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport4 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    if $game_temp.battleback_name == ""
    @battleback_sprite = nil
    @tilemap = Tilemap.new(@viewport1)
    @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
    for i in 0..6
      autotile_name = $game_map.autotile_names[i]
      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
    end
    @tilemap.map_data = $game_map.data
    @tilemap.priorities = $game_map.priorities
    else
    # バトルバックスプライトを作成
    @tilemap = nil
    @battleback_sprite = Sprite.new(@viewport1)
    end
    # エネミースプライトを作成
    @enemy_sprites = []
    for enemy in $game_troop.enemies#.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
    # アクタースプライトを作成
    @actor_sprites = []
    for j in 0..7
        # ƒAƒNƒ^?[ƒXƒvƒ‰ƒCƒg‚?’?‰?
        @actor_sprites.push(Sprite_Battler.new(@viewport1, $game_party.actors[j]))
    end
    # 天候を作成
    @weather = RPG::Weather.new(@viewport1)
    # ピクチャスプライトを作成
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures[i]))
    end
    # タイマースプライトを作成
    @timer_sprite = Sprite_Timer.new
    # フレーム更新
    update
  end
  #--------------------------------------------------------------------------
  # ● 解放
  #--------------------------------------------------------------------------
  def dispose
    if @tilemap != nil
    # タイルマップを解放
    @tilemap.tileset.dispose
    for i in 0..6
      @tilemap.autotiles[i].dispose
    end
    @tilemap.dispose
    end
    # バトルバックスプライトを解放
    if @battleback_sprite != nil
    # バトルバックビットマップが存在していたら解放
    if @battleback_sprite.bitmap != nil
      @battleback_sprite.bitmap.dispose
    end
    @battleback_sprite.dispose
    end
    # エネミースプライト、アクタースプライトを解放
    for sprite in @enemy_sprites + @actor_sprites
      sprite.dispose
    end
    # 天候を解放
    @weather.dispose
    # ピクチャスプライトを解放
    for sprite in @picture_sprites
      sprite.dispose
    end
    # タイマースプライトを解放
    @timer_sprite.dispose
    # ビューポートを解放
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    @viewport4.dispose
  end
  #--------------------------------------------------------------------------
  # ● エフェクト表示中判定
  #--------------------------------------------------------------------------
  def effect?
    # エフェクトが一つでも表示中なら true を返す
    for sprite in @enemy_sprites + @actor_sprites
      return true if sprite.effect?
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # バトルバックのファイル名が現在のものと違う場合
    if @battleback_sprite != nil
    if @battleback_name != $game_temp.battleback_name
      @battleback_name = $game_temp.battleback_name
      if @battleback_sprite.bitmap != nil
        @battleback_sprite.bitmap.dispose
      end
      bg_bitmap = RPG::Cache.battleback(@battleback_name)
      bg_bitmap_stretch = Bitmap.new(640, 480)
      bg_bitmap_stretch.stretch_blt(Rect.new(0, 0, 640, 480), bg_bitmap, bg_bitmap.rect)
      @battleback_sprite.bitmap = bg_bitmap_stretch
    end
    end
    if @tilemap != nil
    @tilemap.ox = $game_map.display_x / 4
    @tilemap.oy = $game_map.display_y / 4
    @tilemap.update
    end
    # バトラースプライトを更新
    for sprite in @enemy_sprites + @actor_sprites
      sprite.update
    end
    # 天候グラフィックを更新
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.update
    # ピクチャスプライトを更新
    for sprite in @picture_sprites
      sprite.update
    end
    # タイマースプライトを更新
    @timer_sprite.update
    # 画面の色調とシェイク位置を設定
    @viewport1.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake
    # 画面のフラッシュ色を設定
    @viewport4.color = $game_screen.flash_color
    # ビューポートを更新
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
end

#==============================================================================
# â–  Window_Command
#------------------------------------------------------------------------------
#  一般的なコマンド選択を行うウィンドウです。
#==============================================================================

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #     width    : ウィンドウの幅
  #     commands : コマンド文字列の配列
  #--------------------------------------------------------------------------
  def initialize(width, commands, column_max = 1, style = 0, inf_scroll = 1)
    # コマンドの個数からウィンドウの高さを算出
    super(0, 0, width, (commands.size * 1.0 / column_max).ceil * 32 + 32)
    @inf_scroll = inf_scroll
    @item_max = commands.size
    @commands = commands
    @column_max = column_max
    @style = style
    self.contents = Bitmap.new(width - 32, (@item_max * 1.0 / @column_max).ceil * 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # ● 項目の描画
  #     index : 項目番号
  #     color : 文字色
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index%@column_max * (self.width / @column_max) + 4, 32 * (index/@column_max), self.width / @column_max - 40, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], @style)
  end
  #--------------------------------------------------------------------------
  # ● 項目の無効化
  #     index : 項目番号
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  
  def update_help
    @help_window.set_actor($game_party.actors[$scene.actor_index])
  end
end

#==============================================================================
# â–  Arrow_Enemy
#------------------------------------------------------------------------------
#  エネミーを選択させるためのアローカーソルです。このクラスは Arrow_Base クラ
# スを継承します。
#==============================================================================

class Arrow_Enemy < Arrow_Base
  #--------------------------------------------------------------------------
  # ● カーソルが指しているエネミーの取得
  #--------------------------------------------------------------------------
  def enemy
    return $game_troop.enemies[@index]
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    # 存在しないエネミーを指していたら飛ばす
    $game_troop.enemies.size.times do
      break if self.enemy.exist?
      @index += 1
      @index %= $game_troop.enemies.size
    end
    # カーソル右
    if Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += 1
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
    # カーソル左
    if Input.repeat?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += $game_troop.enemies.size - 1
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
    if Input.repeat?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += ((($game_troop.enemies.length) * 0.5).ceil)
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
    if Input.repeat?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += $game_troop.enemies.size - ((($game_troop.enemies.length) * 0.5).ceil)
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
    # スプライトの座標を設定
    if self.enemy != nil
      self.x = self.enemy.screen_x + 4
      self.y = self.enemy.screen_y + 36
      self.z = self.enemy.screen_z + 1
    end
  end
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    # ヘルプウィンドウにエネミーの名前とステートを表示
    @help_window.set_enemy(self.enemy)
  end
end

#==============================================================================
# â–  Arrow_Actor
#------------------------------------------------------------------------------
#  アクターを選択させるためのアローカーソルです。このクラスは Arrow_Base クラ
# スを継承します。
#==============================================================================

class Arrow_Actor < Arrow_Base
  #--------------------------------------------------------------------------
  # ● カーソルが指しているアクターの取得
  #--------------------------------------------------------------------------
  def actor
    return $game_party.actors[@index]
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    # カーソル右
    if Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      @index += 1
      @index %= $game_party.actors.size
    end
    # カーソル左
    if Input.repeat?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      @index += $game_party.actors.size - 1
      @index %= $game_party.actors.size
    end
    if Input.repeat?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @index += ($game_party.actors.length * 0.5).ceil
      @index %= $game_party.actors.size
    end
    # カーソル左
    if Input.repeat?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @index += $game_party.actors.size - (($game_party.actors.length * 0.5).ceil)
      @index %= $game_party.actors.size
    end
    # スプライトの座標を設定
    if self.actor != nil
      self.x = self.actor.screen_x
      self.y = self.actor.screen_y + 36
      self.z = self.actor.screen_z + 1
    end
  end
  #--------------------------------------------------------------------------
  # ● ヘルプテキスト更新
  #--------------------------------------------------------------------------
  def update_help
    # ヘルプウィンドウにアクターのステータスを表示
    @help_window.set_actor(self.actor)
  end
end

class Scene_Battle
  attr_accessor :actor_index
  def main
    # 戦闘用の各種一時データを初期化
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # バトルイベント用インタプリタを初期化
    $game_system.battle_interpreter.setup(nil, 0)
    # トループを準備
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # アクターコマンドウィンドウを作成
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(640, [s1, s2, s3, s4], 4)
    @actor_command_window.y = 64
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # その他のウィンドウを作成
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    #@status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # スプライトセットを作成
    @spriteset = Spriteset_Battle.new
    # ウェイトカウントを初期化
    @wait_count = 0
    # トランジション実行
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition)
    end
    # プレバトルフェーズ開始
    start_phase1
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # マップをリフレッシュ
    $game_map.refresh
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose
    #@status_window.dispose
    @message_window.dispose
    if @skill_window != nil
      @skill_window.dispose
    end
    if @item_window != nil
      @item_window.dispose
    end
    if @result_window != nil
      @result_window.dispose
    end
    # スプライトセットを解放
    @spriteset.dispose
    # タイトル画面に切り替え中の場合
    if $scene.is_a?(Scene_Title)
      # 画面をフェードアウト
      Graphics.transition
      Graphics.freeze
    end
    # 戦闘テストからゲームオーバー画面以外に切り替え中の場合
    if $BTEST and not $scene.is_a?(Scene_Gameover)
      $scene = nil
    end
  end
  
  def update
    # バトルイベント実行中の場合
    if $game_system.battle_interpreter.running?
      # インタプリタを更新
      $game_system.battle_interpreter.update
      # アクションを強制されているバトラーが存在しない場合
      if $game_temp.forcing_battler == nil
        # バトルイベントの実行が終わった場合
        unless $game_system.battle_interpreter.running?
          # 戦闘継続の場合、バトルイベントのセットアップを再実行
          unless judge
            setup_battle_event
          end
        end
        # アフターバトルフェーズでなければ
        if @phase != 5
          # ステータスウィンドウをリフレッシュ
          #@status_window.refresh
        end
      end
    end
    # システム (タイマー)、画面を更新
    $game_system.update
    $game_screen.update
    # タイマーが 0 になった場合
    if $game_system.timer_working and $game_system.timer == 0
      # バトル中断
      $game_temp.battle_abort = true
    end
    # ウィンドウを更新
    @help_window.update
    @party_command_window.update
    @actor_command_window.update
    #@status_window.update
    @message_window.update
    # スプライトセットを更新
    @spriteset.update
    # トランジション処理中の場合
    if $game_temp.transition_processing
      # トランジション処理中フラグをクリア
      $game_temp.transition_processing = false
      # トランジション実行
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # メッセージウィンドウ表示中の場合
    if $game_temp.message_window_showing
      return
    end
    # エフェクト表示中の場合
    if @spriteset.effect?
      return
    end
    # ゲームオーバーの場合
    if $game_temp.gameover
      # ゲームオーバー画面に切り替え
      $scene = Scene_Gameover.new
      return
    end
    # タイトル画面に戻す場合
    if $game_temp.to_title
      # タイトル画面に切り替え
      $scene = Scene_Title.new
      return
    end
    # バトル中断の場合
    if $game_temp.battle_abort
      # バトル開始前の BGM に戻す
      $game_system.bgm_play($game_temp.map_bgm)
      # バトル終了
      battle_end(1)
      return
    end
    # ウェイト中の場合
    if @wait_count > 0
      # ウェイトカウントを減らす
      @wait_count -= 1
      return
    end
    
    # this one holds the battle while the player moves
    for actor in @spriteset.actor_sprites
      if actor.moving
        return
      end
    end
    # and this one is for the enemy... 
    for enemy in @spriteset.enemy_sprites
      if enemy.moving# and $game_system.animated_enemy
        return
      end
    end
    # アクションを強制されているバトラーが存在せず、
    # かつバトルイベントが実行中の場合
    if $game_temp.forcing_battler == nil and
       $game_system.battle_interpreter.running?
      return
    end
    # フェーズによって分岐
    case @phase
    when 1  # プレバトルフェーズ
      update_phase1
    when 2  # パーティコマンドフェーズ
      update_phase2
    when 3  # アクターコマンドフェーズ
      update_phase3
    when 4  # メインフェーズ
      update_phase4
    when 5  # アフターバトルフェーズ
      update_phase5
    end
  end
  
  def start_phase2
    # フェーズ 2 に移行
    @phase = 2
    # アクターを非選択状態に設定
    @actor_index = -1
    @active_battler = nil
    # パーティコマンドウィンドウを有効化
    @party_command_window.active = true
    @party_command_window.visible = true
    # アクターコマンドウィンドウを無効化
    @actor_command_window.active = false
    @actor_command_window.visible = false
    @help_window.visible = false
    # メインフェーズフラグをクリア
    $game_temp.battle_main_phase = false
    # パーティ全員のアクションをクリア
    $game_party.clear_actions
    # コマンド入力不可能な場合
    unless $game_party.inputable?
      # メインフェーズ開始
      start_phase4
    end
  end
  
  def update_phase2_escape
    # エネミーの素早さ平均値を計算
    enemies_agi = 0
    enemies_number = 0
    for enemy in $game_troop.enemies
      if enemy.exist?
        enemies_agi += enemy.agi
        enemies_number += 1
      end
    end
    if enemies_number > 0
      enemies_agi /= enemies_number
    end
    # アクターの素早さ平均値を計算
    actors_agi = 0
    actors_number = 0
    for actor in $game_party.actors
      if actor.exist?
        actors_agi += actor.agi
        actors_number += 1
      end
    end
    if actors_number > 0
      actors_agi /= actors_number
    end
    # 逃走成功判定
    success = rand(100) < 50 * actors_agi / enemies_agi
    # 逃走成功の場合
    if success
      # 逃走 SE を演奏
      $game_system.se_play($data_system.escape_se)
        for actor in $game_party.actors
          @spriteset.actor_sprites[actor.index].pose(2)
          @spriteset.actor_sprites[actor.index].move(660, actor.screen_y, 10)
        end
        check = escape_move
      until check == false
        @spriteset.update
        Graphics.update
        check = escape_move
      end
      # バトル開始前の BGM に戻す
      $game_system.bgm_play($game_temp.map_bgm)
      # バトル終了
      battle_end(1)
    # 逃走失敗の場合
    else
      # パーティ全員のアクションをクリア
      $game_party.clear_actions
      # メインフェーズ開始
      start_phase4
    end
  end
  
  def escape_move
    for actor in @spriteset.actor_sprites
      if actor.moving
        return true
      end
    end
    return false
  end
  
  def start_phase5
    # フェーズ 5 に移行
    @phase = 5
    # バトル終了 ME を演奏
    $game_system.me_play($game_system.battle_end_me)
    # バトル開始前の BGM に戻す
    $game_system.bgm_play($game_temp.map_bgm)
    # EXP、ゴールド、トレジャーを初期化
    exp = 0
    gold = 0
    treasures = []
    # ループ
    for enemy in $game_troop.enemies
      # エネミーが隠れ状態でない場合
      unless enemy.hidden
        # 獲得 EXP、ゴールドを追加
        exp += enemy.exp
        gold += enemy.gold
        # トレジャー出現判定
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    # トレジャーの数を 6 個までに限定
    treasures = treasures[0..5]
    # EXP 獲得
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          #@status_window.level_up(i)
        end
      end
    end
    # ゴールド獲得
    $game_party.gain_gold(gold)
    # トレジャー獲得
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # バトルリザルトウィンドウを作成
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # ウェイトカウントを設定
    @phase5_wait_count = 100
  end
  
  #--------------------------------------------------------------------------
  # ● フレーム更新 (アフターバトルフェーズ)
  #--------------------------------------------------------------------------
  def update_phase5
    # ウェイトカウントが 0 より大きい場合
    if @phase5_wait_count > 0
      # ウェイトカウントを減&
 
Im working on this:
class Window_MenuCommand < Window_Selectable
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 4
@column_max = 4
@commands = ["Item", "Equip", "Save", "Exit"]
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index)
x = 4 + index * 160
self.contents.draw_text(x, 0, 128, 32, @commands[index])
end
end

class Window_PlayerInfo < Window_Base
def initialize(actor)
super(0, 0, 240, 96)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = $game_party.actors[actor]
refresh
self.active = false
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
x = 48
y = 0
draw_actor_graphic(@actor, x - 30, y + 50)
draw_actor_hp(@actor, x, y)
draw_actor_sp(@actor, x, y + 24)
end
end

class Window_Battler < Window_Base
def initialize(actor)
super(0,64,160,240)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = $game_party.actors[actor]
update
end
def update
bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(64 - cw / 2,192 - ch, bitmap, src_rect)
end
end

class Window_Item < Window_Selectable
def initialize
super(320, 64, 320, 320)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % @column_max * (288 + 32)
y = index / @column_max * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
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
end

#=begin
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
@pg = 0
end
def main
@sprite = Spriteset_Map.new
@command_window = Window_MenuCommand.new
@command_window.index = @menu_index
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 416
@steps_window = Window_Steps.new
@steps_window.x = 320
@steps_window.y = 384
@info_window = Window_PlayerInfo.new(@pg)
@info_window.y = 384
@info_window.x = 80
@battler_window = Window_Battler.new(@pg)
@battler_window.opacity = @info_window.opacity = @steps_window.opacity = @gold_window.opacity = @command_window.opacity = 160

@help_window = Window_Help.new
@item_window = Window_Item.new
@item_window.help_window = @help_window
@item_window.help_window.y = 320
@item_window.help_window.width = 320
@target_window = Window_Target.new
@item_window.active = @target_window.visible = @target_window.active = false
@item_window.help_window.opacity = @item_window.opacity = 160

@command_window.active = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@battler_window.dispose
@command_window.dispose
@steps_window.dispose
@gold_window.dispose
@info_window.dispose
@sprite.dispose
@help_window.dispose
@item_window.dispose
@target_window.dispose
end
def update
@command_window.update
@gold_window.update
@info_window.update
@steps_window.update
@battler_window.update
@sprite.update
if @command_window.active
update_command
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if @pg < $game_party.actors.size - 1
$game_system.se_play($data_system.cancel_se)
@pg += 1
redraw_info
return
end
end
if Input.trigger?(Input::Z)
if @pg > 0
$game_system.se_play($data_system.cancel_se)
@pg -= 1
redraw_info
return
end
end
case @command_window.index
when 0
@item_window.visible = @item_window.help_window.visible = true
if Input.trigger?(Input::DOWN)
main_item
end
return
when 1
@item_window.visible = @item_window.help_window.visible = false
return
end

end
def redraw_info
@info_window.dispose
@battler_window.dispose
@info_window = Window_PlayerInfo.new(@pg)
@info_window.y = 384
@info_window.x = 80
@battler_window = Window_Battler.new(@pg)
@battler_window.opacity = @info_window.opacity = 160
end
#=========================================================================
#ITEM
#=========================================================================
def main_item

@item_window.active = true
Graphics.transition
loop do
Graphics.update
Input.update
update_item_command
if $scene != self
break
end
end
Graphics.freeze
end
def update_item_command
@help_window.update
@item_window.update
@target_window.update
if @item_window.active
update_item
return
end
if @target_window.active
update_target_item
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
end
if Input.trigger?(Input::C)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @item.scope >= 3
@item_window.active = false
@target_window.x = 306
@target_window.visible = true
@target_window.active = true
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
else
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
$scene = Scene_Map.new
return
end
end
return
end
end
def update_target_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
unless $game_party.item_can_use?(@item.id)
@item_window.refresh
end
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
if Input.trigger?(Input::C)
if $game_party.item_number(@item.id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end

end
#=end
With A go to the next characters With Z go to the previous charcters(A & Z is the RPG button)
Foe now i make only item.
To activate the item menu press Down.
 
Try now:thumb: :
class Window_MenuCommand < Window_Selectable
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 4
@column_max = 4
@commands = ["Item", "Equip", "Save", "Exit"]
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index)
x = 4 + index * 160
self.contents.draw_text(x, 0, 128, 32, @commands[index])
end
end

class Window_PlayerInfo < Window_Base
def initialize(actor)
super(0, 0, 240, 96)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = $game_party.actors[actor]
refresh
self.active = false
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
x = 48
y = 0
draw_actor_graphic(@actor, x - 30, y + 50)
draw_actor_hp(@actor, x, y)
draw_actor_sp(@actor, x, y + 24)
end
end

class Window_Battler < Window_Base
def initialize(actor)
super(0,64,160,240)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = $game_party.actors[actor]
update
end
def update
bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(64 - cw / 2,192 - ch, bitmap, src_rect)
end
end

class Window_Item < Window_Selectable
def initialize
super(320, 64, 320, 320)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % @column_max * (288 + 32)
y = index / @column_max * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
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
end

class Window_EquipItem < Window_Selectable
def initialize(actor, equip_type)
super(320, 256, 320, 64)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4 + index % @column_max * (288 + 32)
y = index / @column_max * 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
end

class Scene_Menu
def initialize(menu_index = 0, pg = 0)
@menu_index = menu_index
@pg = pg
end
def main
@sprite = Spriteset_Map.new
@command_window = Window_MenuCommand.new
@command_window.index = @menu_index
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 416
@steps_window = Window_Steps.new
@steps_window.x = 320
@steps_window.y = 384
@info_window = Window_PlayerInfo.new(@pg)
@info_window.y = 384
@info_window.x = 80
@battler_window = Window_Battler.new(@pg)
@battler_window.opacity = @info_window.opacity = @steps_window.opacity = @gold_window.opacity = @command_window.opacity = 160

@help_window = Window_Help.new
@item_window = Window_Item.new
@item_window.help_window = @help_window
@item_window.help_window.y = 320
@item_window.help_window.width = 320
@target_window = Window_Target.new
@item_window.help_window.opacity = @item_window.opacity = 160
@equip_index = 0
@actor = $game_party.actors[@pg]
@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)
@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
@right_window.index = @equip_index
@item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = 160
@item_window.visible = @help_window.visible = @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = @right_window.visible = @right_window.active = @item_window.active = @target_window.visible = @target_window.active = false

@command_window.active = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@battler_window.dispose
@command_window.dispose
@steps_window.dispose
@gold_window.dispose
@info_window.dispose
@sprite.dispose
@help_window.dispose
@item_window.dispose
@target_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
def update
@command_window.update
@gold_window.update
@info_window.update
@steps_window.update
@battler_window.update
@sprite.update
if @command_window.active
update_command
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if @pg < $game_party.actors.size - 1
$game_system.se_play($data_system.cancel_se)
@pg += 1
redraw_info
return
end
end
if Input.trigger?(Input::Z)
if @pg > 0
$game_system.se_play($data_system.cancel_se)
@pg -= 1
redraw_info
return
end
end
case @command_window.index
when 0
@help_window.visible = @item_window.visible = true
@right_window.visible = false
if Input.trigger?(Input::DOWN)
main_item
@command_window.active = false
end
return
when 1
@item_window.visible = false
@help_window.visible = @right_window.visible = true
if Input.trigger?(Input::DOWN)
main_equip
@command_window.active = false
end
return
end

end
def redraw_info
@actor = $game_party.actors[@pg]
@info_window.dispose
@battler_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
@info_window = Window_PlayerInfo.new(@pg)
@info_window.y = 384
@info_window.x = 80
@battler_window = Window_Battler.new(@pg)
@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)
@item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = @battler_window.opacity = @info_window.opacity = 160
@item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = false
end

#=========================================================================
# Item
#=========================================================================
def main_item

@item_window.active = true
Graphics.transition
loop do
Graphics.update
Input.update
update_item_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
break
end
end
@command_window.active = true
end
def update_item_command
@help_window.update
@item_window.update
@target_window.update
if @item_window.active
update_item
return
end
if @target_window.active
update_target_item
return
end
end
def update_item
if Input.trigger?(Input::C)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @item.scope >= 3
@item_window.active = false
@target_window.x = 306
@target_window.visible = true
@target_window.active = true
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
else
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
$scene = Scene_Map.new
return
end
end
return
end
end
def update_target_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
unless $game_party.item_can_use?(@item.id)
@item_window.refresh
end
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
if Input.trigger?(Input::C)
if $game_party.item_number(@item.id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end

#==============================================================================
# Equip
#==============================================================================
def main_equip
@right_window.active = true
refresh_equip
Graphics.transition
loop do
Graphics.update
Input.update
update_equip
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1,@pg)
break
end
end
end
def refresh_equip
@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)
item1 = @right_window.item
case @right_window.index
when 0
@items_window = @item_window1
when 1
@items_window = @item_window2
when 2
@items_window = @item_window3
when 3
@items_window = @item_window4
when 4
@items_window = @item_window5
end

end
def update_equip
@right_window.update
@items_window.update
refresh_equip
if @right_window.active
update_right
return
end
if @items_window.active
update_item_equip
return
end
end
def update_right
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@items_window.active = true
@items_window.index = 0
return
end
end
def update_item_equip
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@items_window.active = false
@items_window.index = -1
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @items_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@items_window.active = false
@items_window.index = -1
@right_window.refresh
@items_window.refresh
return
end
end
end
There was a grammatical error.':|

EDIT:
Update.
I've added the equipment!;)
 
heh, heh, heh... the code he posted isn't in code tags, so it replaced some of the charaters with smilies.

Code:
class Window_MenuCommand < Window_Selectable
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 4
@column_max = 4
@commands = ["Item", "Equip", "Save", "Exit"]
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index)
x = 4 + index * 160
self.contents.draw_text(x, 0, 128, 32, @commands[index])
end
end

class Window_PlayerInfo < Window_Base
def initialize(actor)
super(0, 0, 240, 96)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = $game_party.actors[actor]
refresh
self.active = false
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
x = 48
y = 0
draw_actor_graphic(@actor, x - 30, y + 50)
draw_actor_hp(@actor, x, y)
draw_actor_sp(@actor, x, y + 24)
end
end

class Window_Battler < Window_Base
def initialize(actor)
super(0,64,160,240)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = $game_party.actors[actor]
update
end
def update
bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(64 - cw / 2,192 - ch, bitmap, src_rect)
end
end

class Window_Item < Window_Selectable
def initialize
super(320, 64, 320, 320)
@column_max = 1
refresh
self.index = 0
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % @column_max * (288 + 32)
y = index / @column_max * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
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
end

class Window_EquipItem < Window_Selectable
def initialize(actor, equip_type)
super(320, 256, 320, 64)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4 + index % @column_max * (288 + 32)
y = index / @column_max * 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
end

class Scene_Menu
def initialize(menu_index = 0, pg = 0)
@menu_index = menu_index
@pg = pg
end
def main
@sprite = Spriteset_Map.new
@command_window = Window_MenuCommand.new
@command_window.index = @menu_index
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 416
@steps_window = Window_Steps.new
@steps_window.x = 320
@steps_window.y = 384
@info_window = Window_PlayerInfo.new(@pg)
@info_window.y = 384
@info_window.x = 80
@battler_window = Window_Battler.new(@pg)
@battler_window.opacity = @info_window.opacity = @steps_window.opacity = @gold_window.opacity = @command_window.opacity = 160

@help_window = Window_Help.new
@item_window = Window_Item.new
@item_window.help_window = @help_window
@item_window.help_window.y = 320
@item_window.help_window.width = 320
@target_window = Window_Target.new
@item_window.help_window.opacity = @item_window.opacity = 160
@equip_index = 0
@actor = $game_party.actors[@pg]
@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)
@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
@right_window.index = @equip_index
@item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = 160
@item_window.visible = @help_window.visible = @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = @right_window.visible = @right_window.active = @item_window.active = @target_window.visible = @target_window.active = false

@command_window.active = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@battler_window.dispose
@command_window.dispose
@steps_window.dispose
@gold_window.dispose
@info_window.dispose
@sprite.dispose
@help_window.dispose
@item_window.dispose
@target_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
def update
@command_window.update
@gold_window.update
@info_window.update
@steps_window.update
@battler_window.update
@sprite.update
if @command_window.active
update_command
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if @pg < $game_party.actors.size - 1
$game_system.se_play($data_system.cancel_se)
@pg += 1
redraw_info
return
end
end
if Input.trigger?(Input::Z)
if @pg > 0
$game_system.se_play($data_system.cancel_se)
@pg -= 1
redraw_info
return
end
end
case @command_window.index
when 0
@help_window.visible = @item_window.visible = true
@right_window.visible = false
if Input.trigger?(Input::DOWN)
main_item
@command_window.active = false
end
return
when 1
@item_window.visible = false
@help_window.visible = @right_window.visible = true
if Input.trigger?(Input::DOWN)
main_equip
@command_window.active = false
end
return
end

end
def redraw_info
@actor = $game_party.actors[@pg]
@info_window.dispose
@battler_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
@info_window = Window_PlayerInfo.new(@pg)
@info_window.y = 384
@info_window.x = 80
@battler_window = Window_Battler.new(@pg)
@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)
@item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = @battler_window.opacity = @info_window.opacity = 160
@item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = false
end

#================================================= ========================
# Item
#================================================= ========================
def main_item

@item_window.active = true
Graphics.transition
loop do
Graphics.update
Input.update
update_item_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
break
end
end
@command_window.active = true
end
def update_item_command
@help_window.update
@item_window.update
@target_window.update
if @item_window.active
update_item
return
end
if @target_window.active
update_target_item
return
end
end
def update_item
if Input.trigger?(Input::C)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @item.scope >= 3
@item_window.active = false
@target_window.x = 306
@target_window.visible = true
@target_window.active = true
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
else
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
$scene = Scene_Map.new
return
end
end
return
end
end
def update_target_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
unless $game_party.item_can_use?(@item.id)
@item_window.refresh
end
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
if Input.trigger?(Input::C)
if $game_party.item_number(@item.id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end

#================================================= =============================
# Equip
#================================================= =============================
def main_equip
@right_window.active = true
refresh_equip
Graphics.transition
loop do
Graphics.update
Input.update
update_equip
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1,@pg)
break
end
end
end
def refresh_equip
@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)
item1 = @right_window.item
case @right_window.index
when 0
@items_window = @item_window1
when 1
@items_window = @item_window2
when 2
@items_window = @item_window3
when 3
@items_window = @item_window4
when 4
@items_window = @item_window5
end

end
def update_equip
@right_window.update
@items_window.update
refresh_equip
if @right_window.active
update_right
return
end
if @items_window.active
update_item_equip
return
end
end
def update_right
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@items_window.active = true
@items_window.index = 0
return
end
end
def update_item_equip
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@items_window.active = false
@items_window.index = -1
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @items_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@items_window.active = false
@items_window.index = -1
@right_window.refresh
@items_window.refresh
return
end
end
end

I dunno know if it's what's causing the error, but it will cause a new one if it isn't causing the current one. The above code has the smilies fixed.
 
I have a question.
The save menu is called like the old menu o i must customize it?
So when you are on "Save" if you press Down what happend?
And for the exit?

Sorry for the error, on my pc the script go very well. Maybe the smile delete some part of the code.
 
OK this is the complete Menu:
Code:
class Window_MenuCommand < Window_Selectable
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 4
    @column_max = 4
    @commands = ["Item", "Equip", "Save", "Exit"]
    refresh
    self.index = 0
  end
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  def draw_item(index)
    x = 4 + index * 160
    self.contents.draw_text(x, 0, 128, 32, @commands[index])
  end
end

class Window_SaveFileMenu < Window_Base
  attr_reader   :filename
  attr_reader   :selected
  def initialize(file_index, filename)
    super(160, 64 + file_index % 4 * 80, 480, 80)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist= FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = "File#{@file_index + 1}"
    self.contents.draw_text(0, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      for i in 0...@characters.size
        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 300 - @characters.size * 32 + i * 32 - cw / 2
        self.contents.blt(x, 48 - ch, bitmap, src_rect)
      end
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(96, 8, 600, 32, time_string,1)
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(4, 24, 600, 32, time_string)
    end
  end
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 4, @name_width + 8, 24)
    else
      self.cursor_rect.empty
    end
  end
end

class Window_PlayerInfo < Window_Base
  def initialize(actor)
    super(0, 0, 240, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_party.actors[actor]
    refresh
    self.active = false
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    x = 48
    y = 0
    draw_actor_graphic(@actor, x - 30, y + 50)
    draw_actor_hp(@actor, x, y)
    draw_actor_sp(@actor, x, y + 24)
  end
end

class Window_Battler < Window_Base
  def initialize(actor)
    super(0,64,160,240)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_party.actors[actor]
    update
  end
  def update
    bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(64 - cw / 2,192 - ch, bitmap, src_rect)
  end
end

class Window_Item < Window_Selectable
  def initialize
    super(320, 64, 320, 320)
    @column_max = 1
    refresh
    self.index = 0
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
      $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    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
end

class Window_EquipItem < Window_Selectable
  def initialize(actor, equip_type)
    super(320, 256, 320, 64)
    @actor = actor
    @equip_type = equip_type
    @column_max = 1
    refresh
    self.active = false
    self.index = -1
  end
  def item
    return @data[self.index]
  end
  def draw_item(index)
    item = @data[index]
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 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
end

class Scene_Menu
  def initialize(menu_index = 0, pg = 0, from_exit = false)
    @menu_index = menu_index
    @pg = pg
    @from_exit = from_exit
  end
  def main
    @sprite = Spriteset_Map.new
    @command_window = Window_MenuCommand.new
    @command_window.index = @menu_index
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 416
    @steps_window = Window_Steps.new
    @steps_window.x = 320
    @steps_window.y = 384
    @info_window = Window_PlayerInfo.new(@pg)
    @info_window.y = 384
    @info_window.x = 80
    @battler_window = Window_Battler.new(@pg)
    @battler_window.opacity = @info_window.opacity = @steps_window.opacity = @gold_window.opacity = @command_window.opacity = 160
    
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @item_window.help_window = @help_window
    @item_window.help_window.y = 320
    @item_window.help_window.width = 320
    @target_window = Window_Target.new
    @item_window.help_window.opacity = @item_window.opacity = 160
    @equip_index = 0
    @actor = $game_party.actors[@pg]
    @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)
    @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
    @right_window.index = @equip_index
    @item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = 160
    @item_window.visible = @help_window.visible = @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = @right_window.visible = @right_window.active = @item_window.active = @target_window.visible = @target_window.active = false
    
    s1 = "Save and Quit"
    s2 = "Quit"
    s3 = "Load Another file"
    @exit_window = Window_Command.new(192, [s1, s2, s3])
    @exit_window.x = 320 - @exit_window.width / 2
    @exit_window.y = 240 - @exit_window.height / 2
    @exit_window.opacity = 160
    @exit_window.active = @exit_window.visible = false
    
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFileMenu.new(i, make_filename(i)))
      @savefile_windows[i].opacity = 160
      @savefile_windows[i].active = @savefile_windows[i].visible = false
    end
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    
    @command_window.active = true
    Graphics.transition
    if @from_exit
      @exit_window.visible = @help_window.visible = @right_window.visible = false
      for i in 0..3
        @savefile_windows[i].visible = true
      end
      main_save
    end
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @battler_window.dispose
    @command_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @info_window.dispose
    @sprite.dispose
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
    for i in 0..3
      @savefile_windows[i].dispose
    end
    @exit_window.dispose
  end
  def update
    @battler_window.update
    @command_window.update
    @steps_window.update
    @gold_window.update
    @info_window.update
    @sprite.update
    @help_window.update
    @item_window.update
    @target_window.update
    @right_window.update
    @item_window1.update
    @item_window2.update
    @item_window3.update
    @item_window4.update
    @item_window5.update
    for i in 0..3
      @savefile_windows[i].update
    end
    @exit_window.update
    if @command_window.active
      update_command
      return
    end
  end
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if @pg < $game_party.actors.size - 1
        $game_system.se_play($data_system.cancel_se)
        @pg += 1
        redraw_info
        return
      end
    end
    if Input.trigger?(Input::Z)
      if @pg > 0
        $game_system.se_play($data_system.cancel_se)
        @pg -= 1
        redraw_info
        return
      end
    end
    case @command_window.index
    when 0
      @item_window.visible = true
      @help_window.visible = @right_window.visible = false
      if Input.trigger?(Input::DOWN)
        main_item
        @command_window.active = false
      end
      return
    when 1
      @help_window.visible = @item_window.visible = false
      @right_window.visible = true
      for i in 0..3
        @savefile_windows[i].visible = false
      end
      if Input.trigger?(Input::DOWN)
        main_equip
        @command_window.active = false
      end
    when 2
      @exit_window.visible = @help_window.visible = @right_window.visible = false
      for i in 0..3
        @savefile_windows[i].visible = true
      end
      if Input.trigger?(Input::DOWN)
        main_save
        @command_window.active = false
      end      
      return
    when 3
      @exit_window.visible = true
      for i in 0..3
        @right_window.visible = @help_window.visible = @item_window.visible = @savefile_windows[i].visible = false
      end
      if Input.trigger?(Input::DOWN)
        main_exit
        @command_window.active = false
      end  
    end
  end
  def redraw_info
    @actor = $game_party.actors[@pg]
    @info_window.dispose
    @battler_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
    @info_window = Window_PlayerInfo.new(@pg)
    @info_window.y = 384
    @info_window.x = 80
    @battler_window = Window_Battler.new(@pg)
    @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)
    @item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = @battler_window.opacity = @info_window.opacity = 160
    @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = false
  end
  

#=========================================================================
# Item
#=========================================================================
  def main_item
    @item_window.active = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_item_command
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(0,@pg)
        break
      elsif $scene != self
        break
      end
    end
    @command_window.active = true
  end
  def update_item_command
    @help_window.update
    @item_window.update
    @target_window.update
    if @item_window.active
      update_item
      return
    end
    if @target_window.active
      update_target_item
      return
    end
  end
  def update_item
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @target_window.x = 306
        @target_window.visible = true
        @target_window.active = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  def update_target_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      unless $game_party.item_can_use?(@item.id)
        @item_window.refresh
      end
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.item_number(@item.id) == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if @target_window.index == -1
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      if @target_window.index >= 0
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      if used
        $game_system.se_play(@item.menu_se)
        if @item.consumable
          $game_party.lose_item(@item.id, 1)
          @item_window.draw_item(@item_window.index)
        end
        @target_window.refresh
        if $game_party.all_dead?
          $scene = Scene_Gameover.new
          return
        end
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $scene = Scene_Map.new
          return
        end
      end
      unless used
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
  
#==============================================================================
# Equip
#==============================================================================
  def main_equip
    @right_window.active = true
    refresh_equip
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_equip
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(1,@pg)
        break
      elsif $scene != self
        break
      end
    end
  end
  def refresh_equip
    @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)
    item1 = @right_window.item
    case @right_window.index
    when 0
      @items_window = @item_window1
    when 1
      @items_window = @item_window2
    when 2
      @items_window = @item_window3
    when 3
      @items_window = @item_window4
    when 4
      @items_window = @item_window5
    end
  end
  def update_equip
    @right_window.update
    @items_window.update
    refresh_equip
    if @right_window.active
      update_right
      return
    end
    if @items_window.active
      update_item_equip
      return
    end
  end
  def update_right
    if Input.trigger?(Input::C)
      if @actor.equip_fix?(@right_window.index)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @right_window.active = false
      @items_window.active = true
      @items_window.index = 0
      return
    end
  end
  def update_item_equip
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @right_window.active = true
      @items_window.active = false
      @items_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.equip_se)
      item = @items_window.item
      @actor.equip(@right_window.index, item == nil ? 0 : item.id)
      @right_window.active = true
      @items_window.active = false
      @items_window.index = -1
      @right_window.refresh
      @items_window.refresh
      return
    end
  end
  #==============================================================================
  # Save
  #==============================================================================
  def main_save
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_save      
      if $scene != self
        break
      elsif $scene != self
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(2,@pg)
        break
      end
    end
    Graphics.freeze
  end
  def update_save
    for i in @savefile_windows
      i.update
    end
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < 3
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 1) % 4
        @savefile_windows[@file_index].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 3) % 4
        @savefile_windows[@file_index].selected = true
        return
      end
    end
  end
  def make_filename(file_index)
    return "Save#{file_index + 1}.rxdata"
  end
  def on_decision(filename)
    $game_system.se_play($data_system.save_se)
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    if @from_exit
      $scene = Scene_Title.new
      @from_exit = false
    else
      $scene = Scene_Menu.new(2,@pg)
    end
  end
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    if @from_exit
      $scene = Scene_Menu.new(3,@pg,false)
    else
      $scene = Scene_Menu.new(2,@pg)
    end
  end
  def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
    $game_system.magic_number = $data_system.magic_number
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
  end
  #==============================================================================
  # Exit
  #==============================================================================
  def main_exit
    @exit_window.active = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_exit
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(3,@pg)
        break
      elsif $scene != self
        break
      end
    end
  end
  def update_exit
    @exit_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(3)
      return
    else
      
    end
    if Input.trigger?(Input::C)
      case @exit_window.index
      when 0
        command_save_e_shutdown
      when 1
        command_shutdown
      when 2
        command_load
      end
      return
    end
  end
  def command_save_e_shutdown
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_Menu.new(2,@pg,true)
  end
  def command_shutdown
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_fade(800)
    Audio.bgs_fade(800)
    Audio.me_fade(800)
    $from_menu = false
    $scene = Scene_Title.new
  end
  def command_load
    $game_system.se_play($data_system.decision_se)
    $from_menu = true
    $scene = Scene_Load.new
  end
  
end

class Scene_Load < Scene_File
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    if $from_menu
      $scene = Scene_Menu.new(3)
    else
      $scene = Scene_Title.new
    end
  end
end
http://img160.imageshack.us/img160/2936/bpmenupx8.jpg[/IMG]
Try it and say me if I must change something.
 
Well, I've tried the demo (not the complete one) and found 1 bug, and a lack of a couple of features.

Bugs:
1. Sometimes battlers heads are chopped off (Cleric), can you resize them to Arshes size?

Lack:
1. The character box, gold window and step count disappeared when the menu did, they should remain onscreen at ALL times (except battles

2. The windows (top and sides) should actually zoom in from the top and sides, and fix into place when the menu is called. They zoom out when it is cancelled.

If you updated to include these in the final script, ignore the above.

Also, how do you change the windowskin in the script?

Thanks a heap,
BP
 
This is the script revisited:
Code:
$pg = 0
class Window_MenuCommand < Window_Selectable
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 4
    @column_max = 4
    @commands = ["Item", "Equip", "Save", "Exit"]
    refresh
    self.index = 0
  end
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  def draw_item(index)
    x = 4 + index * 160
    self.contents.draw_text(x, 0, 128, 32, @commands[index])
  end
end

class Window_SaveFileMenu < Window_Base
  attr_reader   :filename
  attr_reader   :selected
  def initialize(file_index, filename)
    super(160, 64 + file_index % 4 * 80, 480, 80)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist= FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = "File#{@file_index + 1}"
    self.contents.draw_text(0, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      for i in 0...@characters.size
        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 300 - @characters.size * 32 + i * 32 - cw / 2
        self.contents.blt(x, 48 - ch, bitmap, src_rect)
      end
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(96, 8, 600, 32, time_string,1)
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(4, 24, 600, 32, time_string)
    end
  end
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 4, @name_width + 8, 24)
    else
      self.cursor_rect.empty
    end
  end
end

class Window_PlayerInfo < Window_Base
  def initialize(actor)
    super(0, 0, 240, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_party.actors[actor]
    refresh
  end
  def refresh
    self.contents.clear
    x = 48
    y = 0
    draw_actor_graphic(@actor, x - 30, y + 50)
    draw_actor_hp(@actor, x, y)
    draw_actor_sp(@actor, x, y + 24)
  end
end

class Window_Battler < Window_Base
  def initialize(actor)
    super(0,64,160,256)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_party.actors[actor]
    update
  end
  def update
    bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(0, 0, bitmap, src_rect)
  end
end

class Window_Item < Window_Selectable
  def initialize
    super(320, 64, 320, 320)
    @column_max = 1
    refresh
    self.index = 0
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
      $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    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
end

class Window_EquipItem < Window_Selectable
  def initialize(actor, equip_type)
    super(320, 256, 320, 64)
    @actor = actor
    @equip_type = equip_type
    @column_max = 1
    refresh
    self.active = false
    self.index = -1
  end
  def item
    return @data[self.index]
  end
  def draw_item(index)
    item = @data[index]
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 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
end

class Scene_Menu
  def initialize(menu_index = 0, pg = 0, from_exit = false)
    @menu_index = menu_index
    $pg = pg
    @from_exit = from_exit
  end
  def main
    @sprite = Spriteset_Map.new
    @command_window = Window_MenuCommand.new
    @command_window.index = @menu_index
    @command_window.y = -64
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 416
    @steps_window = Window_Steps.new
    @steps_window.x = 320
    @steps_window.y = 384
    @info_window = Window_PlayerInfo.new($pg)
    @info_window.y = 384
    @info_window.x = 80
    @battler_window = Window_Battler.new($pg)
    @battler_window.opacity = @info_window.opacity = @steps_window.opacity = @gold_window.opacity = @command_window.opacity = 160
    @battler_window.x = -160
    
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @item_window.x = 640
    @item_window.help_window = @help_window
    @item_window.help_window.y = 320
    @item_window.help_window.width = 320
    @target_window = Window_Target.new
    @item_window.help_window.opacity = @item_window.opacity = 160
    @equip_index = 0
    @actor = $game_party.actors[$pg]
    @right_window = Window_EquipRight.new(@actor)
    @right_window.x = 688
    @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)
    @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
    @right_window.index = @equip_index
    @item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = 160
    @item_window.visible = @help_window.visible = @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = @right_window.visible = @right_window.active = @item_window.active = @target_window.visible = @target_window.active = false
    
    s1 = "Save and Quit"
    s2 = "Quit"
    s3 = "Load Another file"
    @exit_window = Window_Command.new(192, [s1, s2, s3])
    @exit_window.x = 640
    @exit_window.y = 240 - @exit_window.height / 2
    @exit_window.opacity = 160
    @exit_window.active = @exit_window.visible = false
    
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFileMenu.new(i, make_filename(i)))
      @savefile_windows[i].opacity = 160
      @savefile_windows[i].active = @savefile_windows[i].visible = false
    end
    @savefile_windows[0].y = 480
    @savefile_windows[1].y = 624
    @savefile_windows[2].y = 768
    @savefile_windows[3].y = 912
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    
    @command_window.active = true
    Graphics.transition
    if @from_exit
      @exit_window.visible = @help_window.visible = @right_window.visible = false
      for i in 0..3
        @savefile_windows[i].visible = true
      end
      main_save
    end
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self        
        break
      end
    end
    Graphics.freeze
    @battler_window.dispose
    @command_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @info_window.dispose
    @sprite.dispose
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
    for i in 0..3
      @savefile_windows[i].dispose
    end
    @exit_window.dispose
  end
  def make_window
    if @command_window.y < 0
      @command_window.y += 8
    end
    if @battler_window.x < 0
      @battler_window.x += 16
    end
    if @item_window.x > 320
      @item_window.x -= 32
    end
    if @right_window.x > 272
      @right_window.x -= 32
    end
    if @savefile_windows[0].y > 64
      @savefile_windows[0].y -= 32
    end
    if @savefile_windows[1].y > 144
      @savefile_windows[1].y -= 32
    end 
    if @savefile_windows[2].y > 224
      @savefile_windows[2].y -= 32
    end 
    if @savefile_windows[3].y > 304
      @savefile_windows[3].y -= 32
    end 
    if @exit_window.x > 320 - @exit_window.width / 2
      @exit_window.x -= 32
    end
  end
  def update
    make_window
    @battler_window.update
    @command_window.update
    @steps_window.update
    @gold_window.update
    @info_window.update
    @sprite.update
    @help_window.update
    @item_window.update
    @target_window.update
    @right_window.update
    @item_window1.update
    @item_window2.update
    @item_window3.update
    @item_window4.update
    @item_window5.update
    for i in 0..3
      @savefile_windows[i].update
    end
    @exit_window.update
    if @command_window.active
      update_command
      return
    end
  end
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::R)
      if $pg < $game_party.actors.size - 1
        $game_system.se_play($data_system.cancel_se)
        $pg += 1
        redraw_info
        return
      end
    end
    if Input.trigger?(Input::L)
      if $pg > 0
        $game_system.se_play($data_system.cancel_se)
        $pg -= 1
        redraw_info
        return
      end
    end
    case @command_window.index
    when 0
      @item_window.visible = true
      @help_window.visible = @right_window.visible = false
      @right_window.x = 688
      if Input.trigger?(Input::DOWN)
        main_item
        @command_window.active = false
      end
      return
    when 1
      @help_window.visible = @item_window.visible = false
      @right_window.visible = true
      @item_window.x = 640
      for i in 0..3
        @savefile_windows[i].visible = false
      end
      @savefile_windows[0].y = 480
      @savefile_windows[1].y = 624
      @savefile_windows[2].y = 768
      @savefile_windows[3].y = 912
      if Input.trigger?(Input::DOWN)
        main_equip
        @command_window.active = false
      end
    when 2
      @exit_window.visible = @help_window.visible = @right_window.visible = false
      for i in 0..3
        @savefile_windows[i].visible = true
      end
      @right_window.x = 688
      @exit_window.x = 640
      if Input.trigger?(Input::DOWN)
        main_save
        @command_window.active = false
      end      
      return
    when 3
      @exit_window.visible = true
      for i in 0..3
        @right_window.visible = @help_window.visible = @item_window.visible = @savefile_windows[i].visible = false
      end
      @savefile_windows[0].y = 480
      @savefile_windows[1].y = 624
      @savefile_windows[2].y = 768
      @savefile_windows[3].y = 912
      if Input.trigger?(Input::DOWN)
        main_exit
        @command_window.active = false
      end  
    end
  end
  def redraw_info
    @actor = $game_party.actors[$pg]
    @info_window.dispose
    @battler_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
    @info_window = Window_PlayerInfo.new($pg)
    @info_window.y = 384
    @info_window.x = 80
    @battler_window = Window_Battler.new($pg)
    @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)
    @item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = @battler_window.opacity = @info_window.opacity = 160
    @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = false
  end
  

#=========================================================================
# Item
#=========================================================================
  def main_item
    @item_window.active = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_item_command
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(0,$pg)
        break
      elsif $scene != self
        break
      end
    end
    @command_window.active = true
  end
  def update_item_command
    @help_window.update
    @item_window.update
    @target_window.update
    if @item_window.active
      update_item
      return
    end
    if @target_window.active
      update_target_item
      return
    end
  end
  def update_item
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @target_window.x = 306
        @target_window.visible = true
        @target_window.active = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  def update_target_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      unless $game_party.item_can_use?(@item.id)
        @item_window.refresh
      end
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.item_number(@item.id) == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if @target_window.index == -1
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      if @target_window.index >= 0
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      if used
        $game_system.se_play(@item.menu_se)
        if @item.consumable
          $game_party.lose_item(@item.id, 1)
          @item_window.draw_item(@item_window.index)
        end
        @target_window.refresh
        if $game_party.all_dead?
          $scene = Scene_Gameover.new
          return
        end
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $scene = Scene_Map.new
          return
        end
      end
      unless used
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
  
#==============================================================================
# Equip
#==============================================================================
  def main_equip
    @right_window.active = true
    refresh_equip
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_equip
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(1,$pg)
        break
      elsif $scene != self
        break
      end
    end
  end
  def refresh_equip
    @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)
    item1 = @right_window.item
    case @right_window.index
    when 0
      @items_window = @item_window1
    when 1
      @items_window = @item_window2
    when 2
      @items_window = @item_window3
    when 3
      @items_window = @item_window4
    when 4
      @items_window = @item_window5
    end
  end
  def update_equip
    @right_window.update
    @items_window.update
    refresh_equip
    if @right_window.active
      update_right
      return
    end
    if @items_window.active
      update_item_equip
      return
    end
  end
  def update_right
    if Input.trigger?(Input::C)
      if @actor.equip_fix?(@right_window.index)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @right_window.active = false
      @items_window.active = true
      @items_window.index = 0
      return
    end
  end
  def update_item_equip
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @right_window.active = true
      @items_window.active = false
      @items_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.equip_se)
      item = @items_window.item
      @actor.equip(@right_window.index, item == nil ? 0 : item.id)
      @right_window.active = true
      @items_window.active = false
      @items_window.index = -1
      @right_window.refresh
      @items_window.refresh
      return
    end
  end
  #==============================================================================
  # Save
  #==============================================================================
  def main_save
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_save      
      if $scene != self
        break
      elsif $scene != self
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(2,$pg)
        break
      end
    end
    Graphics.freeze
  end
  def update_save
    for i in @savefile_windows
      i.update
    end
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < 3
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 1) % 4
        @savefile_windows[@file_index].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 3) % 4
        @savefile_windows[@file_index].selected = true
        return
      end
    end
  end
  def make_filename(file_index)
    return "Save#{file_index + 1}.rxdata"
  end
  def on_decision(filename)
    $game_system.se_play($data_system.save_se)
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    if @from_exit
      $scene = Scene_Title.new
      @from_exit = false
    else
      $scene = Scene_Menu.new(2,$pg)
    end
  end
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    if @from_exit
      $scene = Scene_Menu.new(3,$pg,false)
    else
      $scene = Scene_Menu.new(2,$pg)
    end
  end
  def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
    $game_system.magic_number = $data_system.magic_number
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
  end
  #==============================================================================
  # Exit
  #==============================================================================
  def main_exit
    @exit_window.active = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_exit
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(3,$pg)
        break
      elsif $scene != self
        break
      end
    end
  end
  def update_exit
    @exit_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(3)
      return
    else
      
    end
    if Input.trigger?(Input::C)
      case @exit_window.index
      when 0
        command_save_e_shutdown
      when 1
        command_shutdown
      when 2
        command_load
      end
      return
    end
  end
  def command_save_e_shutdown
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_Menu.new(2,$pg,true)
  end
  def command_shutdown
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_fade(800)
    Audio.bgs_fade(800)
    Audio.me_fade(800)
    $from_menu = false
    $scene = Scene_Title.new
  end
  def command_load
    $game_system.se_play($data_system.decision_se)
    $from_menu = true
    $scene = Scene_Load.new
  end
  
end

class Scene_Load < Scene_File
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    if $from_menu
      $scene = Scene_Menu.new(3)
    else
      $scene = Scene_Title.new
    end
  end
end

class Scene_Map
  def main
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 416
    @steps_window = Window_Steps.new
    @steps_window.x = 320
    @steps_window.y = 384
    @info_window = Window_PlayerInfo.new($pg)
    @info_window.y = 384
    @info_window.x = 80
    @info_window.opacity = @steps_window.opacity = @gold_window.opacity = 160
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @message_window.dispose
    @gold_window.dispose
    @steps_window.dispose
    @info_window.dispose
    if $scene.is_a?(Scene_Title)
      Graphics.transition
      Graphics.freeze
    end
  end
  alias bpmenu_scenemap_update update
  def update
    @gold_window.refresh
    @steps_window.refresh
    @info_window.update
    bpmenu_scenemap_update
    if Input.trigger?(Input::R)
      if $pg < $game_party.actors.size - 1
        $game_system.se_play($data_system.cancel_se)
        $pg += 1
        @info_window.dispose
        @info_window = Window_PlayerInfo.new($pg)
        @info_window.y = 384
        @info_window.x = 80
        @info_window.opacity = 160
        return
      end
    end
    if Input.trigger?(Input::L)
      if $pg > 0
        $game_system.se_play($data_system.cancel_se)
        $pg -= 1
        @info_window.dispose
        @info_window = Window_PlayerInfo.new($pg)
        @info_window.y = 384
        @info_window.x = 80
        @info_window.opacity = 160
        return
      end
    end
  end
  def call_menu
    $game_temp.menu_calling = false
    if $game_temp.menu_beep
      $game_system.se_play($data_system.decision_se)
      $game_temp.menu_beep = false
    end
    $game_player.straighten
    $scene = Scene_Menu.new(0,$pg)
  end
end
I've changed the button to change the characters in L and R.
 
This is absolutely PERFECT.

I especially love the save file window, this a better menu than I could hope for.
And could you tell me how to change the windowskin? I assume you just have to put a line of script in

I have one recommendation:
Maybe the windows should zoom out as well, but thats no biggy.

Are you going to post this in Completed Scripts, or do you want me to do it for you?

Thanks a ton,
BP
 
The buttons to change characters are page down and page up.
Maybe the windows should zoom out as well, but thats no biggy.
I forgot that option.

EDIT:
Now the windows zoom out!
Code:
$pg = 0
class Window_MenuCommand < Window_Selectable
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 4
    @column_max = 4
    @commands = ["Item", "Equip", "Save", "Exit"]
    refresh
    self.index = 0
  end
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  def draw_item(index)
    x = 4 + index * 160
    self.contents.draw_text(x, 0, 128, 32, @commands[index])
  end
end

class Window_SaveFileMenu < Window_Base
  attr_reader   :filename
  attr_reader   :selected
  def initialize(file_index, filename)
    super(160, 64 + file_index % 4 * 80, 480, 80)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist= FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = "File#{@file_index + 1}"
    self.contents.draw_text(0, 0, 600, 32, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      for i in 0...@characters.size
        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 300 - @characters.size * 32 + i * 32 - cw / 2
        self.contents.blt(x, 48 - ch, bitmap, src_rect)
      end
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(96, 8, 600, 32, time_string,1)
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(4, 24, 600, 32, time_string)
    end
  end
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 4, @name_width + 8, 24)
    else
      self.cursor_rect.empty
    end
  end
end

class Window_PlayerInfo < Window_Base
  def initialize(actor)
    super(0, 0, 240, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_party.actors[actor]
    refresh
  end
  def refresh
    self.contents.clear
    x = 48
    y = 0
    draw_actor_graphic(@actor, x - 30, y + 50)
    draw_actor_hp(@actor, x, y)
    draw_actor_sp(@actor, x, y + 24)
  end
end

class Window_Battler < Window_Base
  def initialize(actor)
    super(0,64,160,256)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_party.actors[actor]
    update
  end
  def update
    bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(0, 0, bitmap, src_rect)
  end
end

class Window_Item < Window_Selectable
  def initialize
    super(320, 64, 320, 320)
    @column_max = 1
    refresh
    self.index = 0
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
      $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    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
end

class Window_EquipItem < Window_Selectable
  def initialize(actor, equip_type)
    super(320, 256, 320, 64)
    @actor = actor
    @equip_type = equip_type
    @column_max = 1
    refresh
    self.active = false
    self.index = -1
  end
  def item
    return @data[self.index]
  end
  def draw_item(index)
    item = @data[index]
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 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
end

class Scene_Menu
  def initialize(menu_index = 0, pg = 0, from_exit = false)
    @menu_index = menu_index
    $pg = pg
    @from_exit = from_exit
  end
  def main
    @sprite = Spriteset_Map.new
    @command_window = Window_MenuCommand.new
    @command_window.index = @menu_index
    @command_window.y = -64
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 416
    @steps_window = Window_Steps.new
    @steps_window.x = 320
    @steps_window.y = 384
    @info_window = Window_PlayerInfo.new($pg)
    @info_window.y = 384
    @info_window.x = 80
    @battler_window = Window_Battler.new($pg)
    @battler_window.opacity = @info_window.opacity = @steps_window.opacity = @gold_window.opacity = @command_window.opacity = 160
    @battler_window.x = -160
    
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @item_window.x = 640
    @item_window.help_window = @help_window
    @item_window.help_window.y = 320
    @item_window.help_window.width = 320
    @target_window = Window_Target.new
    @item_window.help_window.opacity = @item_window.opacity = 160
    @equip_index = 0
    @actor = $game_party.actors[$pg]
    @right_window = Window_EquipRight.new(@actor)
    @right_window.x = 688
    @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)
    @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
    @right_window.index = @equip_index
    @item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = 160
    @item_window.visible = @help_window.visible = @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = @right_window.visible = @right_window.active = @item_window.active = @target_window.visible = @target_window.active = false
    
    s1 = "Save and Quit"
    s2 = "Quit"
    s3 = "Load Another file"
    @exit_window = Window_Command.new(192, [s1, s2, s3])
    @exit_window.x = 640
    @exit_window.y = 240 - @exit_window.height / 2
    @exit_window.opacity = 160
    @exit_window.active = @exit_window.visible = false
    
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFileMenu.new(i, make_filename(i)))
      @savefile_windows[i].opacity = 160
      @savefile_windows[i].active = @savefile_windows[i].visible = false
    end
    @savefile_windows[0].y = 480
    @savefile_windows[1].y = 624
    @savefile_windows[2].y = 768
    @savefile_windows[3].y = 912
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    
    @command_window.active = true
    Graphics.transition
    if @from_exit
      @exit_window.visible = @help_window.visible = @right_window.visible = false
      for i in 0..3
        @savefile_windows[i].visible = true
      end
      main_save
    end
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @battler_window.dispose
    @command_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @info_window.dispose
    @sprite.dispose
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
    for i in 0..3
      @savefile_windows[i].dispose
    end
    @exit_window.dispose
  end
  def make_window
    if @command_window.y < 0
      @command_window.y += 8
    end
    if @battler_window.x < 0
      @battler_window.x += 16
    end
    if @item_window.x > 320
      @item_window.x -= 32
    end
    if @right_window.x > 272
      @right_window.x -= 32
    end
    if @savefile_windows[0].y > 64
      @savefile_windows[0].y -= 32
    end
    if @savefile_windows[1].y > 144
      @savefile_windows[1].y -= 32
    end 
    if @savefile_windows[2].y > 224
      @savefile_windows[2].y -= 32
    end 
    if @savefile_windows[3].y > 304
      @savefile_windows[3].y -= 32
    end 
    if @exit_window.x > 320 - @exit_window.width / 2
      @exit_window.x -= 32
    end
  end
  def update
    make_window
    @battler_window.update
    @command_window.update
    @steps_window.update
    @gold_window.update
    @info_window.update
    @sprite.update
    @help_window.update
    @item_window.update
    @target_window.update
    @right_window.update
    @item_window1.update
    @item_window2.update
    @item_window3.update
    @item_window4.update
    @item_window5.update
    for i in 0..3
      @savefile_windows[i].update
    end
    @exit_window.update
    if @command_window.active
      update_command
      return
    end
  end
  def delay(seconds)
    for i in 0...(seconds * 1)
      sleep 0.01
      Graphics.update
    end
  end
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      loop do
        if @command_window.y > -64
          @command_window.y -= 8
        end
        if @battler_window.x > -160
          @battler_window.x -= 16
        end
        if @item_window.x < 640
          @item_window.x += 32
        end
        if @right_window.x < 688
          @right_window.x += 32
        end
        if @savefile_windows[0].y < 480
          @savefile_windows[0].y += 32
        end
        if @savefile_windows[1].y < 624
          @savefile_windows[1].y += 32
        end
        if @savefile_windows[2].y < 768
          @savefile_windows[2].y += 32
        end 
        if @savefile_windows[3].y < 912
          @savefile_windows[3].y += 32
        end 
        if @exit_window.x < 640
          @exit_window.x += 32
        end
        delay(1)
        if @exit_window.x >= 640 and @savefile_windows[3].y >= 912
          break
        end
      end

      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::R)
      if $pg < $game_party.actors.size - 1
        $game_system.se_play($data_system.cancel_se)
        $pg += 1
        redraw_info
        return
      end
    end
    if Input.trigger?(Input::L)
      if $pg > 0
        $game_system.se_play($data_system.cancel_se)
        $pg -= 1
        redraw_info
        return
      end
    end
    case @command_window.index
    when 0
      @item_window.visible = true
      @help_window.visible = @right_window.visible = false
      @right_window.x = 688
      if Input.trigger?(Input::DOWN)
        main_item
        @command_window.active = false
      end
      return
    when 1
      @help_window.visible = @item_window.visible = false
      @right_window.visible = true
      @item_window.x = 640
      for i in 0..3
        @savefile_windows[i].visible = false
      end
      @savefile_windows[0].y = 480
      @savefile_windows[1].y = 624
      @savefile_windows[2].y = 768
      @savefile_windows[3].y = 912
      if Input.trigger?(Input::DOWN)
        main_equip
        @command_window.active = false
      end
    when 2
      @exit_window.visible = @help_window.visible = @right_window.visible = false
      for i in 0..3
        @savefile_windows[i].visible = true
      end
      @right_window.x = 688
      @exit_window.x = 640
      if Input.trigger?(Input::DOWN)
        main_save
        @command_window.active = false
      end      
      return
    when 3
      @exit_window.visible = true
      for i in 0..3
        @right_window.visible = @help_window.visible = @item_window.visible = @savefile_windows[i].visible = false
      end
      @savefile_windows[0].y = 480
      @savefile_windows[1].y = 624
      @savefile_windows[2].y = 768
      @savefile_windows[3].y = 912
      if Input.trigger?(Input::DOWN)
        main_exit
        @command_window.active = false
      end  
    end
  end
  def redraw_info
    @actor = $game_party.actors[$pg]
    @info_window.dispose
    @battler_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
    @info_window = Window_PlayerInfo.new($pg)
    @info_window.y = 384
    @info_window.x = 80
    @battler_window = Window_Battler.new($pg)
    @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)
    @item_window1.opacity = @item_window2.opacity = @item_window3.opacity = @item_window4.opacity = @item_window5.opacity = @right_window.opacity = @battler_window.opacity = @info_window.opacity = 160
    @item_window1.visible = @item_window2.visible = @item_window3.visible = @item_window4.visible = @item_window5.visible = false
  end
  

#=========================================================================
# Item
#=========================================================================
  def main_item
    @item_window.active = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_item_command
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(0,$pg)
        break
      elsif $scene != self
        break
      end
    end
    @command_window.active = true
  end
  def update_item_command
    @help_window.update
    @item_window.update
    @target_window.update
    if @item_window.active
      update_item
      return
    end
    if @target_window.active
      update_target_item
      return
    end
  end
  def update_item
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @target_window.x = 306
        @target_window.visible = true
        @target_window.active = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  def update_target_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      unless $game_party.item_can_use?(@item.id)
        @item_window.refresh
      end
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.item_number(@item.id) == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if @target_window.index == -1
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      if @target_window.index >= 0
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      if used
        $game_system.se_play(@item.menu_se)
        if @item.consumable
          $game_party.lose_item(@item.id, 1)
          @item_window.draw_item(@item_window.index)
        end
        @target_window.refresh
        if $game_party.all_dead?
          $scene = Scene_Gameover.new
          return
        end
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $scene = Scene_Map.new
          return
        end
      end
      unless used
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
  
#==============================================================================
# Equip
#==============================================================================
  def main_equip
    @right_window.active = true
    refresh_equip
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_equip
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(1,$pg)
        break
      elsif $scene != self
        break
      end
    end
  end
  def refresh_equip
    @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)
    item1 = @right_window.item
    case @right_window.index
    when 0
      @items_window = @item_window1
    when 1
      @items_window = @item_window2
    when 2
      @items_window = @item_window3
    when 3
      @items_window = @item_window4
    when 4
      @items_window = @item_window5
    end
  end
  def update_equip
    @right_window.update
    @items_window.update
    refresh_equip
    if @right_window.active
      update_right
      return
    end
    if @items_window.active
      update_item_equip
      return
    end
  end
  def update_right
    if Input.trigger?(Input::C)
      if @actor.equip_fix?(@right_window.index)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @right_window.active = false
      @items_window.active = true
      @items_window.index = 0
      return
    end
  end
  def update_item_equip
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @right_window.active = true
      @items_window.active = false
      @items_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.equip_se)
      item = @items_window.item
      @actor.equip(@right_window.index, item == nil ? 0 : item.id)
      @right_window.active = true
      @items_window.active = false
      @items_window.index = -1
      @right_window.refresh
      @items_window.refresh
      return
    end
  end
  #==============================================================================
  # Save
  #==============================================================================
  def main_save
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_save      
      if $scene != self
        break
      elsif $scene != self
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(2,$pg)
        break
      end
    end
    Graphics.freeze
  end
  def update_save
    for i in @savefile_windows
      i.update
    end
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < 3
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 1) % 4
        @savefile_windows[@file_index].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 3) % 4
        @savefile_windows[@file_index].selected = true
        return
      end
    end
  end
  def make_filename(file_index)
    return "Save#{file_index + 1}.rxdata"
  end
  def on_decision(filename)
    $game_system.se_play($data_system.save_se)
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    if @from_exit
      $scene = Scene_Title.new
      @from_exit = false
    else
      $scene = Scene_Menu.new(2,$pg)
    end
  end
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    if @from_exit
      $scene = Scene_Menu.new(3,$pg,false)
    else
      $scene = Scene_Menu.new(2,$pg)
    end
  end
  def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
    $game_system.magic_number = $data_system.magic_number
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
  end
  #==============================================================================
  # Exit
  #==============================================================================
  def main_exit
    @exit_window.active = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update_exit
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(3,$pg)
        break
      elsif $scene != self
        break
      end
    end
  end
  def update_exit
    @exit_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(3)
      return
    else
      
    end
    if Input.trigger?(Input::C)
      case @exit_window.index
      when 0
        command_save_e_shutdown
      when 1
        command_shutdown
      when 2
        command_load
      end
      return
    end
  end
  def command_save_e_shutdown
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_Menu.new(2,$pg,true)
  end
  def command_shutdown
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_fade(800)
    Audio.bgs_fade(800)
    Audio.me_fade(800)
    $from_menu = false
    $scene = Scene_Title.new
  end
  def command_load
    $game_system.se_play($data_system.decision_se)
    $from_menu = true
    $scene = Scene_Load.new
  end
  
end

class Scene_Load < Scene_File
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    if $from_menu
      $scene = Scene_Menu.new(3)
    else
      $scene = Scene_Title.new
    end
  end
end

class Scene_Map
  def main
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 416
    @steps_window = Window_Steps.new
    @steps_window.x = 320
    @steps_window.y = 384
    @info_window = Window_PlayerInfo.new($pg)
    @info_window.y = 384
    @info_window.x = 80
    @info_window.opacity = @steps_window.opacity = @gold_window.opacity = 160
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @message_window.dispose
    @gold_window.dispose
    @steps_window.dispose
    @info_window.dispose
    if $scene.is_a?(Scene_Title)
      Graphics.transition
      Graphics.freeze
    end
  end
  alias bpmenu_scenemap_update update
  def update
    @gold_window.refresh
    @steps_window.refresh
    @info_window.update
    bpmenu_scenemap_update
    if Input.trigger?(Input::R)
      if $pg < $game_party.actors.size - 1
        $game_system.se_play($data_system.cancel_se)
        $pg += 1
        @info_window.dispose
        @info_window = Window_PlayerInfo.new($pg)
        @info_window.y = 384
        @info_window.x = 80
        @info_window.opacity = 160
        return
      end
    end
    if Input.trigger?(Input::L)
      if $pg > 0
        $game_system.se_play($data_system.cancel_se)
        $pg -= 1
        @info_window.dispose
        @info_window = Window_PlayerInfo.new($pg)
        @info_window.y = 384
        @info_window.x = 80
        @info_window.opacity = 160
        return
      end
    end
  end
  def call_menu
    $game_temp.menu_calling = false
    if $game_temp.menu_beep
      $game_system.se_play($data_system.decision_se)
      $game_temp.menu_beep = false
    end
    $game_player.straighten
    $scene = Scene_Menu.new(0,$pg)
  end
end
 
This is REALLY GREAT, and I ask this again:

Are you going to post this in Completed Scripts, or do you want me to do it for you?

EDIT: I can't believe I overlooked this. On the box that has all the character information, could you possibly have the HP and SP in red and green bars, and then how much is left in (e.g 10/20) in letters underneath the bar. Sorry for the trouble [/EDIT]


I have another suggestion, I'm not sure it will work, but how about when you press Q and W/PgUp and PgDwn to go through the characters, how about the lead character actually switches with whoevers in the box.


Because, now I think about it, that I just said won't work out, so maybe this:
Or maybe an extra menu option that allows you to switch lead characters.

No need to do it though. I worship you man,
BP
 
Are you going to post this in Completed Scripts, or do you want me to do it for you?
This is your choice because i realized this script for you.
If you want put on the Completed Script you can do it.
I have another suggestion, I'm not sure it will work, but how about when you press Q and W/PgUp and PgDwn to go through the characters, how about the lead character actually switches with whoevers in the box.


Because, now I think about it, that I just said won't work out, so maybe this:
Or maybe an extra menu option that allows you to switch lead characters.
For the Leader maybe i can add an extra menu. Thanks for the suggestion.
 

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