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.

Location Selection

Zero

Member

I got bored so I made this request. Sorry Da2DBM if you were still working on it. Just put this in a new script above main:
Code:
#==============================================================================
# ** Scene Selection Script
#------------------------------------------------------------------------------
# Raziel
# 2006-09-19
# Version 1.0
#==============================================================================
#==============================================================================
# ** Scene_Selection
#------------------------------------------------------------------------------
#  This class performs a selection processing.
#==============================================================================
class Scene_Selection
  
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    #map = [map_id, map_x, map_y, direction, fade]
    #direction: 1 = same direction as before ; 2 = down ; 4 = left ; 6 = right ; 8 = up
    @map1 = [1, 0, 0, 1, true] #upper lefr selection
    @map2 = [1, 0, 0, 1, true] #upper right selection
    @map3 = [1, 0, 0, 1, true] #lower left selection
    @map4 = [1, 0, 0, 1, true] #lower right selection
    #picture = [upper_left_image, upper_rigt_image, lower_left_image, lower_right_image]
    @picture = ["1","2","3","4"]
    # no edits needed anymore
    @selection = 0
    @sprite = Sprite.new
    # Transition run
    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 sprite
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @sprite.bitmap = RPG::Cache.picture(@picture[@selection])
    case @selection
      when 0
      if Input.trigger?(Input::RIGHT)
        $game_system.se_play($data_system.cursor_se)
        @selection = 1
      elsif Input.trigger?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        @selection = 2
      end
      when 1
      if Input.trigger?(Input::LEFT)
        $game_system.se_play($data_system.cursor_se)
        @selection = 0
      elsif Input.trigger?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        @selection = 3
      end
      when 2
      if Input.trigger?(Input::RIGHT)
        $game_system.se_play($data_system.cursor_se)
        @selection = 3
      elsif Input.trigger?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        @selection = 0
      end
      when 3
      if Input.trigger?(Input::LEFT)
        $game_system.se_play($data_system.cursor_se)
        @selection = 2
      elsif Input.trigger?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        @selection = 1
      end
    end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @selection
        when 0
        $game_temp.player_new_map_id = @map1[0]
        $game_temp.player_new_x = @map1[1]
        $game_temp.player_new_y = @map1[2]
        $game_temp.player_new_direction = @map1[3]
        $game_temp.player_transferring = true
        if @map1[4] == true
          # only include this if you want the screen to fade
          Graphics.freeze
          $game_temp.transition_processing = true
          $game_temp.transition_name = ""
        end
        when 1
        $game_temp.player_new_map_id = @map2[0]
        $game_temp.player_new_x = @map2[1]
        $game_temp.player_new_y = @map2[2]
        $game_temp.player_new_direction = @map2[3]
        $game_temp.player_transferring = true
        if @map2[4] == true
          # only include this if you want the screen to fade
          Graphics.freeze
          $game_temp.transition_processing = true
          $game_temp.transition_name = ""
        end
        when 2
        $game_temp.player_new_map_id = @map3[0]
        $game_temp.player_new_x = @map3[1]
        $game_temp.player_new_y = @map3[2]
        $game_temp.player_new_direction = @map3[3]
        $game_temp.player_transferring = true
        if @map3[4] == true
          # only include this if you want the screen to fade
          Graphics.freeze
          $game_temp.transition_processing = true
          $game_temp.transition_name = ""
        end
        when 3
        $game_temp.player_new_map_id = @map4[0]
        $game_temp.player_new_x = @map4[1]
        $game_temp.player_new_y = @map4[2]
        $game_temp.player_new_direction = @map4[3]
        $game_temp.player_transferring = true
        if @map4[4] == true
          # only include this if you want the screen to fade
          Graphics.freeze
          $game_temp.transition_processing = true
          $game_temp.transition_name = ""
        end
      end
      $scene = Scene_Map.new
    end
  end
  
end

The 1 - 4 in @picture = ["1","2","3","4"] are the pictures names. Replace them wiith the names you want to use, just make sure the keep the order of the images as they are commented within the script. To the maps, just change the map id, x and y positions in the script.
 

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