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.

2 scripts not working with eachother

I go a FFIII Menu Script:
Code:
#===============================================================================

# Final Fantay III Menu Style
#-------------------------------------------------------------------------------
# - By Zero Maverick Hunter -
# - Created - 20 / 08 / 2007 -
# - Based on FF3 Real Menu -
#===============================================================================

#
# Intructions:
#
# 1. - Need faces 80 x 80 pixels in the "Picture Folder" of each character with
#      this code:
#        Example ==> Z001-Fighter01
#                ==> "Z" + "Player Battler Name"*
#
#        *(This could be seen in the Battlers or Characters Folder)
#
#===============================================================================


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


# Window_Base
#-------------------------------------------------------------------------------
# Adding Faces to the Menu and applying some changes
#===============================================================================


class Window_Base < Window

  def ff3_color
    return Color.new(50, 230, 255, 255)
  end

  def draw_actor_face(actor, x, y)
    face = RPG::Cache.picture("Z" + actor.character_name)
    fw = face.width
    fh = face.height
    src_rect = Rect.new(0, 0, fw, fh)
    self.contents.blt(x - fw / 23, y - fh, face, src_rect)
  end

  def draw_actor_level(actor, x, y)
    self.contents.font.color = ff3_color
    self.contents.draw_text(x, y, 32, 32, "Lv")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 80, y, 24, 32, actor.level.to_s, 2)
  end

  def draw_actor_hp(actor, x, y, width = 144)
    self.contents.font.color = ff3_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    if width - 32 >= 108
      hp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      hp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    self.contents.draw_text(hp_x + 20, y, 48, 32, actor.hp.to_s, 2)
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(hp_x + 68, y, 12, 32, "/", 1)
      self.contents.draw_text(hp_x + 115, y, 48, 32, actor.maxhp.to_s)
    end
  end

  def draw_actor_sp(actor, x, y, width = 144)
    self.contents.font.color = ff3_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    if width - 32 >= 108
      sp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x + 20, y, 48, 32, actor.sp.to_s, 2)
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 68, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 115, y, 48, 32, actor.maxsp.to_s)
    end
  end
end

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

# Window_Stats
#-------------------------------------------------------------------------------
# This Window shows the party Money and Steps
#===============================================================================


class Window_FF3_Stats < Window_Base

  def initialize
    super(0, 0, 135, 127)
    self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = "Verdana"
    self.contents.font.size = 17
    refresh
  end

  def refresh
    self.contents.clear
    self.contents.clear
    self.contents.font.color = ff3_color
    self.contents.draw_text(2, -8, 120, 32, "Steps")
    self.contents.font.color = normal_color
    self.contents.draw_text(-20, 20, 120, 32, $game_party.steps.to_s, 2)

    cx = contents.text_size($data_system.words.gold).width
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 67, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = ff3_color
    self.contents.draw_text(2, 42, cx, 32, $data_system.words.gold, 2)
  end
end

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

# Window_FF3_PlayTime
#-------------------------------------------------------------------------------
# This Window shows the Played Time, just minutes and hours
#===============================================================================


class Window_FF3_PlayTime < Window_Base

  def initialize
    super(0, 0, 120, 97)
    self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = "Verdana"
    self.contents.font.size = 17
    refresh
  end

  def refresh
    self.contents.clear
    self.contents.font.color = ff3_color
    self.contents.draw_text(4, 0, 120, 24, "Time")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%2d:%02d", hour, min)
    self.contents.font.color = normal_color
    self.contents.draw_text(-38, 38, 120, 24, text, 2)
  end

  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end

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

# Window_MenuStatus
#-------------------------------------------------------------------------------
# Writes part of the actors status
#===============================================================================


class Window_FF3_MenuStatus < Window_Selectable

  def initialize
    super(0, 0, 545, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Verdana"
    self.contents.font.size = 17
    refresh
    self.active = false
    self.index = -1
  end

  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 94
      y = i * 114
      actor = $game_party.actors[i]
      draw_actor_face(actor, 7, y + 104)
      draw_actor_name(actor, x + 30, y)
      draw_actor_level(actor, x + 50, y + 33)
      draw_actor_hp(actor, x + 50, y + 50)
      draw_actor_sp(actor, x + 50, y + 67)
    end
  end

  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(-3, @index * 114, self.width - 150, 107)
    end
  end
end

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

# FF3 Menu Style
#-------------------------------------------------------------------------------
# Combine multiple kind of Windows to make the Scene_Menu like in FF3
#===============================================================================


class Scene_Menu

  def initialize(menu_index = 0, order_index = 0)
    @menu_index = menu_index
    @order_index = order_index
    @changer = 0
    @where = 0
    @checker = 0
  end
  
  def main
    s1 = "   Items"
    s2 = "   Magic"
    s3 = "   Equip"
    s4 = "   Status"
    s5 = "   Save"
    @command_window = Window_Command.new(120, [s1, s2, s3, s4, s5,])
    @command_window.x = 475
    @command_window.y = 0
    @command_window.z = 110
    @command_window.index = @menu_index
    @command_window.opacity = 255

    if $game_party.actors.size == 0
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    if $game_system.save_disabled
      @command_window.disable_item(4)
    end

    u1 = "  Order"
    @order_window = Window_Command.new(110, [u1])
    @order_window.x = 0
    @order_window.y = 0
    @order_window.index = @order_index
    @order_window.opacity = 255
    @order_window.active = false
    @order_window.visible = false

    if $game_party.actors.size == 1
      @order_window.disable_item(0)
    end

    @status_window = Window_FF3_MenuStatus.new
    @status_window.x = 50
    @status_window.y = 0
    @status_window.opacity = 255

    @time_window = Window_FF3_PlayTime.new
    @time_window.x = 475
    @time_window.y = 256
    @time_window.z = 110
    @time_window.opacity = 255

    @stats_window = Window_FF3_Stats.new
    @stats_window.x = 460
    @stats_window.y = 353
    @stats_window.z = 110
    @stats_window.opacity = 255

    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @order_window.dispose
    @status_window.dispose
    @time_window.dispose
    @stats_window.dispose
  end

  def update
    @time_window.update
    @stats_window.update
    @command_window.update
    if @command_window.active
      update_command
      return
    end
    @order_window.update
    if @order_window.active
      update_order
      return
    end
    @status_window.update
    if @status_window.active
      update_status
      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::LEFT)
      $game_system.se_play($data_system.decision_se)
      @command_window.active = false
      @command_window.visible = false
      @time_window.visible = false
      @stats_window.visible = false
      @status_window.x = 110
      @order_window.visible = true
      @order_window.active = true
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.actors.size == 0 and @command_window.index < 4
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.actors.size == 1 and @command_window.index == 5
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Item.new
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      end
      return
    end
  end

  def update_order
    if Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cancel_se)
      @order_window.active = false
      @order_window.visible = false
      @command_window.visible = true
      @time_window.visible = true
      @stats_window.visible = true
      @status_window.x = 50
      @command_window.active = true
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.actors.size == 1
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @checker = 0
      @order_window.active = false
      @status_window.active = true
      @status_window.index = 0
      return
    end
  end

  def update_status
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @command_window.visible
        @command_window.active = true
        @status_window.active = false
        @status_window.index = -1
      end
      if @order_window.visible
        @status_window.active = false
        @order_window.active = true
        @status_window.index = -1
      end
      return
    end
    if Input.trigger?(Input::C)
      if @command_window.visible
        case @command_window.index
        when 1
          if $game_party.actors[@status_window.index].restriction >= 2
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Skill.new(@status_window.index)
        when 2
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Equip.new(@status_window.index)
        when 3
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_Status.new(@status_window.index)
        end
      end
      if @order_window.visible
        case @order_window.index
        when 0
          $game_system.se_play($data_system.decision_se)
          if @checker == 0
            @changer = $game_party.actors[@status_window.index]
            @where = @status_window.index
            @checker = 1
          else
            $game_party.actors[@where] = $game_party.actors[@status_window.index]
            $game_party.actors[@status_window.index] = @changer
            @checker = 0
            @status_window.refresh
          end
        end
      end
      return
    end
  end
end

and a Arrange System:
Code:
#==============================================================================
# ** Party Arrange
#------------------------------------------------------------------------------
#  Author: Dargor
#  Requested by: Chessplayer
#  Version 1.2
#  20/09/2007
#==============================================================================
# * Note
#------------------------------------------------------------------------------
# - This script requires the Commands Manager script.
#==============================================================================
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles data surrounding the system. Backround music, etc.
#  is managed here as well. Refer to "$game_system" for the instance of 
#  this class.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :arrange_disabled       # party menu forbidden
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias dargor_arrange_commands_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    dargor_arrange_commands_initialize
    @arrange_disabled = false
  end
end

#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(where=nil)
    # Clear the window
    self.contents.clear
    # If an actor's position is changing, draw a dark grey rectangle
    if where != nil
      # Set the y position
      y = where*116
      # Set the rectangle color
      color = Color.new(65,65,65,200)
      # Draw the rectangle
      self.contents.fill_rect(0,y,480,96,color)
    end
    # Set the maximum number of actors in the party
    @item_max = $game_party.actors.size
    # Draw actors informations (above the rectangle)
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x, y + 64)
      draw_actor_hp(actor, x + 236, y + 32)
      draw_actor_sp(actor, x + 236, y + 64)
    end
  end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Alias listing
  #--------------------------------------------------------------------------
  alias party_arrange_set_commands_access set_commands_access
  alias party_arrange_update update
  alias party_arrange_update_command update_command
  alias party_arrange_update_status update_status
  #--------------------------------------------------------------------------
  # * Set Commands Access
  #--------------------------------------------------------------------------
  def set_commands_access
    # Call the original method
    party_arrange_set_commands_access
    # Disable party command if $game_system.arrange_disabled is true
    if $game_system.arrange_disabled or $game_party.actors.size == 0
      @command_window.disable_item("Arrange")
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Add the "Party" commande once
    @command_window.add_command("Arrange")
    # Call the original update method
    party_arrange_update
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # Call the original update command method
    party_arrange_update_command
    # Assign @command_window.index to it strings
    command = @commands[@command_window.index]
    # If C button is pressed
    if Input.trigger?(Input::C)
      case command
      # When "Party" is selected
      when "Arrange"
        # If party command is disabled
        if $game_system.arrange_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        @checker = 0
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # Call the original update status method
    party_arrange_update_status
    # Assign @command_window.index to it strings
    command = @commands[@command_window.index]
    # If B button is pressed
    if Input.trigger?(Input::B)
      @status_window.refresh
    end
    # If C button is pressed
    if Input.trigger?(Input::C)
      case command
      # When "Party" is selected
      when "Arrange"
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        if @checker == 0
          # If selected actor is not dead, prepare the changes, 
          # display a selection box
          unless $game_party.actors[@status_window.index].dead?
            @changer = $game_party.actors[@status_window.index]
            @where = @status_window.index
            @status_window.refresh(@where)
            $game_player.refresh
            @checker = 1
          else
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
        else
          # If selected actor is not dead, change its position
          unless $game_party.actors[@status_window.index].dead?
            $game_party.actors[@where] = $game_party.actors[@status_window.index]
            $game_party.actors[@status_window.index] = @changer
            @checker = 0
            @status_window.refresh
            $game_player.refresh
          else
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
        end
      end
      return
    end
  end
end


when i try to use the arrange system it says:

Script "Party Arrange" line 167 argumenterror occured.

Wrong number of arguments(1 for 0)


I have no idea what that means so can som1 help me???
 
kinger1000":1hthdg2v said:
#==============================================================================
# * Note
#------------------------------------------------------------------------------
# - This script requires the Commands Manager script.
#==============================================================================

do you have this script? Just a jab in the dark, don;t know if that caused the problem or not : /
 

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