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 Names

Hi all,

I am just asking for a script to make the map's name appear at the left bottom of the map,Can someone pretty please make me a one? And of course I will credit him/her.;)
 
Oh hi,I took a look at this topic but that's not really what I want,I wanted the map name to stay available at the bottom left of the game like Aveyond,thanks for helping anyway.:)
 
Try this edit of Yeyinde's script:
Code:
#============================================================================
# ** Location Display
#----------------------------------------------------------------------------
# Nitt
# Based on the Map Location Popup script by Yeyinde
# 1.0.0
# 10:th of January 2008
# SDK Version : (2.2) - Parts: I, III
#============================================================================

#-----------------------------------------------------------------------------
# SDK Auto-installer
#-----------------------------------------------------------------------------
unless Object.const_defined?(:SDK)
  begin
    require 'SDK'
  rescue LoadError
    print 'This script (Location Display) requires the SDK to run.'
    exit 1
  end
end

#-----------------------------------------------------------------------------
# SDK Log
#-----------------------------------------------------------------------------
SDK.log('Location Display', 'Nitt', '1.00', '01/10/08')

#-----------------------------------------------------------------------------
# SDK Check Requirements
#-----------------------------------------------------------------------------
SDK.check_requirements(2.2, [1, 3])

#-----------------------------------------------------------------------------
# SDK Enabled Check
#-----------------------------------------------------------------------------
if SDK.enabled?('Location Display')

#==============================================================================
# ** Location_Text
#------------------------------------------------------------------------------
#  Customization module
#==============================================================================

module Location_Popup
  # Transition Duration (Fade-in time in frames)
  TRANSITION_TIME = 10
  # Don't show for (Syntax: [map_id1, mapid2, etc.] EX. [1, 5, 6])
  NO_POPUP_MAPS = []
end

#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
#  Refer to "$game_temp" for the instance of this class.
#==============================================================================

class Game_Temp
  #---------------------------------------------------------------------------
  # * Aliasing
  #---------------------------------------------------------------------------
  alias_method :map_name_popup_int, :initialize
  #---------------------------------------------------------------------------
  # * Public Instance Variables
  #---------------------------------------------------------------------------
  attr_accessor :new_location_name
  attr_accessor :location_popup_show
  #---------------------------------------------------------------------------
  # * Object Initialization
  #---------------------------------------------------------------------------
  def initialize
    # Call aliased method
    map_name_popup_int
    # Crate new variables
    @new_location_name = ''
    @location_popup_show = false
  end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles the map. It includes scrolling and passable determining
#  functions. Refer to "$game_map" for the instance of this class.
#==============================================================================

class Game_Map
  #---------------------------------------------------------------------------
  # * Aliasing
  #---------------------------------------------------------------------------
  alias_method :map_name_popup_setup, :setup
  #--------------------------------------------------------------------------
  # * Setup
  #     map_id : map ID
  #--------------------------------------------------------------------------
  def setup(map_id)
    # Call aliased method
    map_name_popup_setup(map_id)
    # Set temporary variable
    location_text = $data_mapinfos[@map_id].name
    $game_temp.new_location_name = location_text
    $game_temp.location_popup_show = true
  end
end

#==============================================================================
# ** Sprite_LocationPopup
#------------------------------------------------------------------------------
#  This sprite is used to display the current location when it is entered.  It
#  observes $game_temp.new_location_name to know when to refresh
#==============================================================================

class Sprite_LocationPopup < Sprite
  #---------------------------------------------------------------------------
  # * Object Initialization
  #---------------------------------------------------------------------------
  def initialize
    # Call superclass method
    super()
    # Set co-ordinates
    self.x = 16
    self.y = 432
    self.z = 999999
    # Set some variables to save space
    @transition_time = [Location_Popup::TRANSITION_TIME, 1].max
    # Refresh
    refresh
  end
  #---------------------------------------------------------------------------
  # * Reset Variables
  #---------------------------------------------------------------------------
  def reset_variables
    @current_location = $game_temp.new_location_name
    @frames_remaining = @transition_time
  end
  #---------------------------------------------------------------------------
  # * Refresh
  #---------------------------------------------------------------------------
  def refresh
    # Clear existing bitmap
    if self.bitmap != nil
      self.bitmap.dispose
      self.bitmap = nil
    end
    # Reset variables
    reset_variables
    # Stop if the location is not to be displayed on this map
    if Location_Popup::NO_POPUP_MAPS.include?($game_map.map_id) ||
        !$game_temp.location_popup_show
      @frames_remaining = 0
      return 
    end
    $game_temp.location_popup_show = false
    # Draw the text
    text = @current_location
    bitmap = Bitmap.new(1, 1)
    width = bitmap.text_size(text).width + 8
    bitmap.dispose
    self.bitmap = Bitmap.new(width, 32)
    self.bitmap.font.color = Color.new(0, 0, 0)
    self.bitmap.draw_text(6, 1, width, 30, text)
    self.bitmap.draw_text(8, 1, width, 30, text)
    self.bitmap.draw_text(7, 0, width, 30, text)
    self.bitmap.draw_text(7, 2, width, 30, text)
    self.bitmap.font.color = Color.new(255, 255, 255)
    self.bitmap.draw_text(7, 1, width, 30, text)
    # Reset opacity
    self.opacity = 0
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Call superclass method
    super
    # Refresh if location was changed
    refresh if @current_location != $game_temp.new_location_name
    # If there is still a frame remaining
    if @frames_remaining > 1
      self.opacity += 256 / @transition_time
      # Remove one frame
      @frames_remaining -= 1
    end
  end
end

#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #---------------------------------------------------------------------------
  # * Aliasing
  #---------------------------------------------------------------------------
  alias_method :map_name_popup_database, :main_database
  #--------------------------------------------------------------------------
  # * Main Processing : Database Initialization
  #--------------------------------------------------------------------------
  def main_database
    # Call aliased method
    map_name_popup_database
    if $data_mapinfos.nil?
      $data_mapinfos = load_data('Data/MapInfos.rxdata')
    end
  end
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #---------------------------------------------------------------------------
  # * Aliasing
  #---------------------------------------------------------------------------
  alias_method :map_name_popup_sprite, :main_sprite
  #--------------------------------------------------------------------------
  # * Main Processing : Sprite Initialization
  #--------------------------------------------------------------------------
  def main_sprite
    map_name_popup_sprite
    @location_popup_sprite = Sprite_LocationPopup.new
  end
end

end
#-----------------------------------------------------------------------------
# End SDK Enabled Check
#-----------------------------------------------------------------------------

(Note that I removed the image functionality)
 

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