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.

Scrolling/Miniaturized Map Display

I'm looking for a script that can either add a 'Map' option to the menu and go to a complete map screen, (maybe with a customizable panel on the side, similar to those found in Ocarina of Time - examples shown below)

http://www.siliconera.com/news/0612/zeldaot2d.jpg[/img]
(Bottom-left and Bottom-center pics)

...or something to display the map [faded] behind the main menu... I'd personally prefer the first.

Either a global map (see bottom-left image) or a customizable map (see bottom-center image) will probably work... but due to the vastness of my game area, I think it would be easier to have a map of each individual area; so a script than could fetch pictures, fade them, put them into an attractive menu screen addition, whatever works... I've searched 3 times and surprisingly haven't found any other requests for this sort of thing. ;/





If nothing else, maps could be displayed through a common event integrated as a menu selection - see this request: http://www.rmxp.org/forums/showthread.php?t=21983

Anyone who helps with either request will recieve full credit. Thanks again!
 
Well, I do have a special map where it's an image that you use for the map then you've got the mouse and when you put it over a certain area it'll display a little window at the top right saying what the place is, but it takes a while to set it up and also it uses the mouse instead of the arrow keys and also stays on one focused area, but I guess I could make it so an even larger picture could be displayed and will scroll it in any direction. I'll post it here later tonight after I get off work, and I work in like 15 minutes and I don't have time to get it all ready and help you out with it right now.
 
It sounds perfect, thanks a ton.

Is this a different scrollable picture for varying areas, or does it have to be just one? The game I'm making has maybe 10 different *major* areas that can be mapped, but since they're all around the globe, it would be somewhat difficult to get them all on one map... albeit possible.
 
Actually, I found an old script by SephirothSpawn that does exactly what you want only thing is, it takes a little bit of time setting things up because you do have to set all the coordinates and things like that. Here's the script, give credits to Seph not me. Oh also this does teleport to that place that you choose, but can be fixed if necessary.
Code:
#================================
#Class Game_Globe
#Written by SephirothSpawn
#Defines your Worlds (@worlds)
#And Your Locations (@locatoins)
#================================
class Game_Globe
  attr_accessor :worlds, :locations
  def initialize
    @worlds = [] ;@locations = []
  end
  #---------------------------------------------------------------
  #Def Add_World (Adds World to your worlds list)
  #---------------------------------------------------------------
  def add_world(name)
    @worlds.push(name) ;@locations.push( [] )
  end
  #---------------------------------------------------------------
  #Def Remove_World (Removes a World)
  #---------------------------------------------------------------
  def remove_world(id)
    @worlds.delete_at(id) ;@locations.delete_at(id)
  end
  #---------------------------------------------------------------
  #Def Add_Location (Adds a locaction to a world)
  #Setup: (map, info)
  #Map = the id in your arrays  Example: @worlds = ["Spira", "Zanarkand"]
  #                                       To add "Besaid" to Spira, map would equal 0
  #Info = information of the Location
  #Info = ["Name of location", x, y, map_id, x2, y2]
  #"Name of Location = the Name of your location that will appear in the scene
  #x and y are the locations relative to the Top-Left corner of your screen
  #  To get x and y, Open Paint and your map. Move the cursor of the area
  #     on the map where your location will appear.
  #  The x & y coordinates will appear on the Bottom-Right Corner
  #map_id is the map id of the map to teleport to
  #x2 & y2 are the locations on the map where you will be teleported to
  #   If you dont want to make a location Teleportable, leave map_id, x2 & y2 = to nil (["Name", x, y])
  #---------------------------------------------------------------
  def add_location(map, info)
    @locations[map].push(info)
  end
  #---------------------------------------------------------------
  #Def Remove_Location (Removes a location from you loactions list)
  #map = World, Id is the location to delete  
  #     Example: @locations = [ [ ["Besaid", 5, 5, 0, 3, 10], ["Luca", 25, 30, 1, 10, 3] ], [World 2 Bios] ]
  #     Say Luca is destroyed by Sin. To remove, use (0, 1); 0 being your first world, 1 being your second location
  #---------------------------------------------------------------
  def remove_location(map, id)
    @locations[map].delete_at(id)
  end
end
#================================
#End of Game_Globe
#Start Scene_Globe
#================================
class Scene_Globe
  #------Sets Up Instance Varaibles------
  def initialize(world_id = 0)
    @world_id = world_id
    @locations = $Game_Globe.locations[world_id]
  end
  #------Sets Up Scene------
  def main
    #------Variable Setup------
    @x =320
    @y = 240
    @anim_curs = 0
    @dir = 1
    @phase = 0
    @temp_phase = 0
    @loc = 0
    @toggle = true
    commands = []
    for i in 0...@locations.size
      commands.push(@locations[i][0])
    end
    if commands.size >= 14
      height = 416
    else
      height = commands.size*32+32
    end
    #------Sprite Setup------
    bitmap = RPG::Cache.picture("Maps/"+$Game_Globe.worlds[@world_id])
    @map1 = Sprite.new
      @map1.bitmap = bitmap 
    @map2 = Sprite.new
      @map2.bitmap = bitmap
    @globe = Sprite.new
      @globe.bitmap =  RPG::Cache.picture("Maps/Globe")
      @globe.z =  10
    @border = Window_Base.new(8, 232, 320, 240)
      @border.z = 16
      @border.back_opacity = 0
      @border.visible = false
    @tele_map = Sprite.new
      @tele_map.x = 8
      @tele_map.y = 232
      @tele_map.z = 15
    @cursor = Sprite.new
      @cursor.bitmap = RPG::Cache.picture("Maps/Cursor0")
      @cursor.x = @x - 16
      @cursor.y = @y - 16
      @cursor.z = 5
    #------Window Setup------
    @tele_cmd = Window_Command.new(160, ["Teleport", "Cancel"])
      @tele_cmd.x = 472
      @tele_cmd.y = 376
      @tele_cmd.z = 15
      @tele_cmd.opacity = 150
      @tele_cmd.active = @tele_cmd.visible = false
    @exit_cmd = Window_Command.new(200, ["Return to Menu", "Return to Map", "Cancel"])
      @exit_cmd.x = 432
      @exit_cmd.y = 344
      @exit_cmd.z = 15
      @exit_cmd.opacity = 150
      @exit_cmd.active = @exit_cmd.visible = false
    @list_cmd = Window_Command.new(196, commands)
      @list_cmd.height = height
      @list_cmd.x = 8
      @list_cmd.y = 240 - (height/2)
      @list_cmd.z = 15
      @list_cmd.opacity = 150
      @list_cmd.visible = @list_cmd.active = false
    @title = Window_Help.new
      @title.opacity, = 0 
      @title.set_text($Game_Globe.worlds[@world_id], 1)
    @location = Window_Help.new
      @location.y = 416
      @location.opacity = 0
      @location.visible = false
    @controls = Window_Controls.new
      @controls.opacity = 150
      controls = ["Y -> Auto Mode", "Z -> List Mode", "A ->Toggle Control Window", "B -> Exit",
                       "C -> View Location (When Red)", "L & R -> Rotate Globe", "Arrows -> Move Cursor",
                       "Normal Mode"]
      @controls.refresh(controls)
    #------Quick Arrays Setup------
    @dispose = [@map1, @map2, @globe, @border, @tele_map, @cursor, @tele_cmd, @exit_cmd, @list_cmd, @title, @location, @controls]
    @visible_change = [@border, @tele_map, @cursor, @tele_cmd, @exit_cmd, @list_cmd, @location]
    @active_change = [@tele_cmd, @exit_cmd, @list_cmd]
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @dispose.each {|x| x.dispose if !x.disposed?}
  end
  #------Updates Scene------
  def update
    @dispose.each {|x| x.update}
    @cursor.x =@x-16 ;@cursor.y = @y-16
    @anim_curs += @dir ;@dir *= -1  if @anim_curs == 25 or @anim_curs == 0
    @cursor.bitmap = RPG::Cache.picture("Maps/Cursor0")  if @anim_curs ==0
    @cursor.bitmap = RPG::Cache.picture("Maps/Cursor3")  if @anim_curs == 5
    @cursor.bitmap = RPG::Cache.picture("Maps/Cursor1")  if @anim_curs == 10
    @cursor.bitmap = RPG::Cache.picture("Maps/Cursor4")  if @anim_curs == 15
    @cursor.bitmap = RPG::Cache.picture("Maps/Cursor2")  if @anim_curs == 20
    @cursor.bitmap = RPG::Cache.picture("Maps/Cursor5")  if @anim_curs == 25
    @map2.x = (@map1.x - 640) if @map1.x >= 0
    @map2.x = (@map1.x + 640) if @map1.x > 0
    @map1.x=0 if @map1.x==-640 or @map1.x==640
    @visible_change.each {|x| x.visible = false}
    @active_change.each {|x| x.active = false}
    @cursor.visible = true if @phase < 4
    @location.visible = true if @phase < 4
    @controls.visible = false if @phase > 2
    case @phase
     when 0
       normal_mode
     when 1
       midge_mode
     when 2
       @list_cmd.visible = @list_cmd.active = true
       list_mode
     when 3
       @border.visible = @tele_map.visible = true
       @tele_cmd.visible = @tele_cmd.active = true
       tele_mode
     when 4
       @exit_cmd.visible = @exit_cmd.active = true
       exit_mode
    end
  end
  #------Move Cursors over Location------
  def normal_mode
    controls = ["Y -> Auto Mode", "Z -> List Mode", "A ->Toggle Control Window", "B -> Exit",
                     "C -> View Location (When Red)", "L & R -> Rotate Globe", "Arrows -> Move Cursor",
                     "Normal Mode"]
    @controls.refresh(controls)
    @controls.visible = true if @toggle
    @controls.visible = false if !@toggle
    if Input.trigger?(Input::A)
      if @toggle then @toggle = false else @toggle = true end
    end
    if Input.trigger?(Input::B)
      @temp_phase = 0 ;@phase = 4
    end
    if Input.press?(Input::L)
      @map1.x -= 4 ;@map2.x -=4
    end
    if Input.press?(Input::R)
      @map1.x += 4 ;@map2.x +=4
    end
    @x +=2 if Input.press?(Input::RIGHT) and @x < 560
    @x -=2 if Input.press?(Input::LEFT) and @x > 80
    @y +=2 if Input.press?(Input::DOWN) and @y < 480
    @y -=2 if Input.press?(Input::UP) and @y > 0
    @phase = 1  if Input.trigger?(Input::Y)
    @phase = 2  if Input.trigger?(Input::Z)
    x1 = @x - @map1.x
    x2 = @x - @map2.x
    y1 = @y
    for i in 0...@locations.size
      x = @locations[i][1]
      y = @locations[i][2]
      if (x1<=x+16 and x1>=x-16 and y1<=y+16 and y1>=y-16)  or  (x2<=x+16 and x2>=x-16 and y1<=y+16 and y1>=y-16)
        @cursor.tone = Tone.new(255, 0, 0, 255) ;@location.visible = true
        @location.set_text(@locations[i][0], 1)
        if Input.trigger?(Input::C)
          @temp_loc = @locations[i]
          @tele_map.bitmap = RPG::Cache.picture("Maps/"+@locations[i][0])
          @temp_phase = 0 ;@phase = 3
        end
        return
      else
        @cursor.tone = Tone.new(0, 0, 0, 255) ;@location.visible = false
      end
    end
  end
  #------Scrolls Through Locations Automatically------
  # ------Thanks to Makeamidget for Suggestion------
  def midge_mode
    controls = ["X -> Normal Mode", "Z -> List Mode", "A ->Toggle Control Window", "B -> Exit",
                     "C -> View Location (When Red)", "Left or Right -> Next Location", "", "Auto Mode"]
    @controls.refresh(controls)
    @cursor.tone = Tone.new(255, 0, 0, 255)
    @location.set_text(@locations[@loc][0], 1)
    @controls.visible = true if @toggle
    @controls.visible = false if !@toggle
    if Input.trigger?(Input::A)
      if @toggle then @toggle = false else @toggle = true end
    end
    if Input.trigger?(Input::B)
      @temp_phase = 0 ;@phase = 4
    end
    @phase = 0  if Input.trigger?(Input::X)
    @phase = 2  if Input.trigger?(Input::Z)
    if Input.trigger?(Input::RIGHT)
      @loc += 1 if @loc <= @locations.size - 1;@loc = 0 if @loc > @locations.size - 1
    end
    if Input.trigger?(Input::LEFT)
      @loc = @locations.size - 1 if @loc == 0 ;@loc -= 1 if @loc != 0
    end
    @x = 320
    @y = @locations[@loc][2]
    @map1.x = 320 - @locations[@loc][1]
    if Input.trigger?(Input::C)
      @temp_loc = @locations[@loc]
      @tele_map.bitmap = RPG::Cache.picture("Maps/"+@locations[@loc][0])
      @temp_phase = 1 ;@phase = 3
    end
  end
  #------Show Locations in Command Window------
  #   ------Thanks to Viskar for Suggestion------
  def list_mode
    controls = ["X -> Normal Mode", "Y -> Auto Mode", "A ->Toggle Control Window", "B -> Exit",
                     "C -> View Location (When Red)", "Up or Down-> Next Location", "", "List Mode"]
    @controls.refresh(controls)
    @cursor.tone = Tone.new(255, 0, 0, 255)
    @controls.visible = true if @toggle
    @controls.visible = false if !@toggle
    if Input.trigger?(Input::A)
      if @toggle then @toggle = false else @toggle = true end
    end
    if Input.trigger?(Input::B)
      @temp_phase = 0 ;@phase = 4
    end
    @phase = 0  if Input.trigger?(Input::X)
    @phase = 1  if Input.trigger?(Input::Y)
    loc = @list_cmd.index
    @location.set_text(@locations[loc][0], 1)
    @x =320
    @y = @locations[loc][2]
    @map1.x = 320 - @locations[loc][1]
    if Input.trigger?(Input::C)
      @temp_loc = @locations[loc]
      @tele_map.bitmap = RPG::Cache.picture("Maps/"+@locations[loc][0])
      @temp_phase = 1 ;@phase = 3
    end
  end
  #------Teleport to Location------
  def tele_mode
    @phase = @temp_phase  if Input.trigger?(Input::B)
    teleport = true
    if @temp_loc[3] == nil
      teleport = false ;@tele_cmd.disable_item(0)
    end
    if Input.trigger?(Input::C)
      case @tele_cmd.index
        when 0
          if teleport
            $game_map.setup(@temp_loc[3]) ;$game_player.moveto(@temp_loc[4], @temp_loc[5])
            $scene=Scene_Map.new ;$game_map.refresh
          else
            $game_system.se_play($data_system.buzzer_se)
          end
        when 1
          @phase = @temp_phase
      end
    end
  end
  #------Returns to Game------
  def exit_mode
    @phase = @temp_phase  if Input.trigger?(Input::B)
    if Input.trigger?(Input::C)
      case @exit_cmd.index
        when 0 ;$scene = Scene_Menu.new
        when 1 ;$scene = Scene_Map.new
        when 2 ;@phase = @temp_phase
      end
    end
  end
  #---------------------------------------------------------------
end
#================================
#End of Scene_Globe
#Start Of Window_Controls
#================================
class Window_Controls < Window_Base
  #------Window Parameters------
  def initialize
    super(412, 264, 220, 208)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
  end
  #------Uses text (array) to Draw Text via .refresh------
  def refresh(text)
    self.contents.clear
    self.contents.font.size = 32 ;self.contents.font.color = normal_color 
    self.contents.draw_text(0, 0, 208, 32, "Controls:")
    for i in 0...text.size
      if i < text.size - 1
        self.contents.font.color = normal_color ;x = 6 ;self.contents.font.size = y = 16
      else
        self.contents.font.color = knockout_color ;x = 0 ;self.contents.font.size = 32
      end
      cx = contents.text_size(text[i]).width ;cy = contents.text_size(text[i]).height
      self.contents.draw_text(x, y*i + 32, cx, cy, text[i])
    end
  end
end
 
Perfect. I actually planned to use that in a later game. Thanks for the search, Iced.

EDIT: Would you have a link to the original thread, or any specific instructions on using 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