RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Show Map Name (in map)

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 90
Show Map Name 1.0

Description
A simple script to show the map's name in a small window when the player enter to the map.

Screenshots
i forgot them  :whoa:

Requirements
Standard Development Kit (SDK), tested with the version 1.4.

How use?
Paste the code in a new section above Main (in the script editor).
You can change some settings in the module called "Show_Map_Name".
To show it in certain map, only add in the Call Script command (before your Teleport command) this:
Code: [Select]
$game_temp.show_mapname = true


F.A.Q.


Script
Code: [Select]
#==============================================================================
# ** Show Map Name
#------------------------------------------------------------------------------
# Slipknot
# 1.0
# 03.31.06
#==============================================================================

SDK.log('Show_Map_Name', 'Slipknot', '1.0', '03.31.06')

#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enable('Show_Map_Name')
#--------------------------------------------------------------------------

$data_mapinfos = load_data('Data/MapInfos.rxdata')

module Show_Map_Name
  #--------------------------------------------------------------------------
  Show_Frames = 30
  Back_Opacity = 160
  Y = 32
  #--------------------------------------------------------------------------
end

#------------------------------------------------------------------------------
# Begin Game_Map Edit
#------------------------------------------------------------------------------
class Game_Map
  #--------------------------------------------------------------------------
  alias slipknot_showmapname_gamemap_setupmapid setup_map_id
  alias slipknot_showmapname_gamemap_update update
  #--------------------------------------------------------------------------
  def setup_map_id(map_id)
    slipknot_showmapname_gamemap_setupmapid(map_id)
    if $game_temp.show_mapname
      @window_mapname = Window_MapName.new(map_id)
      $game_temp.show_mapname = false
    end
  end
  #--------------------------------------------------------------------------
  def dispose_window_mapname
    unless @window_mapname.nil? or @window_mapname.disposed?
      @window_mapname.dispose
    end
  end
  #--------------------------------------------------------------------------
  def update
    slipknot_showmapname_gamemap_update
    unless @window_mapname.nil? or @window_mapname.disposed?
      @window_mapname.update
    end
  end
end
#------------------------------------------------------------------------------
# End Game_Map Edit
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Begin Scene_Map Edit
#------------------------------------------------------------------------------
class Scene_Map
  #--------------------------------------------------------------------------
  alias slipknot_showmapname_scenemap_maindispose main_dispose
  #--------------------------------------------------------------------------
  def main_dispose
    slipknot_showmapname_scenemap_maindispose
    $game_map.dispose_window_mapname
  end
end
#------------------------------------------------------------------------------
# End Scene_Map Edit
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Begin Game_Temp Edit
#------------------------------------------------------------------------------
class Game_Temp
  #--------------------------------------------------------------------------
  attr_accessor(:show_mapname)
  #--------------------------------------------------------------------------
  alias slipknot_showmapname_gametemp_init initialize
  #--------------------------------------------------------------------------
  def initialize
    slipknot_showmapname_gametemp_init
    @show_mapname = false
  end
end
#------------------------------------------------------------------------------
# End Game_Temp Edit
#------------------------------------------------------------------------------

class Window_MapName < Window_Base
  #--------------------------------------------------------------------------
  include(Show_Map_Name)
  #--------------------------------------------------------------------------
  def initialize(map_id)
    name = $data_mapinfos[map_id].name
    dumb = Bitmap.new(128, 32)
    width = dumb.text_size(name).width + 32
    dumb.dispose
    super(320 - width / 2, Y, width, 64)
    self.contents = Bitmap.new(width - 32, 32)
    self.contents.draw_text(0, 0, width - 32, 32, name, 1)
    self.opacity = 0
    self.back_opacity = Back_Opacity
    @phase = 1
    @otime = 4
    @time = Show_Frames
  end
  #--------------------------------------------------------------------------
  def opacity=(val)
    super(val)
    self.contents_opacity = val
  end
  #--------------------------------------------------------------------------
  def update
    if @otime > 0
      @otime -= 1
      return
    end
    if @phase == 1 and opacity < 255
      self.opacity += 32
      return
    elsif @phase == 1 and opacity == 255
      @phase = 2
      return
    end
    if @time > 0
      @time -= 1
    else
      if self.opacity == 0
        self.dispose
        return
      end
      self.opacity -= 48
    end
  end
end

#--------------------------------------------------------------------------
# End SDK Enabled Test
#--------------------------------------------------------------------------
end
#--------------------------------------------------------------------------

***
Rep:
Level 90
~
That's nice and all but the SDK is a piece of crap that ruins half of the best scripts.  There are more non-SDK good scripts than SDK good scripts.

It's be nice if you can make a non-SDK version (like your message system that has SDK and non-SDK versions)

***
Rep:
Level 90
... (noobs) You take out the SDK parts yourself... making this...

Code: [Select]
#==============================================================================
# ** Show Map Name
#------------------------------------------------------------------------------
# Slipknot
# 1.0
# 03.31.06
#==============================================================================




#--------------------------------------------------------------------------

$data_mapinfos = load_data('Data/MapInfos.rxdata')

module Show_Map_Name
  #--------------------------------------------------------------------------
  Show_Frames = 30
  Back_Opacity = 160
  Y = 32
  #--------------------------------------------------------------------------
end

#------------------------------------------------------------------------------
# Begin Game_Map Edit
#------------------------------------------------------------------------------
class Game_Map
  #--------------------------------------------------------------------------
  alias slipknot_showmapname_gamemap_setupmapid setup_map_id
  alias slipknot_showmapname_gamemap_update update
  #--------------------------------------------------------------------------
  def setup_map_id(map_id)
    slipknot_showmapname_gamemap_setupmapid(map_id)
    if $game_temp.show_mapname
      @window_mapname = Window_MapName.new(map_id)
      $game_temp.show_mapname = false
    end
  end
  #--------------------------------------------------------------------------
  def dispose_window_mapname
    unless @window_mapname.nil? or @window_mapname.disposed?
      @window_mapname.dispose
    end
  end
  #--------------------------------------------------------------------------
  def update
    slipknot_showmapname_gamemap_update
    unless @window_mapname.nil? or @window_mapname.disposed?
      @window_mapname.update
    end
  end
end
#------------------------------------------------------------------------------
# End Game_Map Edit
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Begin Scene_Map Edit
#------------------------------------------------------------------------------
class Scene_Map
  #--------------------------------------------------------------------------
  alias slipknot_showmapname_scenemap_maindispose main_dispose
  #--------------------------------------------------------------------------
  def main_dispose
    slipknot_showmapname_scenemap_maindispose
    $game_map.dispose_window_mapname
  end
end
#------------------------------------------------------------------------------
# End Scene_Map Edit
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Begin Game_Temp Edit
#------------------------------------------------------------------------------
class Game_Temp
  #--------------------------------------------------------------------------
  attr_accessor(:show_mapname)
  #--------------------------------------------------------------------------
  alias slipknot_showmapname_gametemp_init initialize
  #--------------------------------------------------------------------------
  def initialize
    slipknot_showmapname_gametemp_init
    @show_mapname = false
  end
end
#------------------------------------------------------------------------------
# End Game_Temp Edit
#------------------------------------------------------------------------------

class Window_MapName < Window_Base
  #--------------------------------------------------------------------------
  include(Show_Map_Name)
  #--------------------------------------------------------------------------
  def initialize(map_id)
    name = $data_mapinfos[map_id].name
    dumb = Bitmap.new(128, 32)
    width = dumb.text_size(name).width + 32
    dumb.dispose
    super(320 - width / 2, Y, width, 64)
    self.contents = Bitmap.new(width - 32, 32)
    self.contents.draw_text(0, 0, width - 32, 32, name, 1)
    self.opacity = 0
    self.back_opacity = Back_Opacity
    @phase = 1
    @otime = 4
    @time = Show_Frames
  end
  #--------------------------------------------------------------------------
  def opacity=(val)
    super(val)
    self.contents_opacity = val
  end
  #--------------------------------------------------------------------------
  def update
    if @otime > 0
      @otime -= 1
      return
    end
    if @phase == 1 and opacity < 255
      self.opacity += 32
      return
    elsif @phase == 1 and opacity == 255
      @phase = 2
      return
    end
    if @time > 0
      @time -= 1
    else
      if self.opacity == 0
        self.dispose
        return
      end
      self.opacity -= 48
    end
  end
end

#--------------------------------------------------------------------------

FTW.
Quote
Zxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens

Pwnzorz'd

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Lol, I have something similar implemented in my CMS and my save/load screen. Te CMS shows, where you
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 90
I still pwnd deathtrooper.
Quote
Zxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens

Pwnzorz'd

***
Rep:
Level 90
~
The fact that I don't touch SDK scripts and didn't know it was possible to simply edit a few lines to suddenly not be SDK scripts because I never touch them doesn't mean you pwned me.  Within my first 3 days of using RPG Maker XP (I hadn't used any others either =/) I had done a succesful edit to the default systems to allow 5 party members to fit.

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
I nearly learned scripting Ruby in 3 days, while implementing and editing other
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

**
Rep: +0/-0Level 89
Hmmm....Neko, I put in that code you put (non-sdk) and when I try to test my game it comes up with this error:

???? 'Show_Mapname' ? 29 ??? NameError ???????

undefined method 'setup_map_id' for class 'Game_Map'

P.S.   I'm an rgss noob
Project:
Legend of Sol: The Blade

Completion: 1%

***
Rep:
Level 90
Me too =] Thats just what I do to all scripts that I use lol. I dont know nor do I wish to learn RGSS at any time.
Quote
Zxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens

Pwnzorz'd

**
Rep: +0/-0Level 89
Can anyone give me a hint of why the script won't work for me? (see above error--also, I used the modified script that neko posted since it is non-sdk) Also, since I'm total noob, what do I have to use for the call script?
Project:
Legend of Sol: The Blade

Completion: 1%

***
Rep:
Level 90
~
Quote from: Season In The Abyss
Paste the code in a new section above Main (in the script editor). You can change some settings in the module called "Show_Map_Name". To show it in certain map, only add in the Call Script command (before your Teleport command) this:
Code: [Select]
$game_temp.show_mapname = true


Also Neko's version might only work for Postality Knights if it even works at all.

**
Rep: +0/-0Level 89
Hmmm....ya that is what I tried the first time Deathtrooper, but for some reason it didn't work. Thanks anyway though.  :)
Project:
Legend of Sol: The Blade

Completion: 1%

***
Rep:
Level 90
As the Requiremets says in the 1 post, this script needs SDK, without can't be used.

*****
Rep:
Level 91
Thanks For Coming
The fact that I don't touch SDK scripts and didn't know it was possible to simply edit a few lines to suddenly not be SDK scripts because I never touch them doesn't mean you pwned me.  Within my first 3 days of using RPG Maker XP (I hadn't used any others either =/) I had done a succesful edit to the default systems to allow 5 party members to fit.

And that was hard why?