RPGVX.net

  RPG-Maker VX => VX Skripte [Fertiger Code] => Thema gestartet von: Onkel Hell am April 23, 2008, 07:30:07

Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 23, 2008, 07:30:07
Beschreibung
Ursprünglich sollte das hier ein Addon für mein Simple Day and Night werden um den Mapnamen wieder gescheit anzeigen zu können aber das Script läuft auch ohne ganz gut
Last Update : v1.23 - 09.11.08
Changelog :
-----------------------------------------------------------------------------------
v1.24
-----------------------------------------------------------------------------------
bugfixes
-----------------------------------------------------------------------------------
v1.23
-----------------------------------------------------------------------------------
funktion zum nicht anzeigen eingebaut
-----------------------------------------------------------------------------------
v1.22
-----------------------------------------------------------------------------------
fehler von gsub! behoben
-----------------------------------------------------------------------------------
v1.21
-----------------------------------------------------------------------------------
diverse fehler behoben

Anleitung
#==============================================================================
# F.A.Q.
#==============================================================================
# If you want a background picture for your mapnames just put a picture
# called "location_back" into the folder "Graphics/System"
#==============================================================================
# Main config
#==============================================================================
  X_POSITION = 10           # Default = 10
  Y_POSITION = 10           # Default = 10
  DELAY = 2                 # How long the Mapname is shown (in seconds)
  ALIGN = 0                 # Align of the Mapname(0 = left, 1 = center, 2 = right)
  PIC_FORMAT = "png"        # Format for the Nightlight-Maps
  COLOR = 255,255,255,255   # Textcolor, default is white (255,255,255,255)
  $show_mapname = true      # Visible ?
Beispiel Hintergrund
(http://img206.imageshack.us/img206/1782/locationbacknk7.png)

Screenshot
(http://img301.imageshack.us/img301/3454/screenmapnameul3.png)
Script v1.24
#==============================================================================
#  Simple Map-Name
#
#  Version : 1.24 - 12.11.08
#  Created by : hellMinor
#  Do NOT redistribute without my permission
#  Description : A little script to show the name of the current map
#  Note : This script was originally made to cut out the additions to
#         the mapname made by my Day and Night script but it works normally
#         without it.
#
#==============================================================================
# F.A.Q.
#==============================================================================
# If you want a background picture for your mapnames just put a picture
# called "location_back" into the folder "Graphics/System"
#==============================================================================
# Main config
#==============================================================================
  X_POSITION = 10           # Default = 10
  Y_POSITION = 10           # Default = 10
  DELAY = 2                 # How long the Mapname is shown (in seconds)
  ALIGN = 0                 # Align of the Mapname(0 = left, 1 = center, 2 = right)
  PIC_FORMAT = "png"        # Format for the Nightlight-Maps
  COLOR = 255,255,255,255   # Textcolor, default is white (255,255,255,255)
  $show_mapname = true      # Visible ?
#==============================================================================
class Scene_Map
#==============================================================================
  def update_transfer_player
    return unless $game_player.transfer?
    fade = (Graphics.brightness > 0)
    fadeout(30) if fade
    @spriteset.dispose
    dispose_showname_window
    $game_player.perform_transfer
    $game_map.autoplay
    $game_map.update
    Graphics.wait(15)
    @spriteset = Spriteset_Map.new
    fadein(30) if fade
    Input.update
    create_showname_window
  end
#------------------------------------------------------------------------------
  def create_showname_window
    @str = $game_map.name.gsub(/\[\w*\]/) {""}
    @mapname = Window_MapName.new(X_POSITION,Y_POSITION,200,56,@str)
    @mapname.z = 300
    @delay = DELAY*60
  end
#------------------------------------------------------------------------------ 
  def dispose_showname_window
    @mapname.dispose if defined?(@mapname)
  end
#------------------------------------------------------------------------------
  alias update_mapname_adds update
  def update
    update_mapname_adds
    if $show_mapname == true and defined?(@mapname) and not @mapname.disposed?
      @mapname.fade_in if @mapname.contents_opacity <= 255 and @delay > 0
      @delay -= 1 if @mapname.contents_opacity == 255 and @delay > 0
      @mapname.fade_out if @mapname.contents_opacity >= 0 and @delay == 0
    end
  end
#------------------------------------------------------------------------------
  def update_scene_change
    return if $game_player.moving?    # Is player moving?
    dispose_showname_window if $game_temp.next_scene != nil
    case $game_temp.next_scene
    when "battle"
      call_battle
    when "shop"
      call_shop
    when "name"
      call_name
    when "menu"
      call_menu
    when "save"
      call_save
    when "debug"
      call_debug
    when "gameover"
      call_gameover
    when "title"
      call_title
    else
      $game_temp.next_scene = nil
    end
  end
 
end
#==============================================================================
class Window_MapName < Window_Base
#============================================================================== 
  def initialize(x = 0,y = 0,width = 544, height = 416, text = "")
    super(x,y,width,height)
    self.opacity = 0
    self.contents_opacity = 0
    @text = text
    refresh
  end
#------------------------------------------------------------------------------ 
  def refresh
    self.contents.clear
    @sprite = Sprite.new()
    begin
    @sprite.bitmap = Bitmap.new("Graphics/System/location_back")
    rescue Errno::ENOENT
    end
    @sprite.opacity = 0
    @sprite.x = X_POSITION+5
    @sprite.y = Y_POSITION+5
    self.contents.font.color = Color.new(COLOR[0],COLOR[1],COLOR[2],COLOR[3])
    self.contents.draw_text(4, 0, self.width - 40, WLH, @text, ALIGN)
  end
#------------------------------------------------------------------------------
  def dispose
    @sprite.dispose
    super
  end
#------------------------------------------------------------------------------
  def fade_in
    self.contents_opacity += 2
    @sprite.opacity += 2
  end
#------------------------------------------------------------------------------
  def fade_out
    self.contents_opacity -= 2
    @sprite.opacity -= 2
  end
#------------------------------------------------------------------------------   
end
#==============================================================================
class Scene_Title < Scene_Base
#==============================================================================
  alias load_database_mapname_adds load_database
  def load_database
    load_database_mapname_adds
    $data_mapinfos      = load_data("Data/MapInfos.rvdata")
    for key in $data_mapinfos.keys
      $data_mapinfos[key] = $data_mapinfos[key].name
    end
  end
 
end
#==============================================================================
class Game_Map
#============================================================================== 
  def name
    $data_mapinfos[@map_id]
  end
 
end

Script v1.23
#==============================================================================
#  Simple Map-Name
#
#  Version : 1.23 - 09.11.08
#  Created by : hellMinor
#  Do NOT redistribute without my permission
#  Description : A little script to show the name of the current map
#  Note : This script was originally made to cut out the additions to
#         the mapname made by my Day and Night script but it works normally
#         without it.
#
#==============================================================================
# F.A.Q.
#==============================================================================
# If you want a background picture for your mapnames just put a picture
# called "location_back" into the folder "Graphics/System"
#==============================================================================
# Main config
#==============================================================================
  X_POSITION = 10           # Default = 10
  Y_POSITION = 10           # Default = 10
  DELAY = 2                 # How long the Mapname is shown (in seconds)
  ALIGN = 0                 # Align of the Mapname(0 = left, 1 = center, 2 = right)
  PIC_FORMAT = "png"        # Format for the Nightlight-Maps
  COLOR = 255,255,255,255   # Textcolor, default is white (255,255,255,255)
  $show_mapname = true      # Visible ?
#==============================================================================
class Scene_Map
#==============================================================================
  def update_transfer_player
    return unless $game_player.transfer?
    fade = (Graphics.brightness > 0)
    fadeout(30) if fade
    @spriteset.dispose
    dispose_showname_window
    $game_player.perform_transfer
    $game_map.autoplay
    $game_map.update
    Graphics.wait(15)
    @spriteset = Spriteset_Map.new
    fadein(30) if fade
    Input.update
    create_showname_window
  end
#------------------------------------------------------------------------------
  def create_showname_window
    @str = $game_map.name.gsub(/\[\w*\]/) {""}
    @mapname = Window_MapName.new(X_POSITION,Y_POSITION,200,56,@str)
    @mapname.z = 300
    @delay = DELAY*60
  end
#------------------------------------------------------------------------------ 
  def dispose_showname_window
    @mapname.dispose if defined?(@mapname)
  end
#------------------------------------------------------------------------------
  alias update_mapname_adds update
  def update
    update_mapname_adds
    if $show_mapname == true and defined?(@mapname)
      @mapname.fade_in if @mapname.contents_opacity <= 255 and @delay > 0
      @delay -= 1 if @mapname.contents_opacity == 255 and @delay > 0
      @mapname.fade_out if @mapname.contents_opacity >= 0 and @delay == 0
    end
  end
#------------------------------------------------------------------------------   
  alias call_battle_mapname call_battle
  def call_battle
    call_battle_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------   
  alias call_shop_mapname call_shop
  def call_shop
    call_shop_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------   
  alias call_name_mapname call_name
  def call_name
    call_name_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------     
  alias call_menu_mapname call_menu
  def call_menu
    call_menu_mapname
    dispose_showname_window   
  end
#------------------------------------------------------------------------------   
  alias call_save_mapname call_save
  def call_save
    call_save_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------ 
  alias call_debug_mapname call_debug
  def call_debug
    call_debug_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------   
  alias call_gameover_mapname call_gameover
  def call_gameover
    call_gameover_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------   
  alias call_title_mapname call_title
  def call_title
    call_title_mapname
    dispose_showname_window
  end
 
end
#==============================================================================
class Window_MapName < Window_Base
#============================================================================== 
  def initialize(x = 0,y = 0,width = 544, height = 416, text = "")
    super(x,y,width,height)
    self.opacity = 0
    self.contents_opacity = 0
    @text = text
    refresh
  end
#------------------------------------------------------------------------------ 
  def refresh
    self.contents.clear
    @sprite = Sprite.new()
    begin
    @sprite.bitmap = Bitmap.new("Graphics/System/location_back")
    rescue Errno::ENOENT
    end
    @sprite.opacity = 0
    @sprite.x = X_POSITION+5
    @sprite.y = Y_POSITION+5
    self.contents.font.color = Color.new(COLOR[0],COLOR[1],COLOR[2],COLOR[3])
    self.contents.draw_text(4, 0, self.width - 40, WLH, @text, ALIGN)
  end
#------------------------------------------------------------------------------
  def fade_in
    self.contents_opacity += 2
    @sprite.opacity += 2
  end
#------------------------------------------------------------------------------
  def fade_out
    self.contents_opacity -= 2
    @sprite.opacity -= 2
  end
#------------------------------------------------------------------------------   
end
#==============================================================================
class Scene_Title < Scene_Base
#==============================================================================
  alias load_database_mapname_adds load_database
  def load_database
    load_database_mapname_adds
    $data_mapinfos      = load_data("Data/MapInfos.rvdata")
    for key in $data_mapinfos.keys
      $data_mapinfos[key] = $data_mapinfos[key].name
    end
  end
 
end
#==============================================================================
class Game_Map
#============================================================================== 
  def name
    $data_mapinfos[@map_id]
  end
 
end
Script v1.22
#==============================================================================
#  Simple Map-Name
#
#  Version : 1.22 - 27.04.08
#  Created by : hellMinor
#  Do NOT redistribute without my permission
#  Description : A little script to show the name of the current map
#  Note : This script was originally made to cut out the additions to
#         the mapname made by my Day and Night script but it works normally
#         without it.
#
#==============================================================================
# F.A.Q.
#==============================================================================
# If you want a background picture for your mapnames just put a picture
# called "location_back" into the folder "Graphics/System"
#==============================================================================
# Main config
#==============================================================================
  X_POSITION = 10         # Default = 10
  Y_POSITION = 10         # Default = 10
  DELAY = 2               # How long the Mapname is shown (in seconds)
  ALIGN = 0               # Align of the Mapname(0 = left, 1 = center, 2 = right)
  PIC_FORMAT = "png"      # Format for the Nightlight-Maps
  COLOR = 255,255,255     # Textcolor, default is white (255,255,255)
#==============================================================================
class Scene_Map
#==============================================================================
  def update_transfer_player
    return unless $game_player.transfer?
    fade = (Graphics.brightness > 0)
    fadeout(30) if fade
    @spriteset.dispose
    dispose_showname_window
    $game_player.perform_transfer
    $game_map.autoplay
    $game_map.update
    Graphics.wait(15)
    @spriteset = Spriteset_Map.new
    fadein(30) if fade
    Input.update
    create_showname_window
  end
#------------------------------------------------------------------------------
  def create_showname_window
    @str = $game_map.name.gsub(/\[\w*\]/) {""}
    
    @mapname = Window_MapName.new(X_POSITION,Y_POSITION,200,56)
    @mapname.set_text(@str)
    @mapname.opacity = 0
    @mapname.contents_opacity = 0
    @mapname.z = 300
    
    if File.exist?("Graphics/System/location_back."+PIC_FORMAT)
      @location_back = Sprite.new
      @location_back.bitmap = Cache.system("location_back")
      @location_viewport = Viewport.new(X_POSITION+5,
                                        Y_POSITION+5,
                                        @location_back.bitmap.width,
                                        @location_back.height)
      @location_back.viewport = @location_viewport
      @location_back.opacity = 0
      @location_viewport.z = 250
    end
    @update_showname_fade = "fadein"
    @delay = DELAY*60
    
  end
#------------------------------------------------------------------------------  
  def dispose_showname_window
    @location_back.bitmap.dispose if defined?(@location_back.bitmap)
    @location_back.dispose if defined?(@location_back)
    @location_viewport.dispose if defined?(@location_viewport)
    @mapname.dispose if defined?(@mapname)
    @update_showname_fade = nil
  end
#------------------------------------------------------------------------------
  alias update_mapname_adds update
  def update
    update_mapname_adds
    showname_window_fadein if @update_showname_fade.eql?("fadein")
    showname_window_fadeout if @update_showname_fade.eql?("fadeout")
  end
#------------------------------------------------------------------------------  
  def showname_window_fadeout
    @mapname.contents_opacity -= 2
    @location_back.opacity -= 2 if defined?(@location_back)
    @update_showname_fade = nil if @mapname.contents_opacity == 0
  end
#------------------------------------------------------------------------------  
  def showname_window_fadein
    @mapname.contents_opacity += 2 if @mapname != nil
    @location_back.opacity += 2 if defined?(@location_back)
    @delay -= 1 if @mapname.contents_opacity == 255
    @update_showname_fade = "fadeout" if @delay == 0
  end
#------------------------------------------------------------------------------  
  alias call_battle_mapname call_battle
  def call_battle
    call_battle_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------  
  alias call_shop_mapname call_shop
  def call_shop
    call_shop_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------  
  alias call_name_mapname call_name
  def call_name
    call_name_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------    
  alias call_menu_mapname call_menu
  def call_menu
    call_menu_mapname
    dispose_showname_window    
  end
#------------------------------------------------------------------------------  
  alias call_save_mapname call_save
  def call_save
    call_save_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------  
  alias call_debug_mapname call_debug
  def call_debug
    call_debug_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------  
  alias call_gameover_mapname call_gameover
  def call_gameover
    call_gameover_mapname
    dispose_showname_window
  end
#------------------------------------------------------------------------------  
  alias call_title_mapname call_title
  def call_title
    call_title_mapname
    dispose_showname_window
  end
  
end
#==============================================================================
class Window_MapName < Window_Base
#==============================================================================  
  def initialize(x = 0,y = 0,width = 544, height = WLH + 32)
    super(x,y,width,height)
  end
#------------------------------------------------------------------------------  
  def set_text(text)
    if text != @text or align != @align
      self.contents.clear
      self.contents.font.color = Color.new(COLOR[0],COLOR[1],COLOR[2])
      self.contents.draw_text(4, 0, self.width - 40, WLH, text, ALIGN)
      @text = text
      @align = ALIGN
    end
  end
  
end
#==============================================================================
class Scene_Title < Scene_Base
#==============================================================================
  alias load_database_mapname_adds load_database
  def load_database
    load_database_mapname_adds
    $data_mapinfos      = load_data("Data/MapInfos.rvdata")
    for key in $data_mapinfos.keys
      $data_mapinfos[key] = $data_mapinfos[key].name
    end
  end
  
end
#==============================================================================
class Game_Map
#==============================================================================  
  def name
    $data_mapinfos[@map_id]
  end
  
end
Script v1.2
#==============================================================================
#  Simple Map-Name
#
#  Version : 1.2 - 24.04.08
#  Created by : hellMinor
#  Do NOT redistribute without my permission
#  Description : A little script to show the name of the current map
#  Note : This script was originally made to cut out the additions to
#         the mapname made by my Day and Night script but it works normally
#         without it.
#
#==============================================================================
# F.A.Q.
#==============================================================================
# If you want a background picture for your mapnames just put a picture
# called "location_back" into the folder "Graphics/System"
#==============================================================================
# Main config
#==============================================================================
  X_POSITION = 10         # Default = 10
  Y_POSITION = 10         # Default = 10
  DELAY = 2               # How long the Mapname is shown (in seconds)
  ALIGN = 0               # Align of the Mapname(0 = left, 1 = center, 2 = right)
  PIC_FORMAT = "png"      # Format for the Nightlight-Maps
  COLOR = 255,255,255     # Textcolor, default is white (255,255,255)
#==============================================================================
class Scene_Map
#==============================================================================
  def update_transfer_player
    return unless $game_player.transfer?
    fade = (Graphics.brightness > 0)
    fadeout(30) if fade
    @spriteset.dispose
    dispose_showname_window
    $game_player.perform_transfer
    $game_map.autoplay
    $game_map.update
    Graphics.wait(15)
    @spriteset = Spriteset_Map.new
    fadein(30) if fade
    Input.update
    create_showname_window
  end
#------------------------------------------------------------------------------
  def create_showname_window
    @str = $game_map.name
    @str.gsub!(/\[\w*\]/) {""}
    
    @mapname = Window_MapName.new(X_POSITION,Y_POSITION,200,56)
    @mapname.set_text(@str)
    @mapname.opacity = 0
    @mapname.contents_opacity = 0
    @mapname.z = 300
    
    if File.exist?("Graphics/System/location_back."+PIC_FORMAT)
      @location_back = Sprite.new
      @location_back.bitmap = Cache.system("location_back")
      @location_viewport = Viewport.new(X_POSITION,
                                        Y_POSITION+5,
                                        @location_back.bitmap.width,
                                        @location_back.height)
      @location_back.viewport = @location_viewport
      @location_back.opacity = 0
      @location_viewport.z = 250
    end
    @update_showname_fade = "fadein"
    @delay = DELAY*60
    
  end
#------------------------------------------------------------------------------  
  def dispose_showname_window
    @location_back.bitmap.dispose if defined?(@location_back.bitmap)
    @location_back.dispose if defined?(@location_back)
    @location_viewport.dispose if defined?(@location_viewport)
    @mapname.dispose if defined?(@mapname)
  end
#------------------------------------------------------------------------------
  alias update_addition update
  def update
    update_addition
    showname_window_fadein if @update_showname_fade.eql?("fadein")
    showname_window_fadeout if @update_showname_fade.eql?("fadeout")
  end
#------------------------------------------------------------------------------  
  def showname_window_fadeout
    @mapname.contents_opacity -= 2
    @location_back.opacity -= 2 if defined?(@location_back)
    @update_showname_fade = nil if @mapname.contents_opacity == 0
  end
#------------------------------------------------------------------------------  
  def showname_window_fadein
    @mapname.contents_opacity += 2
    @location_back.opacity += 2 if defined?(@location_back)
    @delay -= 1 if @mapname.contents_opacity == 255
    @update_showname_fade = "fadeout" if @delay == 0
  end
  
end
#==============================================================================
class Window_MapName < Window_Base
#==============================================================================  
  def initialize(x = 0,y = 0,width = 544, height = WLH + 32)
    super(x,y,width,height)
  end
#------------------------------------------------------------------------------  
  def set_text(text)
    if text != @text or align != @align
      self.contents.clear
      self.contents.font.color = Color.new(COLOR[0],COLOR[1],COLOR[2])
      self.contents.draw_text(4, 0, self.width - 40, WLH, text, ALIGN)
      @text = text
      @align = ALIGN
    end
  end
  
end
Titel: Simple Map-Name
Beitrag von: woratana am April 23, 2008, 09:01:19
How about some screenies? :)

Anyway, I think you should alias def update_transfer_player, since I see that you only add the line:
create_showname_windowbelow all commands in that method.

+ In class Window_MapName, you should get map name in there instead of using set_text. Since it'll only show map name.

If you want to use set_text, I suggest to create new Window_Help and change its properties~ :)
    @mapname = Window_MapName.new(X_POSITION,Y_POSITION,150,56)
    @mapname.set_text(@str)
    @mapname.opacity = 0
    @mapname.contents_opacity = 0
to >>
@mapname = Window_Help.new
@mapname.x, @mapname.y = X_POSITION, Y_POSITION
@mapname.width, @mapname.height = 150, 56
^ # You can merge this line with a line above~
@mapname.create_contents # Create contents after resize window
@mapname.set_text(@str, ALIGN)
@mapname.opacity = @mapname.contents_opacity = 0
This will make you don't have to create new window class. :)

Last thing, .eql? in your script looks interesting :)
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 23, 2008, 09:15:14
uhm well i just cant use alias there ,
i added dispose_showname_window too a few lines over that

i used @str since i cut the string here
if $game_map.name.to_s.index("[int]") != nil
      @str = $game_map.name.slice[5,self.size-1]
    end
    else if $game_map.name.to_s.index("[dint]") != nil
      @str = $game_map.name.slice(6,$game_map.name.size-1)
    else
      @str = $game_map.name
    end

originally i made this as an addon script for my day and night where you can put [int] or [dint] to the front of the name and the other mapname scripts wont ignore this

the string.eql? just checks if 2 strings are equal in content and lenght , i dont know i have to do this in ruby,
but i.e. in java you cant link 2 strings like this : string1 == string2 , this will allways be false
where string1.equals(string2) gives true
but i dont think ruby is that strict about that
Titel: Simple Map-Name
Beitrag von: woratana am April 23, 2008, 09:32:16
Oh, that's nice, you've used Java before :)
I think it will useful when you use Ruby. >_>~

And yeah, Ruby isn't that strict.
You can use @str == 'fadein' :)
Titel: Simple Map-Name
Beitrag von: Dainreth am April 23, 2008, 16:24:18
Schaut gut aus und funktioniert auch einwandfrei das Skript. Mal wieder gute Arbeit, dankeschön hM!
Titel: Simple Map-Name
Beitrag von: Copyman am April 23, 2008, 16:48:01
Ich habs grade eingebaut aber wenn ich jetz testen will zeigt er mir immer nen fehrler an, der wie folgt lautet: ????? 'simple map name' ? 46 ??? ArgumentError ????????

wrong number of arguments(0 for 1)

an zeile 46 des scripts steht :    @str = $game_map.name.slice[5,self.size-1]

ich hab nix daran verändert

und bevor die frag kommt, ja ich habe mein altes script das den mapnamen anzeigt vorher gelöscht
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 23, 2008, 17:18:15
danke für die info , war noch kleiner bug aber is gefixed
ich sollte mir beta tester suchen bevor ich was poste^^
Titel: Simple Map-Name
Beitrag von: Copyman am April 23, 2008, 17:58:54
danke fürs ändern, nu das nächste ^.^
kann ich das iwie machen, das das rechts oben am bildschirm in der ecke is anstatt links ?
und, kann ich die farbe des mapnamens auf schwazr ändern, weil ich hab nanderes bild als du drin als hintergrund dafür und das is hell, darauf sieht man den mapnamen in weis nich
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 23, 2008, 18:10:17
wo der mapname angezeigt wird kannste ganz einfach über die Y_POSITION und X_POSITION steuern,
dabei zu wissen brauch man eignetlich nur das der screen 544x416 pixel breit, wenns rechts sein soll solltest du aber ALIGN = 2 ( rechts ) stellen

das mit der färbe ändern gefällt mir ^^ ich bau das mal ebend ein

edit : so is schon drinne

die farbe stellste einfach über COLOR ein , is der ganz normale RGB farbcode
Titel: Simple Map-Name
Beitrag von: Gamekiller48@gmail.com am April 23, 2008, 18:54:44
EINE FRAGE: ES GIBT EIGENTLICH SCHON EIN SCRIPT, DASS DAS GENAU GLEICHE BEWIRKT!!!
Von Moghunter auf RPGRevolution.com! Warum noch ein Script???
Titel: Simple Map-Name
Beitrag von: ERZENGEL am April 23, 2008, 18:57:16
[ironie]WEIL EBEN BEI MOGHUNTERS SKRIPT [INT] UND [DINT] VON HELLMINROS TOLLEN TAG UND NACHT SYSTEM IM MAPNAME AUFTAUCHEN!!!!!!!!!!!!!!!!!!111111111111einseinself[/ironie]

EDIT: Schönes Skript, hellMinor. Du könntest ja es erleichtern andere "Tags" auszublenden. Also bei diesen KGC-Skript mit den Tilesets da kommen die ja auch vor und falls es noch andere gibt, wäre das ne schöne Sache für die, die so ein Skript wie dieses hier verwenden. Und entschuldigt meinen Sarkasmus :P
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 23, 2008, 19:21:06
Zitat von: GameKiller48
EINE FRAGE: ES GIBT EIGENTLICH SCHON EIN SCRIPT, DASS DAS GENAU GLEICHE BEWIRKT!!!
Von Moghunter auf RPGRevolution.com! Warum noch ein Script???
also dazu fällt mir absolut nichts ein, wenn man schon nicht weiss wovon man redet sollte man besser garnichts sagen
edit:
keiner zwingt mich dazu irgendwelche scripte zu erstellen und/oder zu posten, ich tu das allein weils mir spaß macht und ich anderen leuten damit vllt helfen kann aber bei solchen kommentaren vergeht einem der spaß dabei, wenn keiner mehr scripte posten würde würden leute wie du dann wahrscheinlich ziemlich alt aussehen
denk da einfach mal drüber nach

@erzengel : du sagst es !
also andere tags mit ausblenden zu lassen is einfach , brauchst nur noch mehr suchmuster hinzufügen , bei mehr suchmustern würd ich das allerdings auf nen switch umstellen.
hätte grad ne idee , vllt könnt ich alle mapnamen durch gehen und selbst nach mustern suchen die in [ ] stehen und somit sämtliche tags ausblenden ohne sie zu kennen , das müsste eignetlich gehen
Titel: Simple Map-Name
Beitrag von: ERZENGEL am April 23, 2008, 19:43:28
Ich weiß wies ja funktioniert ^^ Es war ein Vorschlag, da Codestellen zu suchen und vor allem zu erweitern nicht gerade Sachen für Anfänger sind. Auch wenn es nur die Änderung im String ist und den einen Parameter zu ändern. Hab mich Ende 2006 auch erst langsam rangetraut, die Strings im RMXP zu ändern, dass ich mein Game auf deutsch habe xD

EDIT: Sorry, ist dein Skript, aber nochmal zur Verdeutlichung ^^: ARRAY = %w{[int] [dint] [vx] [erzvx] [hellminor]}  # Array mit Strings füllen

# In Scene_map#create_showname dann das hier:
# @str erst festlegen, dann Schleife und Abfrage,
# ob eines der Werte des Arrays in $game_map.name vorkommt
@str = $game_map.name
(0...ARRAY.size).each { |i|
  if $game_map.name.include?(ARRAY[i])
    @str = $game_map.name.slice(ARRAY[i].length, $game_map.name.size - 1)
  end
}
Btw das mit den [ ] wäre besser, aber da würde ich ein paar Stunden, wenn nicht Tage, dran setzen :DAlso viel Glück und Spaß.
Titel: Simple Map-Name
Beitrag von: Hanmac am April 23, 2008, 21:35:27
@Erzi:
me + 5min ->
@str = $game_map.name
@str.gsub!(/\[\w*\]/) {""}
xD
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 23, 2008, 21:56:01
ok die lösung noch eleganter als die die ich mir jetz überlegt hatte
gsub kannte ich selbst noch net
ich hätte jetz einfach alles bis zum letzten index eines ] weg gesliced

wirklich gute lösung
Titel: Simple Map-Name
Beitrag von: Evil95 am April 23, 2008, 22:17:29
bei mir wird kein mapname angezeigt? also so als ob das script gar nicht vorhanden währe. was habe ich falsch gemacht?
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 23, 2008, 22:24:48
wann wird denn nichts angezeigt?

wenn man neues spiel startet wird auf der ersten karte nichts angezeigt , is auch so beabsichtigt, bei nem intro wär das zb etwas störend
Titel: Simple Map-Name
Beitrag von: Evil95 am April 23, 2008, 22:29:23
oh ok funzt doch^^

Edit: wenn ick jetzt ein Bild benutze das einen Hintergrund hat, zb das hier: (http://demonvx.de.funpic.de/Anderes/location_back.png), dann wird die schrift unter dem bild angezeigt, also das bild is so zusagen auf ner höheren ebene als die schrift. kann man das ändern?
Titel: Simple Map-Name
Beitrag von: Dainreth am April 24, 2008, 15:59:07
Bin zwar kein Skripter, daher kann ich dir auch nicht 100% sagen, ob's funktioniert, allerdings muss das an der Z-Koordinate liegen. In Zeile 69 findet man dies: @location_viewport.z = 250
Das heißt, die Z-Koordinate liegt bei 250, die der Schrift kann ich nirgends finden. Vielleicht solltest du diese 250 einfach mal etwas runtersetzen, wenn das Bild über der Textebene angezeigt wird, aber wie gesagt, kann nicht garantieren, dass es was bringt.
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 24, 2008, 16:07:24
oh my bad^^
hab ne falsche z order drinne, ich korrigier das ebend

edit: probierrs jetz mal mit der neuen version
hab jetz auch mal den cutter von hanmac drinne , funzt selbst besser als meine 2te lösung dafür
Titel: Simple Map-Name
Beitrag von: Dainreth am April 24, 2008, 16:19:51
Ich dachte mir schon, warum ich davor keine Z-Koordinate der Schrift gefunden hatte, aber nun scheint's im Skript zu sein, teste es mal Evil95. Da hat hM glatt mal wieder ein Danke verdient!
Titel: Simple Map-Name
Beitrag von: Evil95 am April 24, 2008, 17:02:50
Jo es geht. fettes THX  :D
Titel: Simple Map-Name
Beitrag von: Evil95 am April 26, 2008, 23:03:50
habe einen fehler entdeckt. kann man dem screenshot entnehmen:
(http://img150.imageshack.us/img150/3383/simplemapnamefehlerto6.th.png) (http://img150.imageshack.us/my.php?image=simplemapnamefehlerto6.png)
währe schön, wenn man das fixen könnte.
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 27, 2008, 00:39:29
wann genau tritt das denn auf?
wenn ich battle processing mache kommt das bei mir nich?
Titel: Simple Map-Name
Beitrag von: Razael am April 27, 2008, 01:00:52
Sowas taucht auch nurin echten Kämpfen auf der KGC STEAL funzt auch nicht beim processing sondern nur bei echten Kämpfen XD
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 27, 2008, 01:14:24
ah ich glaub ich weiss jetz was du meinst ,
das tritt auf wenn der mapname noch angezeigt wird und dann battle ausgelöst wird durch was auch immer
v1.21
edit : der fehler is jetz behoben , dazu noch ein fehler der bisher keinem aufgefallen is :P
Titel: Simple Map-Name
Beitrag von: Onkel Hell am April 27, 2008, 20:05:21
leider noch ne neue version -> v1.22
wurd noch ein fehler entdeckt -> hier (http://forum.rpgvx.net/index.php?showtopic=271&view=findpost&p=13175)
gsub! hat dazu geführt den ganzen mapnamen zu komplett zu verändern statt nur temporär
habs leicht umgebaut , aufjedenfall sollte es jetz funktionieren
Titel: Re: Simple Map-Name
Beitrag von: Klex am Oktober 29, 2008, 12:38:33
Kurze Frage. Da ich gleich wieder auf Arbeit muss hab ich leider keine Zeit zu schauen ob diese Frage schon beantwortet wurde sorry.
Mein Problem ist, dass der Name der Map bei jeder Karte angezeigt wird (auch beim Intro usw). Kann mir wer die (sicher einfache Lösung)
sagen wie ich bestimmen kann auf welcher Map der Name angezeigt wird???
Schonmal danke im voraus
Grüße Klex
Titel: Re: Simple Map-Name
Beitrag von: Gaara am November 04, 2008, 13:49:34
gibst da ne möglichkeit, das man das skript nur für bestimmte gebiete aktivieren kann, da ich z.b. ein intro hab, was sich über mehrere seiten bzw maps strecken tut.
und es wäre auch sinnvoller wenn der name des ortes nur bei der ersten map angezeigt wird und nicht bei jeder weiteren, wie z.b. in einem wald oder ner höhle.
kann man da was machen ?

aber ist auf jedenfall ein tolles skript *daumenzeig* =)
Titel: Re: Simple Map-Name
Beitrag von: Onkel Hell am November 09, 2008, 18:33:02
habs geupdatet
wenns nich angezeigt werden soll
stellt einfach die variable $show_mapname auf false
also so innem call script  -> $show_mapname = false
Titel: Re: Simple Map-Name
Beitrag von: Klex am November 09, 2008, 21:41:33
Vielen Vielen dank klappt wunderbar!!
Titel: Re: Simple Map-Name
Beitrag von: Gaara am November 10, 2008, 11:12:13
heyho das funktioniert wie sau, haste fein gemacht =D
Titel: Re: Simple Map-Name
Beitrag von: Gaara am November 10, 2008, 12:21:22
Jetzt hat sich ein neues problem aufgetan und zwar benutze ich auch das simple tag nacht script und wenn ich die sichtbarkeit abschalte, dann wird in meinem menü, wo der ortsname angezeigt wird, [int]Ortsname angezeigt. also wird rein theoretisch das ganze skript abgeschaltet, kann man das irgendwie beheben und so einstellen, dass man nur die anzeige ein und ausschalten kann un das skript aber trotzdem im hintergrund weiterarbeitet?
Titel: Re: Simple Map-Name
Beitrag von: Onkel Hell am November 10, 2008, 12:36:24
also du has ein menü script und da steht jetz [int] was anscheinend vorher nich da stand
was hat das jetz mit dem day and night zu tun?^^
welches menü zb wär mal ne info
Titel: Re: Simple Map-Name
Beitrag von: Gaara am November 10, 2008, 12:51:20
ich benutze ein ringmenü von Syvkal und das hat ebenfalls ne eingebaute ortsnamenfunktion genau wie das finalfantasy menü.

natürlich hat das was mit dem tag nacht skript zu tun^^ weil du vor dem kartenname [int] setzen musst, damit der tageswechsel sichtbar ist, kurzgesagt damit es hell und dunkel wird.
und du hast doch das simple map name skript ursprünglich gemacht damit man das [int] nicht mehr im menü beim ortsname stehen sieht sondern nur der name ansich.

verstehste?  ^___^

und sobald ich das name skript per $show_mapname = false abschalte, sieht man nun das [int] wieder vorm ortsname, weil das simple map name skript scheinbar komplett abgeschalten wird und es soll aber nur die sichtfunktion ausgeschaltet sein, damit das skript nur im hintergrund weiterläuft, man die Namensschilder nicht mehr sieht und die ortsnamen im menü ordentlich angezeigt werden.
Titel: Re: Simple Map-Name
Beitrag von: Onkel Hell am November 10, 2008, 13:37:37
nein das script hab ich gemacht damit man beim mapwechsel den namen sieht ohne präfix
wenns vorher funktioniert hat muss ich dir leider sagen das es dann reinzufällig war^^

ich habs mir das script von dem typen jetz rausgesucht (nächstes mal bitte link)
und weiss nich warums vorher funktioniert hat ,du kanns das hier als neues script UNTER dem script von dem kerl einfügen, sollte das problem beheben
class Window_location < Window_Base
def refresh
    self.contents.clear
    $maps = load_data("Data/MapInfos.rvdata")
    @map_id = $game_map.map_id
    @currmap = $maps[@map_id].name
    @currmap = @currmap.gsub(/\[\w*\]/) {""}
    self.contents.font.color = system_color
    self.contents.draw_text(0, -4, 128, 32, "Location :")
    self.contents.font.color = normal_color
    self.contents.draw_text(0, -4+WLH, 128, 32, @currmap, 1)
  end
end
Titel: Re: Simple Map-Name
Beitrag von: Gaara am November 12, 2008, 09:47:36
So ich habs mal so probiert und es funktioniert teilweise.
Also der name un so wird korrekt angezeigt aber manchmal bekomm ich ne fehlermeldung wenn ich das ringmenü aufmachen will.

"Script 'Mapname' line 61: RGSSError occurred. disposed window"

Kannst du damit was anfangen? der fehler kommt auf jeder karte, wenn der name anzegeigt wurde oder gerade angezeigt wird.
Titel: Re: Simple Map-Name
Beitrag von: Onkel Hell am November 12, 2008, 10:51:13
hab nen kleinen bugfix gemacht,
zieh dir ma 1.24
sollte da funktionieren
Titel: Re: Simple Map-Name
Beitrag von: Gaara am November 12, 2008, 17:51:43
yo grandmaster es funktioniert jetzt tadellos, bin stolz auf dich =D
Titel: Re: Simple Map-Name
Beitrag von: Roiboschtee1904 am Juni 11, 2009, 14:00:16
Ich glaube ich bin zu doof um es einzubinden...also an sich klappt das Script, sodass der Mapname und ein Bild angezeigt wird, aber sobald es zu kämpfen kommt gibt es folgende Fehlermeldung: Script 'Cache' line 75: TypeError occurred. Cannot convert nil into String. :(
Grüße, Roiboschtee
Titel: Re: Simple Map-Name
Beitrag von: Master Chain am Januar 11, 2010, 20:37:20
Super Scrip Hell
Sieht besser aus als das von Mog Hounter.
Habs in mein Spiel eingebaut.
Titel: Re: Simple Map-Name
Beitrag von: Vizard am Januar 13, 2010, 12:56:33
ich persönlich finde auch dass es besser als das von moghunter aussieht, nicht so bunt und so.
mach weiter so gute scripts :D dein day and night 2 finde ich auch besser als das normale day and night :)
Titel: Re: Simple Map-Name
Beitrag von: Evil95 am Juli 27, 2011, 06:58:14
hey Onkel hell. mir ist ein fehler bei deinem script "Simple Map Name" aufgefallen. und zwar wenn man ein picture anzeigt was den kompletten bildschirm belegt wird sieht man beim mapname nur die weiße schrift aber nicht das hintergrundbild..sprich den rahmen.. danke schonmal im vorraus

EDIT: habs selbst hinbekommen..hier meine lösung:
nach@sprite.x = X_POSITION+5
@sprite.y = Y_POSITION+5
habe ich @sprite.z = 250eingefügt. jetzt klappt es wieder :)
ich denke mal da muss ein Script version 1.25 her...hier ein fertiges wo der fix schon drin ist:
#==============================================================================
#  Simple Map-Name
#
#  Version : 1.25 - 28.07.11
#  Created by : hellMinor (Bugfixed by Evil95)
#  Do NOT redistribute without my permission
#  Description : A little script to show the name of the current map
#  Note : This script was originally made to cut out the additions to
#         the mapname made by my Day and Night script but it works normally
#         without it.
#  Note 2: Wenn man Bilder auf der Map hatte die sich mit dem location_back-Picture
#  überlappen würden, wird location_back eine Ebene darunter angezeigt. Somit würde
#  man nur die Schrift sehen. Den Fehler habe ich mal behoben.
#
#==============================================================================
# F.A.Q.
#==============================================================================
# If you want a background picture for your mapnames just put a picture
# called "location_back" into the folder "Graphics/System"
#==============================================================================
# Main config
#==============================================================================
  X_POSITION = 10           # Default = 10
  Y_POSITION = 10           # Default = 10
  DELAY = 2                 # How long the Mapname is shown (in seconds)
  ALIGN = 0                 # Align of the Mapname(0 = left, 1 = center, 2 = right)
  PIC_FORMAT = "png"        # Format for the Nightlight-Maps
  COLOR = 255,255,255,255   # Textcolor, default is white (255,255,255,255)
  $show_mapname = true      # Visible ?
#==============================================================================
class Scene_Map
#==============================================================================
  def update_transfer_player
    return unless $game_player.transfer?
    fade = (Graphics.brightness > 0)
    fadeout(30) if fade
    @spriteset.dispose
    dispose_showname_window
    $game_player.perform_transfer
    $game_map.autoplay
    $game_map.update
    Graphics.wait(15)
    @spriteset = Spriteset_Map.new
    fadein(30) if fade
    Input.update
    create_showname_window
  end
#------------------------------------------------------------------------------
  def create_showname_window
    @str = $game_map.name.gsub(/\[\w*\]/) {""}
    @mapname = Window_MapName.new(X_POSITION,Y_POSITION,200,56,@str)
    @mapname.z = 300
    @delay = DELAY*60
  end
#------------------------------------------------------------------------------ 
  def dispose_showname_window
    @mapname.dispose if defined?(@mapname)
  end
#------------------------------------------------------------------------------
  alias update_mapname_adds update
  def update
    update_mapname_adds
    if $show_mapname == true and defined?(@mapname) and not @mapname.disposed?
      @mapname.fade_in if @mapname.contents_opacity <= 255 and @delay > 0
      @delay -= 1 if @mapname.contents_opacity == 255 and @delay > 0
      @mapname.fade_out if @mapname.contents_opacity >= 0 and @delay == 0
    end
  end
#------------------------------------------------------------------------------
  def update_scene_change
    return if $game_player.moving?    # Is player moving?
    dispose_showname_window if $game_temp.next_scene != nil
    case $game_temp.next_scene
    when "battle"
      call_battle
    when "shop"
      call_shop
    when "name"
      call_name
    when "menu"
      call_menu
    when "save"
      call_save
    when "debug"
      call_debug
    when "gameover"
      call_gameover
    when "title"
      call_title
    else
      $game_temp.next_scene = nil
    end
  end
 
end
#==============================================================================
class Window_MapName < Window_Base
#============================================================================== 
  def initialize(x = 0,y = 0,width = 544, height = 416, text = "")
    super(x,y,width,height)
    self.opacity = 0
    self.contents_opacity = 0
    @text = text
    refresh
  end
#------------------------------------------------------------------------------ 
  def refresh
    self.contents.clear
    @sprite = Sprite.new()
    begin
    @sprite.bitmap = Bitmap.new("Graphics/System/location_back")
    rescue Errno::ENOENT
    end
    @sprite.opacity = 0
    @sprite.x = X_POSITION+5
    @sprite.y = Y_POSITION+5
    @sprite.z = 250 #<---  Evil95's Fix
    self.contents.font.color = Color.new(COLOR[0],COLOR[1],COLOR[2],COLOR[3])
    self.contents.draw_text(4, 0, self.width - 40, WLH, @text, ALIGN)
  end
#------------------------------------------------------------------------------
  def dispose
    @sprite.dispose
    super
  end
#------------------------------------------------------------------------------
  def fade_in
    self.contents_opacity += 2
    @sprite.opacity += 2
  end
#------------------------------------------------------------------------------
  def fade_out
    self.contents_opacity -= 2
    @sprite.opacity -= 2
  end
#------------------------------------------------------------------------------   
end
#==============================================================================
class Scene_Title < Scene_Base
#==============================================================================
  alias load_database_mapname_adds load_database
  def load_database
    load_database_mapname_adds
    $data_mapinfos      = load_data("Data/MapInfos.rvdata")
    for key in $data_mapinfos.keys
      $data_mapinfos[key] = $data_mapinfos[key].name
    end
  end
 
end
#==============================================================================
class Game_Map
#============================================================================== 
  def name
    $data_mapinfos[@map_id]
  end
 
end
SimplePortal 2.3.3 © 2008-2010, SimplePortal