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.

Expanding Upon CMS To Add Area Name

Hi, I'm using this CMS I don't remember which one it is but I found it on the board. On the menu it displays the map name. I want it to not only display the map name, but the area name as well. Now, I'm not a very good scripter but I've pretty much narrowed down the scripting to assume that the map name thing is located somewhere in here:

Code:
#------------------------------------------------------------------------------
#  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, "You Are Here")
   self.contents.font.color = normal_color
   self.contents.draw_text(4, WLH, 120, 32, $game_map.name.to_s, 2)
 end
end

I hope someone can help...... thanks for looking^^;
 
Code:
#===============================================================================
# ** Game_Map
#-------------------------------------------------------------------------------
#
#===============================================================================
class Game_Map
  #-----------------------------------------------------------------------------
  attr_accessor :map_id
  attr_accessor :map_name
  #-----------------------------------------------------------------------------
  # * Define Map Name
  #-----------------------------------------------------------------------------
  def map_name
    @map_name = load_data("Data/MapInfos.rxdata") 
    return @map_name[@map_id].name
  end
  #-----------------------------------------------------------------------------
  # * Disable Dash?
  #-----------------------------------------------------------------------------
  def disable_dash?
    return Run::DisableMaps.include?(@map_id) ? true : false
  end
end

You can use that little scriptlet from my Player/Map Scripts.

draw_text(x, y, w, h, $game_map.map_name.to_s)
 

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