RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Show Map Name (in map)

Started by Season In The Abyss, April 02, 2006, 04:44:53 PM

0 Members and 1 Guest are viewing this topic.

Season In The Abyss

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:$game_temp.show_mapname = true

F.A.Q.


Script
#==============================================================================
# ** 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
#--------------------------------------------------------------------------

Dalton

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)

Neko

... (noobs) You take out the SDK parts yourself... making this...

#==============================================================================
# ** 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.
QuoteZxmelee 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

Blizzard

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!

Neko

I still pwnd deathtrooper.
QuoteZxmelee 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

Dalton

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.

Blizzard

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!

Andromeda

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%

Neko

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.
QuoteZxmelee 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

Andromeda

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%

Dalton

Quote from: Season In The AbyssPaste 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:$game_temp.show_mapname = true

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

Andromeda

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%

Season In The Abyss

As the Requiremets says in the 1 post, this script needs SDK, without can't be used.

dwarra

Quote from: DeathTrooper on April 03, 2006, 12:53:58 AM
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?