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
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 = 250
eingefü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