Modified Map Name Display

LordBezoar

Villager
Member
Joined
Mar 24, 2013
Messages
6
Reaction score
0
First Language
English
Primarily Uses
For the fire once thing, I'm not sure how to do it really, but you could have it listen for a script call in the transfer event. Something like MapName.show, for example

Then, you just have to drop this call in the transfer events that take the player into the city/town/whatever from the overworld--or anywhere else you want it to fire. Not the most elegant solution, I think, but it could be helpful.
 

Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
61
First Language
English
Primarily Uses
RMMV
I'm working on modifying this script and trying to add more functions:

add a swtich which controls when to display it;

display once in same map

As a newbie to script, I will do my best!


Forgive me for keeping you waiting...
You don't need to make a switch.

You can just use a default Script Call.

Turn off Map display.

$game_map.name_display = false
and

Turn On Map display.

$game_map.name_display = true
I just tried with your script and it works.

You can also make 2 common events with these script calls.

one to enable, and one to disable.
 

Pern

Hello
Veteran
Joined
Jul 21, 2013
Messages
253
Reaction score
164
First Language
English
Primarily Uses
N/A
I'm a nub. Can I put the map display back in the upper left corner and not in the middle? Or would that defeat the entire purpose of your script? I like the style, look, fade-in, fade-out but more off to the side. I see there's a "set the window in the middle of the screen" section here, but not sure what do edit in or out.
 

Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
61
First Language
English
Primarily Uses
RMMV
I'm a nub. Can I put the map display back in the upper left corner and not in the middle? Or would that defeat the entire purpose of your script? I like the style, look, fade-in, fade-out but more off to the side. I see there's a "set the window in the middle of the screen" section here, but not sure what do edit in or out.
Here you go.

Code:
# encoding: utf-8#==============================================================================# ** Window_MapNamePlus#------------------------------------------------------------------------------#  This window displays the map name.#------------------------------------------------------------------------------#    This class replaces the default Window_MapName class, adding more#   modification and custom.#------------------------------------------------------------------------------#  Author: Majirefy#------------------------------------------------------------------------------#  Guide:#    To use this script, create a new section below Materials in Script Editor#   and paste the script there. Then turn to Scene_Map section, find string#   "Window_MapName.new", replace it by "Winodw_MapNamePlus.new".#    Map name should be set in pattern like "拉普兰德@Lapland", using symbol "@"#   to split Chinese character and English text. You can also use "@" to split#   everything in map name.#------------------------------------------------------------------------------#  Change Log:# => v1.1 - Date: 20120424#     Function Added:#      Set Font#      Set Font Size#      Set Font Bold#      Set Font Color#      Set Outline Color On or Off#      Set Outline Color of Text#      Set Padding#     To-Add Function:#      Split Map Name by "@"#      Add Modifier#     Bugs:#      Split Line Position Error# => v1.0 - Date: 20120419#     Basic Function:#      Set Window Position#      Set Font#      Set Font Size#      Set Font Bold#      Set Font Color#      Set Outline Color On or Off#      Set Outline Color of Text#      Set Font Shadow On or Off#      Set Padding#      Set Modifier#      Set Background On or Off#      Set Split Line Height#==============================================================================class Window_MapNamePlus < Window_Base  #--------------------------------------------------------------------------  # * Settings  #--------------------------------------------------------------------------  FONT_NAME_CH = ["PMingLiU", "FangSong"]       # Chinese Font Name  FONT_SIZE_CH = 42                             # Chinese Font Size  FONT_NAME_EN = ["Monotype Corsiva"]           # English Font Name  FONT_SIZE_EN = 28                             # English Font Size  FONT_BOLD    = false                          # True if Font in Bold  FONT_COLOR   = Color.new(255, 255, 255, 255)  # Color of Font  FONT_OUT     = true                           # True if Font Has Outline  OUT_COLOR    = Color.new(0, 0, 0, 200)        # Color of Outline Color of Font  FONT_SHADOW  = false                          # True if Text Drops Shadow  MODIFIER     = "~"                            # Modifier Added beside Map Name  PADDING      = 24                              # Padding between Window's Frame and Contents  LINE_HEIGHT  = 6                              # Height of Split Line  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_reader :map_name_ch                      # Chinese Map Name  attr_reader :map_name_en                      # English Map Name  attr_reader :line_x                           # Split Line X Coordinate  attr_reader :line_y                           # Split Line Y Coordinate  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    #----------------------------------------------------------------------    # * Set the window in the middle of screen.    #----------------------------------------------------------------------    super(((Graphics.width - window_width) / 8),      ((Graphics.height - (FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 8 + LINE_HEIGHT)) / 6),      window_width, FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 8 + LINE_HEIGHT)    #----------------------------------------------------------------------    # * Custom font and style.    #----------------------------------------------------------------------    contents.font.bold      = FONT_BOLD    contents.font.color     = FONT_COLOR    contents.font.outline   = FONT_OUT    contents.font.out_color = OUT_COLOR    contents.font.shadow    = FONT_SHADOW    #----------------------------------------------------------------------    # * Set Window Opacity    #----------------------------------------------------------------------    self.opacity = 0    self.contents_opacity = 0    @show_count = 0    refresh  end  #--------------------------------------------------------------------------  # * Get Window Width  #--------------------------------------------------------------------------  def window_width    return Graphics.width  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    super    if @show_count > 0 && $game_map.name_display      update_fadein      @show_count -= 1    else      update_fadeout    end  end  #--------------------------------------------------------------------------  # * Update Fadein  #--------------------------------------------------------------------------  def update_fadein    self.contents_opacity += 16  end  #--------------------------------------------------------------------------  # * Update Fadeout  #--------------------------------------------------------------------------  def update_fadeout    self.contents_opacity -= 16  end  #--------------------------------------------------------------------------  # * Open Window  #--------------------------------------------------------------------------  def open    refresh    @show_count = 150    self.contents_opacity = 0    self  end  #--------------------------------------------------------------------------  # * Close Window  #--------------------------------------------------------------------------  def close    @show_count = 0    self  end  #--------------------------------------------------------------------------  # * Refresh  #--------------------------------------------------------------------------  def refresh    contents.clear    set_map_name    unless $game_map.display_name.empty?      draw_map_name    end  end  #--------------------------------------------------------------------------  # * Draw Line  #--------------------------------------------------------------------------  def draw_line(rect)    temp_rect = rect.clone    temp_rect.height = LINE_HEIGHT    temp_rect.width /= 4    contents.gradient_fill_rect(temp_rect, color2, color1)    temp_rect.x += temp_rect.width    temp_rect.width *= 2    contents.fill_rect(temp_rect, color1)    temp_rect.x += temp_rect.width    temp_rect.width /= 2    contents.gradient_fill_rect(temp_rect, color1, color2)  end  #--------------------------------------------------------------------------  # * Set Map Name  #--------------------------------------------------------------------------  def set_map_name    temp_map_name = $game_map.display_name.split("@")    @map_name_ch  = temp_map_name[0].to_s    @map_name_en  = MODIFIER + " " + temp_map_name[1].to_s + " " + MODIFIER  end  #--------------------------------------------------------------------------  # * Draw Map Name  #--------------------------------------------------------------------------  def draw_map_name    set_line_position    set_line_width    temp_line_rect = Rect.new(-20, @line_y, set_line_width, LINE_HEIGHT)    draw_line(temp_line_rect)    temp_name_rect_ch = Rect.new(-120, 0, contents.width, FONT_SIZE_CH)    contents.font.name = FONT_NAME_CH    contents.font.size = FONT_SIZE_CH    draw_text(temp_name_rect_ch, @map_name_ch, 1)    temp_name_rect_en = Rect.new(-120, FONT_SIZE_CH, contents.width, FONT_SIZE_EN)    contents.font.size = FONT_SIZE_EN    contents.font.name = FONT_NAME_EN    draw_text(temp_name_rect_en, @map_name_en, 1)  end  #--------------------------------------------------------------------------  # * Set Line Width  #--------------------------------------------------------------------------  def set_line_width    text_width_ch = text_size(@map_name_ch).width * 1.5    text_width_en = text_size(@map_name_en).width * 1.5    (text_width_ch >= text_width_en) ?      (text_width_ch) : (text_width_en)  end  #--------------------------------------------------------------------------  # * Set Line Position  #--------------------------------------------------------------------------  def set_line_position    @line_x = (contents.width - set_line_width) / 2    @line_y = (contents.height - LINE_HEIGHT) / 6  end  #--------------------------------------------------------------------------  # * Get Color 1  #--------------------------------------------------------------------------  def color1    Color.new(255, 255, 255, 255)  end  #--------------------------------------------------------------------------  # * Get Color 2  #--------------------------------------------------------------------------  def color2    Color.new(255, 255, 255, 0)  endend
 

Pern

Hello
Veteran
Joined
Jul 21, 2013
Messages
253
Reaction score
164
First Language
English
Primarily Uses
N/A
@Lankaino

Thank you! I appreciate the help.
 

LordBezoar

Villager
Member
Joined
Mar 24, 2013
Messages
6
Reaction score
0
First Language
English
Primarily Uses
You don't need to make a switch.

You can just use a default Script call
If I understand correctly, one of these calls would have to go into each and every transfer event that enters the map(s) in question. Am I correct in that understanding?
 

Arisete™

Creator
Veteran
Joined
Jul 14, 2012
Messages
231
Reaction score
61
First Language
English
Primarily Uses
RMMV
If I understand correctly, one of these calls would have to go into each and every transfer event that enters the map(s) in question. Am I correct in that understanding?
Yes, If you want the map name to appear when you go outside into town or something, you would turn it on right before the transfer.

Same goes for turning it off if you don't want the map names to appear indoors.
 

Testralon

Warper
Member
Joined
Dec 26, 2013
Messages
1
Reaction score
0
First Language
German
Primarily Uses
This Script is Awesome!!!

I`ll use it in my Game! :)

Do you want, that i write you in the Credits for that?

If yes, with wich Name? :)
 

Majirefy

~Doraemon's Pocket~
Member
Joined
Apr 24, 2012
Messages
26
Reaction score
8
First Language
Chinese
Primarily Uses
This Script is Awesome!!!

I`ll use it in my Game! :)

Do you want, that i write you in the Credits for that?

If yes, with wich Name? :)
My honor~~~

Just with the name "Majirefy", THX~~~~
 

UnEasyCow

Warper
Member
Joined
Mar 19, 2014
Messages
2
Reaction score
1
First Language
English
Primarily Uses
Hello everyone, I am very new to RMVX Ace and to Ruby. This script works very well for what I need and I was able to tweak it in most areas. I was wondering if there is a way I could add a line of code so when the @ is not there to separate the two lines the ~ will not show up. Any help would be greatly appreciated, thanks!
 

VulgarisStudios

Villager
Member
Joined
May 12, 2015
Messages
11
Reaction score
1
First Language
English
Primarily Uses
Hi,


I know I'm late but I used this script and it has worked successfully. But now it won't even display the map display names. I made sure the map display format was correct. For example my map name is:  The City of Tranquil@Deliver. I followed the steps correctly. I just want to know what's going on. I've been trying to fix it for 3 hours.
 

Majirefy

~Doraemon's Pocket~
Member
Joined
Apr 24, 2012
Messages
26
Reaction score
8
First Language
Chinese
Primarily Uses
Hi,


I know I'm late but I used this script and it has worked successfully. But now it won't even display the map display names. I made sure the map display format was correct. For example my map name is:  The City of Tranquil@Deliver. I followed the steps correctly. I just want to know what's going on. I've been trying to fix it for 3 hours.


You can give me a screen shot of how it displayed incorrectly so I can see what's wrong.
 

DerKIAS

Demon Lord
Veteran
Joined
Sep 19, 2016
Messages
57
Reaction score
40
First Language
German
Primarily Uses
RMVXA
Hey there! The demo seems to be broken...? Also I somehow cant get the script to work. I followed all the steps but it doesnt show any of the mapnames.. maybe you could upload a new demo so I can figure out what im doing wrong?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top