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.

Basic Choice List Menu

Hi hi~

I'm looking for a basic choice list.

One menu in the center of the screen (approx 400 px high and 320 px wide) that can be called with Script Call when in-game on a map. The map needs to still be visible in the background, but with a semi-transparent picture above it.

The menu itself is a long vertically scrollable list of options. The options can only be chosen if the respective game_switch is on. If  the game_switch is not on, the choice/option is either completely missing or changed into '???' and grayed out (whatever you prefer).

if the option/choice is selected, then it sets a variable to a certain value (the value that belongs to that choice/option) and returns to the map.



I'd use this for a teleport system, but for more things too as it's so useful.


Thank you so much in advance. ^_^ <3
 
Now this is Done, I don't put the Image because I don't understand what do you need, please explain better that.

But the basis system is Fully load, so here you go:

Code:
#==============================================================================
# ** Window_Travel_Command
#------------------------------------------------------------------------------
#  This window deals with the travel command choices.
#==============================================================================

class Window_Travel_Command < Window_Command
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    if $game_switches[index+1] == false && Travel::Kind == 1
      self.contents.draw_text(rect, Travel::No_Name)
    else
      self.contents.draw_text(rect, @commands[index])
    end
  end
  #--------------------------------------------------------------------------
  # * Command Count : Retrives the number of commands.
  #--------------------------------------------------------------------------
  def command_count
    return @commands.size
  end
end

#==============================================================================
# ** Module Travel                                            By MephistoX
#------------------------------------------------------------------------------
#  This module keep several methods and constants for teh Travel Menu
#==============================================================================

module Travel
  #--------------------------------------------------------------------------
  # * Travel Destiny : Keep the choices for travel(Use hashes or arrays)
  #--------------------------------------------------------------------------
  Travel_Destiny = {0 => 'Forest', 1 => 'Beach', 2 => "Your Sister's House",
                    3 => 'Desert', 4 => "Meph's Lair", 5 => "Twin Matrix's House",
                    6 => 'Space',  7 => 'Abyss', 8 => 'Streets of Simcity',
                    9 => 'Neverland', 10 => "Seph's House", 11 => 'Detroit',
                    12 => 'Spain', 13 => 'Rmxp.org', 14 => 'E-Bay'}
  #--------------------------------------------------------------------------
  # * Destiny Icons : Icons for each destiny
  #--------------------------------------------------------------------------
  Destiny_Icons = {}
  Destiny_Icons.default = '001-Weapon01'
  No_Icon = ''
  #--------------------------------------------------------------------------
  # * Show Icons?
  #--------------------------------------------------------------------------
  Show_Icons = true
  #--------------------------------------------------------------------------
  # * Index Variable : Keep the variable where menu Index value is stored.
  #--------------------------------------------------------------------------
  Index_Variable = 1
  #--------------------------------------------------------------------------
  # * No Name : When the Switch is off, show this name.
  #--------------------------------------------------------------------------
  No_Name = '?????'
  #--------------------------------------------------------------------------
  # * No Name Kind : 0 = Show disable name - 1 = Show No_Name
  #--------------------------------------------------------------------------
  Kind = 1
  #--------------------------------------------------------------------------
  # * Command Opacity : Back opacity for command
  #--------------------------------------------------------------------------
  Command_Opacity = 160
end


#==============================================================================
# ** Scene_Travel(Basis from Menu's Index and Variables)          By MephistoX
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Travel
  #--------------------------------------------------------------------------
  # * Main Processing : Main Command Window
  #--------------------------------------------------------------------------
  def main_command_window
    @command_window = Window_Travel_Command.new(320, Travel::Travel_Destiny)
    @command_window.height = 400
    @command_window.x, @command_window.y = 160 ,45
    @command_window.back_opacity = Travel::Command_Opacity
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @spriteset = Spriteset_Map.new
    # Make command window
    main_command_window
    # Check for the switches
    for i in 0...@command_window.command_count
      if $game_switches[i+1] == false
        @command_window.disable_item(i)
      end
    end
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If B button was pressed
    if Input.trigger?(Input::C)
      # Check if Switch that belongs to the Index is false
      if $game_switches[@command_window.index+1] == false
      # Play Buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      else
        # If switch is on, play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change Variable to Index
        $game_variables[Travel::Index_Variable] = @command_window.index
        # Return to the Map
        $scene = Scene_Map.new
      end
      return
    end
  end
end

I was thinking about add Icons for each command, but I'm lazy, so if you need anything more, only request. I'll try my best :).

Enjoy and good luck!
 

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