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.

[VX] Submenus

I was wondering (and yes, I am a total noob to RPG VX scripting, but slowly I am learning) if someone would be willing to help me in making submenus. Actually, help isn't the right word. Make is. Since, like I said, i'm a scripting noob. I've already tried multiple times on my own to do this, but I fail at life ;P. And I've looked around at some menut scripts with submenus and tried to find and edit them to my own needs... but I fail even more at that.

It seems like one of the most simple things to me. I just want it so when you choose something on the menu, another sub-menu pops up with more choices. I mainly want this since I'm doing multiple ways of customization (I've already taken these amazing scripts from users, lol) such as Skill upgrade, weapon upgrade, skill mixing, ect ect. But, that's not the point. I just want simple submenus so that I can call on the menus of the other scripts somehow. Or just use regular menus. ...I'll show what I mean, lol

Status
Item
Equip
  • [Check] -Goes to the regular equip menu.
    [Upgrade]*
    [Enhance]*
Skills
  • [Check] - Goes to regular skills menu.
    [Upgrade]*
    [Mix]*
Beastiary*
System
  • [Save]
    [Load]
    [Sound]*
    [Exit]

*Indicates options that will lead to menus from other scripts. (I'm not too sure how you would call them, or whatever it is. So if you're nice enough to even make the script, explain this to me as well, please? xD)

So yeah, if you can help me with this, I would greatly appreciate this. You can even have my firstborn child. D: and I can give you credits in the game too :3 Since I plan on this being a BIG project... and yeah. Or if you want me to provide some more detail about anything... or links to the scripts by the other users or something... feel free to ask. I'm DESPERATE.
 
A sketch of what you want the submenus to look like would really help. (position, appearance, etc...)
i.e. show a screenshot of the Equip Submenu open.
Also, a specific list of the other scripts you are using & want to integrate into the menu.
And it's always a good idea to list all the custom scripts you have to insure compatibility.

OR... compress your game as you have it now, and upload it & PM the link to whoever accepts the request, and they can just add it to what you have.
(this would be the easiest, since it would also include any resources your other scripts use.)

I would do this, but alas I have no VX.

Be Well
 
For system submenu, you can check my DMS Edit. However, call certain scene that uses actor index of menu status window from submenu, I'm not sure if it will work well, unless it's 1-person menu.(I had some bad experience for that...)
 
Alright, here ya go...

I started with Landarma's Rev.1, so be sure to credit him too.

The methods to plug in your calls to your other scenes start around line 580

Code:
 

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

# L's Custom Menu - Simple DMS Edit (RMVX ver.) Rev.1

# Added Equip & Skills submenus - 27Feb09 - Brew

# Plug in your scene calls starting on line 582

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

 

module MenuCommand

  #Default menu commands +1

  Item     = 'Item'

  Skill    = 'Skill'

  Equip    = 'Equip'

  Status   = 'Status'

  Save     = 'Save'

  Load     = 'Load'

  End_Game = 'Exit'

  #Optional menu commands

  Order    = 'Order'

  Party    = 'Party'

  Option   = 'Option'

  Quest    = 'Quest'

  System   = 'System'

  Beastiary = 'Beastiary'

  Sound    = 'Sound'

  Check    = 'Check'

  Upgrade  = 'Upgrade'

  Enhance  = 'Enhance'

  Mix      = 'Mix'

end

 

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

#  Game_Map

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

class Game_Map

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

#  Name

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

  def name

    $map_infos[@map_id]

  end

end

 

 

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

#  Scene_Title

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

# Setting functions for the Title

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

class Scene_Title

  $map_infos = load_data("Data/MapInfos.rvdata")

  for key in $map_infos.keys

    $map_infos[key] = $map_infos[key].name

  end

end

 

 

class Window_MapName < Window_Base

 def initialize(x, y)

   super(x, y, 160, 96)

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

   refresh

 end

 def refresh

   self.contents.clear

   self.contents.font.color = system_color

   self.contents.draw_text(4, 0, 120, 32, "Location")

   self.contents.font.color = normal_color

   self.contents.draw_text(4, WLH, 120, 32, $game_map.name.to_s, 2)

 end

end

 

 

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

# ** 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 = menu_index

    commands_init

    @changer = 0 #Change Party Order by Yargovish

    @where = 0 #

    @checker = 0  #

  end

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

  # * Set Commands

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

  def commands_init

    @commands = []

    s1 = MenuCommand::Status

    s2 = MenuCommand::Item

    s3 = MenuCommand::Equip

    s4 = MenuCommand::Skill

    s5 = MenuCommand::Beastiary

    s6 = MenuCommand::System

    @commands.push(s1, s2, s3, s4, s5, s6).flatten!

   

    @sys_commands = []

    o1 = MenuCommand::Save

    o2 = MenuCommand::Load

    o3 = MenuCommand::Sound

    o4 = MenuCommand::End_Game

    @sys_commands.push(o1, o2, o3, o4).flatten!

    

    @equip_commands = []

    e1 = MenuCommand::Check

    e2 = MenuCommand::Upgrade

    e3 = MenuCommand::Enhance

    @equip_commands.push(e1, e2, e3).flatten!

 

    @skill_commands = []

    o1 = MenuCommand::Check

    o2 = MenuCommand::Upgrade

    o3 = MenuCommand::Mix

    @skill_commands.push(o1, o2, o3).flatten!

  end

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

  # * Start processing

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

  def start

    super

    create_menu_background

    create_command_window

    create_system_window

    create_equip_window

    create_skill_window

    @gold_window = Window_Gold.new(0, 264)

    @status_window = Window_MenuStatus.new(160, 0)

    @mapname_window = Window_MapName.new(0, 320)

  end

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

  # * Termination Processing

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

  def terminate

    super

    dispose_menu_background

    @command_window.dispose

    @sys_command_window.dispose

    @gold_window.dispose

    @status_window.dispose

    @mapname_window.dispose

  end

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

  # * Frame Update

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

  def update

    super

    update_menu_background

    @command_window.update

    @sys_command_window.update

    @equip_command_window.update

    @skill_command_window.update

    @gold_window.update

    @status_window.update

    @mapname_window.update

    if @command_window.active

      update_command_selection

    elsif @sys_command_window.active

      @sys_command_window.z = +500

      update_sys_command_selection

    elsif @status_window.active

      update_actor_selection

    elsif @equip_command_window.active

      @equip_command_window.z = +500

      update_equip_command_selection

    elsif @skill_command_window.active

      @skill_command_window.z = +500

      update_skill_command_selection      

    end

  end

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

  # * Create Command Window

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

  def create_command_window

    @command_window = Window_Command.new(160, @commands)

    @command_window.index = @menu_index

    if $game_party.members.size == 0          # If number of party members is 0

      @command_window.draw_item(1, false)     # Disable item

      @command_window.draw_item(3, false)     # Disable skill

      @command_window.draw_item(2, false)     # Disable equipment

      @command_window.draw_item(0, false)     # Disable status

    end   

  end

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

  # * Create System Window

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

  def create_system_window

    @sys_command_window = Window_Command.new(128, @sys_commands)

    @sys_command_window.visible = false

    @sys_command_window.active = false

    @sys_command_window.x = 100

    @sys_command_window.y = 120

    @sys_command_window.z = 0

    check_save_available

    check_load_available

  end

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

  def check_save_available

    if $game_system.save_disabled             # If save is forbidden

      @sys_command_window.draw_item(1, false)     # Disable save

    end

  end

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

  def check_load_available

    #Check if saved file exists

    @load_enabled = (Dir.glob('Save*.rvdata').size > 0)

    if !@load_enabled

      #Put your @command_window.draw_item(index, false) to disable load

      @sys_command_window.draw_item(2, false)

    end

  end

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

  # * Create Equip Window

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

  def create_equip_window

    @equip_command_window = Window_Command.new(128, @equip_commands)

    @equip_command_window.visible = false

    @equip_command_window.active = false

    @equip_command_window.x = 100

    @equip_command_window.y = 48

    @equip_command_window.z = 0

  end

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

  # * Create Skill Window

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

  def create_skill_window

    @skill_command_window = Window_Command.new(128, @skill_commands)

    @skill_command_window.visible = false

    @skill_command_window.active = false

    @skill_command_window.x = 100

    @skill_command_window.y = 72

    @skill_command_window.z = 0

  end

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

  # * Update Command Selection

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

  def update_command_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      $scene = Scene_Map.new

    elsif Input.trigger?(Input::C)

      # Return if Disabled Command

      if disabled_main_command?

        # Play buzzer SE

        Sound.play_buzzer

        return

      end

      main_command_input

    end

  end

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

  # * Update Sys Command Selection

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

  def update_sys_command_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      @command_window.active = true

      @sys_command_window.active = false

      @sys_command_window.visible = false

      @sys_command_window.index = 0

      @sys_command_window.z = -500

      return

    elsif Input.trigger?(Input::C)

      # Return if Disabled Command

      if disabled_main_command?

        # Play buzzer SE

        Sound.play_buzzer

        return 

      end

      sys_command_input

    end

  end

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

  # * Update Equip Command Selection

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

  def update_equip_command_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      @command_window.active = true

      @equip_command_window.active = false

      @equip_command_window.visible = false

      @equip_command_window.index = 0

      @equip_command_window.z = -500

      return

    elsif Input.trigger?(Input::C)

      # Return if Disabled Command

#      if disabled_main_command?

        # Play buzzer SE

#        Sound.play_buzzer

#        return 

#      end

      equip_command_input

    end

  end

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

  # * Update Skill Command Selection

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

  def update_skill_command_selection

    if Input.trigger?(Input::B)

      Sound.play_cancel

      @command_window.active = true

      @skill_command_window.active = false

      @skill_command_window.visible = false

      @skill_command_window.index = 0

      @skill_command_window.z = -500

      return

    elsif Input.trigger?(Input::C)

      # Return if Disabled Command

      if disabled_main_command?

        # Play buzzer SE

        Sound.play_buzzer

        return 

      end

      skill_command_input

    end

  end

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

  # * Disabled Main Command? Test

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

  def disabled_main_command?

    # Gets Current Command

    command = @commands[@command_window.index]

    sys_command = @sys_commands[@sys_command_window.index]

    # Gets Menu Commands

    c = MenuCommand

    # If 0 Party Size

    if $game_party.members.size == 0

      # If Item, Skill, Equip or Status Selected

      if [c::Item, c::Skill, c::Equip, c::Status].include?(command)

        return true

      end

    elsif $game_party.members.size <= 1

      # If the command is changing member order

      if [c::Order].include?(command)

        return true

      end

    end

    # If Save Disabled && Command is Save

    return true if $game_system.save_disabled and sys_command == c::Save

    # If Load Disabled && Command is Load

    return true if !@load_enabled && sys_command == c::Load

    return false

  end

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

  # * Update Command Check

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

  def main_command_input

    # Loads Current Command

    command = @commands[@command_window.index]

    # Play decision SE

    Sound.play_decision

    # Checks Commands

    case command

    when MenuCommand::Item  #item

      command_item

    when MenuCommand::Skill #skill

      @skill_command_window.active = true

      @skill_command_window.visible = true

      @command_window.active = false     

    when MenuCommand::Equip #equip

      @equip_command_window.active = true

      @equip_command_window.visible = true

      @command_window.active = false     

    when MenuCommand::Status #status

      start_actor_selection   

    when MenuCommand::Order #order

      command_order

    when MenuCommand::Beastiary #order

      command_beastiary

    when MenuCommand::System  #call system submenu

      @sys_command_window.active = true

      @sys_command_window.visible = true

      @command_window.active = false     

    end

  end

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

  # * Update System Command Check

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

  def sys_command_input

    # Loads Current Command

    sys_command = @sys_commands[@sys_command_window.index]

    # Play decision SE

    Sound.play_decision

    # Checks Commands

    case sys_command

    when MenuCommand::Option  #option

      command_option

    when MenuCommand::Sound  #sound

      command_sound

    when MenuCommand::Save  #save

      command_save

    when MenuCommand::Load  #load

      command_load

    when MenuCommand::End_Game  #exit

      command_endgame

    end

  end

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

  # * Update Equip Command Check

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

  def equip_command_input

    # Loads Current Command

    equip_command = @equip_commands[@equip_command_window.index]

    # Play decision SE

    Sound.play_decision

    # Checks Commands

    case equip_command

    when MenuCommand::Check  #option

      start_actor_selection

    when MenuCommand::Upgrade  #sound

      command_upgrade_equip

    when MenuCommand::Enhance  #save

      command_enhance_equip

    end

  end

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

  # * Update Skill Command Check

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

  def skill_command_input

    # Loads Current Command

    skill_command = @skill_commands[@skill_command_window.index]

    # Play decision SE

    Sound.play_decision

    # Checks Commands

    case skill_command

    when MenuCommand::Check  #option

      start_actor_selection

    when MenuCommand::Upgrade  #sound

      command_upgrade_skills

    when MenuCommand::Mix  #save

      command_mix_skills

    end

  end

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

  # * Start Actor Selection

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

  def start_actor_selection

    @command_window.active = false

    @equip_command_window.active = false

    @equip_command_window.visible = false      

    @skill_command_window.active = false

    @skill_command_window.visible = false      

    @status_window.active = true

    if $game_party.last_actor_index < @status_window.item_max

      @status_window.index = $game_party.last_actor_index

    else

      @status_window.index = 0

    end

  end

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

  # * End Actor Selection

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

  def end_actor_selection

    @command_window.active = true

    @status_window.active = false

    @status_window.index = -1

  end

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

  # * Update Actor Selection

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

  def update_actor_selection

    # Loads Current Command

    command = @commands[@command_window.index]

    if Input.trigger?(Input::B)

      Sound.play_cancel

      end_actor_selection

    elsif Input.trigger?(Input::C)

      $game_party.last_actor_index = @status_window.index

      Sound.play_decision

      case command

      when MenuCommand::Skill  # skill

        command_skill

      when MenuCommand::Equip  # equipment

        command_equip

      when MenuCommand::Status  # status

        command_status

      end

    end

  end

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

  # * Command Item

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

  def command_item

    # Switch to item screen

    $scene = Scene_Item.new

  end

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

  # * Command Skill

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

  def command_skill

    # Switch to skill screen

    $scene = Scene_Skill.new(@status_window.index)

  end

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

  # * Command Equip

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

  def command_equip

    # Switch to equipment screen

    $scene = Scene_Equip.new(@status_window.index)

  end

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

  # * Command Status

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

  def command_status

    # Switch to status screen

    $scene = Scene_Status.new(@status_window.index)

  end

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

  # * Command Order

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

  def command_order

    # If Main Command Active

    if @command_window.active

      # Activate Status Window

      start_actor_selection

      @checker = 0

      return

    end

    #Change Party Order by Yargovish

    if @checker == 0

      @changer = $game_party.members[@status_window.index]

      @where = @status_window.index

      @checker = 1

    else

      $game_party.members[@where] = $game_party.members[@status_window.index]

      $game_party.members[@status_window.index] = @changer

      @checker = 0

      @status_window.refresh

      $game_player.refresh #

    end     

  end

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

  # * Command Party

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

  def command_party

    # Switch to party change screen

    #Put your Party Change Scene here

  end

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

  # * Command Option

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

  def command_option

    # Switch to option screen

    #Put your Option Scene here

  end

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

  # * Command Quest

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

  def command_quest

    # Switch to quest screen

    #Put your Quest Scene here

  end

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

  # * Command Save

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

  def command_save

    # Switch to save screen

    $scene = Scene_File.new(true, false, false)

  end

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

  # * Command Load

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

  def command_load

    # Switch to load screen

    $scene = Scene_File.new(false, false, false)

  end

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

  # * Command End Game

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

  def command_endgame

    # Switch to end game screen

    $scene = Scene_End.new

  end

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

  # * Command Upgrade Equip

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

  def command_upgrade_equip

    # Switch to upgrade screen

    # $scene = Scene_Upgrade_Equip.new

  end

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

  # * Command Enhance Equip

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

  def command_enhance_equip

    # Switch to enhance screen

  end

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

  # * Command Upgrade Skills

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

  def command_upgrade_skills

    # Switch to upgrade screen

  end

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

  # * Command Mix Skills

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

  def command_mix_skills

    # Switch to mix screen

  end

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

  # * Command Beastiary

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

  def command_beastiary

    # Switch to beastiary screen

  end

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

  # * Command Sound

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

  def command_sound

    # Switch to sound screen

  end

end

 

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

# ** Scene_File

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

#  This class performs the save and load screen processing.

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

 

class Scene_File

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

  # * Return to Original Screen

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

  def return_scene

    if @from_title

      $scene = Scene_Title.new

    elsif @from_event

      $scene = Scene_Map.new

    else

      $scene = Scene_Menu.new(5)

    end

  end

end

 

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

# ** Scene_Status

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

#  This class performs the status screen processing.

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

 

class Scene_Status

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

  # * Return to Original Screen

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

  def return_scene

    $scene = Scene_Menu.new(0)

  end

end

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

# ** Scene_Item

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

#  This class performs the item screen processing.

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

 

class Scene_Item < Scene_Base

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

  # * Return to Original Screen

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

  def return_scene

    $scene = Scene_Menu.new(1)

  end

end

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

# ** Scene_Skill

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

#  This class performs the skill screen processing.

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

 

class Scene_Skill < Scene_Base

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

  # * Return to Original Screen

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

  def return_scene

    $scene = Scene_Menu.new(3)

  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