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.

Options Menu

Yeah, so I have an options menu, and as far as I can tell, I'm doing this right, but apparently not. I'm calling the menu using this code:  $scene = Scene_Options.new....But it's not working. I keep getting an argument error. The error says
---------------------------------------------------------------------------------------------------------
Script 'Title Screen' line 312:ArgumentError ocurred
Wrong number of arguments(0 for 1)
---------------------------------------------------------------------------------------------------------
This is really annoying because I know it has nothing to do with the title. This options menu did the same exact thing in the demo when I got it. I'll note that this IS supposed to be an options menu for the title. But i have everything in my title set up correctly. The credits menu works fine, which is brought up the same way.($scene = Scene_Credits.new)Please help. My title screen is ALMOST complete. This is the last thing I need.

Here's the code for the options:


Code:
#_______________________________________________________________________________

#   Options Menu

#

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

 

class Window_OptionsClear< Window_Base

  def initialize

    super(170, 5, 300, 345)

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

    self.opacity = 0

    self.contents.font.size = 24

    self.contents.draw_text(70, 0, 120, 32, "Options Menu")

    self.contents.draw_text(0, 20, 300, 32, "--------------------------------------------")

    self.contents.font.size = 16

    self.contents.draw_text(40, 40, 250, 32, "Keep on Equip Description Window")

    self.contents.draw_text(40, 60, 250, 32, "Toggle Face Support")

    self.contents.draw_text(40, 80, 250, 32, "Full Screen/Window Toggle")

    self.contents.draw_text(40, 100, 250, 32, "Help Mode") 

    self.contents.draw_text(20, 135, 250, 32, "Volumes")

    self.contents.draw_text(50, 155, 250, 32, "Music Level")

    self.contents.draw_text(50, 170, 300, 32, "--------------------------------------")

    self.contents.draw_text(50, 185, 250, 32, "Sound Level")

    self.contents.draw_text(50, 200, 300, 32, "--------------------------------------")      

    self.contents.draw_text(20, 220, 250, 32, "Menu Background Skin")

    self.contents.draw_text(50, 240, 250, 32, "Default   1   2   3   4   5   6   7   8   9")

    self.contents.draw_text(20, 262, 250, 32, "Map HUD")

    self.contents.draw_text(50, 282, 280, 32, "Off        Normal Mode        Full Mode")

 

  end    

end

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

 

class Window_Options < Window_Base

  

  def initialize

    super(170, 5, 300, 345)

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

    self.opacity = 175

    refresh

  end

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

  

    def refresh

     

    self.contents.clear

    self.contents.font.size = 16

    self.contents.draw_text(215, 170, 250, 32, "(" + $game_system.music_level.to_s + "%)")

    self.contents.draw_text(215, 200, 250, 32, "(" + $game_system.sound_level.to_s + "%)")    

    y_spot = [40,60,80,100,155,185,220,262]

    

    i = $game_system.option_decision   

    self.contents.draw_text(2, y_spot[i], 250, 32, "->")

    

    i = $game_system.music_level

    self.contents.draw_text(50 + 1.5*i, 170, 250, 32, "|")

    i = $game_system.sound_level

    self.contents.draw_text(50 + 1.5*i, 200, 250, 32, "|")  

 

    end

    end

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

class Scene_Options

  

  def initialize(menu_index)

    $game_system.sound_music = 0

    $game_system.option_decision = menu_index

  end

  

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

  def main

    @command_window = Window_Command.new(160,["Item", "Abilities", "Equipment", "Change Party", "Save Game", "End Game"])

    @command_window.opacity = 175; @command_window.x = 5; @command_window.y = 5

    @command_window.active = false

    @battler = Window_Battler.new        

    @gold_window = Window_Gold.new      

    @location_window = Window_Location.new

    @playtime_window = Window_PlayTime2.new

    @status_window = Window_MenuStatus2.new

    @sprite = Spriteset_Map.new

    @right_window = Window_RightCorner.new

    @options_window = Window_Options.new 

    @options_window2=Window_OptionsClear.new

    s1 = [@checkmark1, @checkmark2, @checkmark3, @checkmark4, @checkmark5, @checkmark6, @checkmark7] 

    s2 = [$game_system.version_104, $game_system.face_support, $game_system.full_screen, $game_system.help_mode]

    s3 = [40,60,80,100]

    

    for i in 0..3

        s1[i] = Sprite.new

      if s2[i] == 1

            s1[i].bitmap = RPG::Cache.picture("checked1.PNG")

      else

            s1[i].bitmap = RPG::Cache.picture("Unchecked.PNG")

      end

        s1[i].x = 205

        s1[i].y = s3[i] + 30

        s1[i].z = 1000

    end 

 

    s2= [146, 194, 303]

    for i in 0..2

        s1[i+5] = Sprite.new

        s1[i+5].bitmap = RPG::Cache.picture("Unchecked.PNG")

        if  i == $game_system.map_hud

            s1[i+5].bitmap = RPG::Cache.picture("checked1.PNG")

        end

        s1[i+5].x = 70 + s2[i]

        s1[i+5].y = 312

        s1[i+5].z = 1000  

    end

 

    j = $game_system.windowskin_name.to_i

    s4 = Sprite.new

    if j == 0

    s4.bitmap = RPG::Cache.picture("Uncheckedlong.PNG")

    s4.x = 230

    elsif 0 < j  and j <= 9

    s4.bitmap = RPG::Cache.picture("Unchecked.PNG")

    s4.x = 265 + j*19

   end

    s4.y = 270

    s4.z = 5  

    

    if $game_system.save_disabled

        @command_window.disable_item(4)

    end

    

    Graphics.transition

    loop do

      Graphics.update

      Input.update

      update

      update_options

     

      if $scene != self

        break

      end

 

    end

    Graphics.freeze

    @command_window.dispose; @status_window.dispose; @gold_window.dispose

    @playtime_window.dispose; @battler.dispose; @options_window.dispose

    @location_window.dispose; @sprite.dispose; @right_window.dispose #;@back1.dispose

    @options_window2.dispose; s4.dispose

    

    for i in 0..3

        s1[i].bitmap.dispose    

    end

    for i in 5..7

        s1[1].bitmap.dispose

      end

 

  

  end

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

  def update

    @playtime_window.update; $game_system.update

    $game_system.char_max = $game_party.actors.size

    

    if Input.repeat?(Input::RIGHT)

       if $game_system.option_decision == 4

             $game_system.music_level += 5    

             $game_system.bgm_memorize

             $game_system.bgm_restore

              if $game_system.music_level >= 100

                 $game_system.music_level = 100

              end

       elsif $game_system.option_decision == 5

             $game_system.sound_level += 5

             $game_system.bgs_memorize

             $game_system.bgs_restore

             if $game_system.sound_level >= 100

                $game_system.sound_level = 100

             end

       elsif $game_system.option_decision == 6

       i = $game_system.windowskin_name.to_i

       i = i+1

       if i == 10

          i = 0

       end         

       $game_system.windowskin_name = i.to_s

       $scene = Scene_Options.new(6)

       elsif $game_system.option_decision == 7

                $game_system.map_hud += 1

            if $game_system.map_hud == 3

               $game_system.map_hud = 2

            end

       end

        @options_window.refresh

        $game_system.se_play($data_system.decision_se)    

    end

    

    if Input.repeat?(Input::LEFT)

      if $game_system.option_decision == 4

             $game_system.music_level -= 5

             $game_system.bgm_memorize

             $game_system.bgm_restore

                if $game_system.music_level <= 0

                   $game_system.music_level = 0

                end

      elsif $game_system.option_decision == 5

            $game_system.sound_level -= 5

            $game_system.bgs_memorize

            $game_system.bgs_restore

                if $game_system.sound_level <= 0

                   $game_system.sound_level = 0

                 end

      elsif $game_system.option_decision == 6

       i = $game_system.windowskin_name.to_i

       i = i - 1

             if i == -1

                 i = 9

             end           

       $game_system.windowskin_name = i.to_s

       $scene = Scene_Options.new(6)

        elsif $game_system.option_decision == 7

                $game_system.map_hud -= 1

            if $game_system.map_hud == -1

               $game_system.map_hud = 0

            end

        end   

              

        @options_window.refresh

        $game_system.se_play($data_system.decision_se)    

    end

    

    if Input.trigger?(Input::B)

      $game_system.se_play($data_system.cancel_se)

      $scene = Scene_Menu.new

      return

    end

 

  end

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

 def update_options

    

  if Input.trigger?(Input::C)

    $game_system.se_play($data_system.decision_se)

    

    if $game_system.sound_music == 0

 

      if $game_system.option_decision == 0

           if $game_system.version_104 == 1

               $game_system.version_104 = 0

           else

               $game_system.version_104 = 1

           end

       end

       if $game_system.option_decision == 1

            if $game_system.face_support == 1

               $game_system.face_support = 0

            else

               $game_system.face_support = 1

            end

        end

        if $game_system.option_decision == 2

            if $game_system.full_screen == 1

               $game_system.full_screen = 0

               $game_system.screen_size

            Graphics.update

            sleep 1.0

            else

               $game_system.full_screen = 1

               $game_system.screen_size

               Graphics.update

               sleep 1.0     

            end

        end

        if $game_system.option_decision == 3

            if $game_system.help_mode == 1

               $game_system.help_mode = 0

            else

               $game_system.help_mode = 1

            end

          @right_window.refresh

        end

        @status_window.refresh

        @options_window.refresh

  

  end

end

 

      s1 = [@checkmark1, @checkmark2, @checkmark3, @checkmark4, @checkmark5, @checkmark6, @checkmark7] 

      s2 = [$game_system.version_104, $game_system.face_support, $game_system.full_screen, $game_system.help_mode]

      s3 = [40,60,80,100]

       

     for i in 0..3

       s1[i] = Sprite.new

         if s2[i] == 1

             s1[i].bitmap = RPG::Cache.picture("checked1.PNG")

         else

             s1[i].bitmap = RPG::Cache.picture("Unchecked.PNG")

         end

       s1[i].x = 205

       s1[i].y = s3[i] + 30

       s1[i].z = 1000

     end

 

    s2= [146, 194, 303]

    for i in 0..2

        s1[i+5] = Sprite.new

        s1[i+5].bitmap = RPG::Cache.picture("Unchecked.PNG")

        if  i == $game_system.map_hud

            s1[i+5].bitmap = RPG::Cache.picture("checked1.PNG")

        end

        s1[i+5].x = 70 + s2[i]

        s1[i+5].y = 312

        s1[i+5].z = 1000  

    end

      

     if Input.repeat?(Input::DOWN)

       $game_system.option_decision += 1

        if  $game_system.sound_music == 0

                if  $game_system.option_decision == 8

                    $game_system.option_decision = 0

                end

        elsif $game_system.sound_music == 1

                if  $game_system.option_decision == 2

                    $game_system.option_decision = 0

                end

        end

        $game_system.se_play($data_system.decision_se)

        @options_window.refresh

     end

     

     if Input.repeat?(Input::UP)

        $game_system.option_decision -= 1

        if $game_system.sound_music == 0

                if $game_system.option_decision == -1

                   $game_system.option_decision = 7

                end

        elsif $game_system.sound_music == 1

                if  $game_system.option_decision == -1

                    $game_system.option_decision = 1

                end         

        end

        $game_system.se_play($data_system.decision_se)

        @options_window.refresh

    end

      

end

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

  def delay(seconds)

    

     for i in 0...(seconds * 1)

      sleep 0.01

      Graphics.update

     end

   

  end

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

end

Here are the images that go with it.
 
Here's your problem:
Code:
  def initialize(menu_index)

    $game_system.sound_music = 0

    $game_system.option_decision = menu_index

  end
Under Scene_Options this is the initialize method. It requires 1 argument. Either you change (menu_index) into (menu_index = 0), or you have to supply an index whenever using .new. So for instance:
Code:
$scene = Scene_Options.new(0)
 
Unless you have a class that defines the sound_music variable within Game_System as a writer you cannot set a value for it. The script in the first post has no such thing. A way to add this can be done as simple as this:
Code:
class Game_System
  attr_accessor :sound_music
  alias_method(:system_int, :initialize)
  def initialize
    system_int
    @sound_music = nil
  end
end
What I don't get is why the script didn't include this to begin with.
 
EDIT: Ok, so mediafire is being a dick and it keeps giving me a server error. Idk about you though. Is it working for you?If it isn't, i'm just gonna make a new account with megaupload or something, because I tried re-uploading it several times, and to no avail.

Ok! Finally!Here's the link. Lol, i'm having terrible luck today. Megaupload said i already had an account.  :dead:
which I don't.

http://rapidshare.com/files/153360619/Options_Menu.exe
 
Dude, where did you get this from? Tons of non-default classes are missing. It led me to Window_Battler being gone. There isn't even such a thing in the default RMXP list. You might want to re-download this or get a different options system.
 
*Sigh*

Do you know of any good ones you can recommend me then. I'm having massive problems finding a good one. Aleworks doesn't work for me for whatever reason...All I need is something basic. Something that changes BGM volume, BGS volume, text color, font type, windowskin, and message speed.
 
I have never used an option system personally, but it shouldn't be hard to find. I couldn't find any by simply searching at the current rate, but I know there are a few. Possibly, though, the systems you will find will not include a message speed changer, as it's not there by default anyhow. Shouldn't be hard to change, however.

EDIT: Wait a minute. The Scene_Options is a CMS, not an options screen. Just look at the command window:
Code:
@command_window = Window_Command.new(160,["Item", "Abilities", "Equipment", "Change Party", "Save Game", "End Game"])
What have you been downloading? :P It's obviously a mix with an options screen included. You might wanna look into this.
 
Ok...I've tried a few myself too, and each one always gives me some sorta error. If I get one, is there any chance I can PM you or something for help?, as I only know of 2 other option menus

EDIT:Yeah, well actually, lol, I didn't know that. The download I got was a CMS a guy made. I noticed in the description though, that there was an option script, so i figured what the hell, and just took that. That's oubviously the reason. Excuse my ignrance, as I have little to no scripting knowledge.

I could give you the link to the CMS if you want. Maby you could make it so I can just use the options menu for the title screen. That would be cool. I have no idea if that would require massive script editing though...

EDIT:  :lol: I feel like such a dumbass now. It probably would have helped If I mentioned that. Sorry about that. Note that me taking that one thing though was just a last resort. I wasn't sure if it would work 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