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.

Default Menu Edit for Easy Editing

Ok, well I want an edit of the default VX menu. Basicly rewrite the code, so it can be easily edited. By this I mean block off areas for this box size and commands, and that size and commands. I don't really know what else to say, I just want ot be able to edit stuff myself, but I don't know how to with the default scripts.
 
Well I can usually figure stuff out if I can just see what it is I am editing, like I had a rewritten title script and I edited that to my liking becaus the comments told me where things were, and I pieced it togother from there.
 
If this doesn't help you understand(and edit it more) than I don't know what to help you with. I edited things and added comments to almost everything but the bottom part. So, enjoy. (I'll be using this myself seeing as I can understand it more easily!)

Code:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0) # (menu_index = 0) IS USED FOR 
                                 # @command_window.index
    @menu_index = menu_index     # CHANGES TO BE USED AS @menu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start                                        # REPLACES "main" IN VX
    super                                          # NEEDED FOR "start" TO WORK
                                                   # PROPERLY
    create_menu_background                         # BLURS/DARKENS THE BACKGROUND
    create_command_window                          # CREATES COMMAND WINDOW
    @gold_window = Window_Gold.new(0, 360)         # DISPLAYS GOLD WINDOW
    @status_window = Window_MenuStatus.new(160, 0) # DISPLAYS STATUS WINDOW FOR
                                                   # ACTORS
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate              # DISPOSE OF MENU'S WINDOW'S AND BACKGROUND
    super                    # NEEDED FOR "terminate" TO WORK PROPERLY
    dispose_menu_background  # DISPOSE OF MENU BACKGORUND IMAGE
    @command_window.dispose  # DISPOSE OF COMMAND(SELECTION) WINDOW/MENU
    @gold_window.dispose     # DISPOSE OF GOLD WINDOW
    @status_window.dispose   # DISPOSE OF STATUS(ACTOR STATS) WINDOW/MENU
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update                    # UPDATES ALL WINDOWS
    super                       # NEEDED FOR "update" TO WORK PROPERLY
    update_menu_background      # UPDATES THE BACKGROUND IMAGE
    @command_window.update      # UPDATES THE COMMAND WINDOW(UP/DOWN, C/B)
    @gold_window.update         # UPDATES GOLD WINDOW(IF A SCRIPT GIVES YOU 
                                # GOLD)
    @status_window.update       # UPDATES STATUS WINDOW(IF YOU USE SKILL OR 
                                # STATUS)
    if @command_window.active   # IF THE COMMAND WINDOW IS BEING USED
      update_command_selection  # UPDATE THE SELECTIONS(UP/DOWN)
    elsif @status_window.active # UPDATE THE STATUS WINDOW (ACTOR SELECTION) *
      update_actor_selection    # UPDATE *
    end
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window # CREATES COMMAND WINDOW(SELECTING)
    s1 = "Item"             # SHOWS ITEM   SELECTION
    s2 = "Skill"            # SHOWS SKILL  SELECTION
    s3 = "Equip"            # SHOWS EQUIP  SELECTION
    s4 = "Status"           # SHOWS STATUS SELECTION
    s5 = "Save"             # SHOWS SAVE   SELECTION
    s6 = "End"              # SHOWS END    SELECTION
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index # DIRECTS @command_window.index TO USE
                                        # @menu_index
    check_party_size       # CHECKS PARTY SIZE
    check_save_disabled    # CHECKS IF SAVE IS DISABLED
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B) # WHEN YOU PRESS ESCAPE
      Sound.play_cancel         # THIS PLAYS CANCEL SE (Returns to map)
      $scene = Scene_Map.new    # RETURNS TO MAP
    elsif Input.trigger?(Input::C) # WHEN YOU PRESS SPACE
      verify_party_size            # VERIFYS PARTY SIZE
      verify_save_disabled         # VERIFYS IF SAVE IS DISABLED
      Sound.play_decision          # THIS PLAYS DECISION AND MOVES TO NEX MENU
      case @command_window.index   # DIRECTS TO MENU'S INDEX
      when 0      # Item           # WHEN s1
        $scene = Scene_Item.new    # GO TO ITEMS
      when 1,2,3  # Skill, etc     # WHEN s2-s4
        start_actor_selection      # MOVE TO ACTOR SELECTION
      when 4      # Save           # WHEN s5 OPEN SAVE MENU
        $scene = Scene_File.new(true, false, false) # SET SAVE TO TRUE AND LOAD 
                                                    # TO FALSE, OPENS SAVE MENU
      when 5      # End Game       # WHEN s6
        $scene = Scene_End.new     # OPENS END GAME MENU
      end
    end
  end
  #-----------------------------------------------------------------------------
  # * CHECKS THE PARTY'S SIZE
  #-----------------------------------------------------------------------------
  def check_party_size # **
    if $game_party.members.size == 0          # WHEN NO PARTY MEMBERS
      @command_window.draw_item(0, false)     # DISABLES ITEM   SELECTION
      @command_window.draw_item(1, false)     # DISABLES SKILL  SELECTION
      @command_window.draw_item(2, false)     # DISABLES SKILL  SELECTION
      @command_window.draw_item(3, false)     # DISABLES STATUS SELECTION
    end
  end
  #-----------------------------------------------------------------------------
  # * CHECKS IF SAVE IS DISABLED
  #-----------------------------------------------------------------------------
  def check_save_disabled # ***
    if $game_system.save_disabled             # IF SAVE IS DISABLED
      @command_window.draw_item(4, false)     # BLOCK SAVING
    end
  end
  #-----------------------------------------------------------------------------
  # * VERIFYS THE PARTY'S SIZE
  #-----------------------------------------------------------------------------
  def verify_party_size
    if $game_party.members.size == 0 and @command_window.index < 4 # IF **
      Sound.play_buzzer # PLAYS BUZZER SE
      return            # RETURN ??
    end
  end
  #-----------------------------------------------------------------------------
  # * VERIFYS IF SAVE IS DISABLED
  #-----------------------------------------------------------------------------
  def verify_save_disabled
    if $game_system.save_disabled and @command_window.index == 4 # IF ***
      Sound.play_buzzer # PLAYS BUZZER SE
      return            # RETURN ??
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection # SWITCHED COMMAND MENU TO ACTOR MENU
    @command_window.active = false  # CHANGES COMMAND(SELECTION) MENU TO FALSE 
    @status_window.active = true    # CHANGES STATUS(ACTOR) MENU TO TRUE
    if $game_party.last_actor_index < @status_window.item_max # DISPLAYS ACTORS
      @status_window.index = $game_party.last_actor_index # MOVES TO LAST ACTOR
    else                       # IF NO PREVIOUS SELECTION
      @status_window.index = 0 # MAKE ACTOR SELECTION ACTOR 1
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection         # SWITCHES ACTOR MENU TO COMMAND MENU
    @command_window.active = true # CHANGES COMMAND(SELECTION) MENU TO TRUE
    @status_window.active = false # CHANGES STATUS(ACTOR) MENU TO FALSE
    @status_window.index = -1     # STOPS STATUS MENU
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection    # ACTOR SELECTION UPDATE
    if Input.trigger?(Input::B) # IF ESCAPE IS PRESSED
      Sound.play_cancel         # PLAY CANCEL SE
      end_actor_selection       # RETURN TO COMMMAND(SELECTION) WINDOW
    elsif Input.trigger?(Input::C) # IF SPACE IS PRESSED
      $game_party.last_actor_index = @status_window.index # MOVE TO STATUS WINDOW
      Sound.play_decision                                 # PLAY DECISION SE
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end
 

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