Hello!
I've tried to make some changes in the Blizz-Abs Script to display the map name above the Blizz-Abs Minimap...but I failed. I'm thinking of a script that allows me to see the map name only when the player choose that the minimap is displayed. I've put a picture to make me more easy to understand :
(http://img541.imageshack.us/img541/5964/nf1.png)
I would appreciate if someone could help me with this.
*puts on checklist*
Thanks for helping! I think it might be useful for more people.
#==========================================================================
# Minimap w/ Map Name (Blizz-ABS)
# By KK20
#--------------------------------------------------------------------------
# Draws map name above the minimap. Place below Blizz-ABS.
#==========================================================================
$mapinfos = load_data("Data/MapInfos.rxdata")
class Minimap < Sprite
alias init_map_name initialize
def initialize
@map_name = Sprite.new
@map_name.bitmap = Bitmap.new(160, 24)
@map_name.x, @map_name.y = 476, 332
@map_name.z = 9001
@init_name = true
init_map_name
end
alias update_map_name update
def update(override = false)
if @init_name or @map_id != $game_map.map_id
@init_name = false
@map_name.bitmap.font.size = 18
@map_name.bitmap.fill_rect(0,0,160,32,Color.new(0,0,0,170))
@map_name.bitmap.draw_text(0, 2, 160, 20, $mapinfos[$game_map.map_id].name, 1)
end
if $game_system.minimap >= 2
@map_name.visible = false
else
@map_name.visible = true
end
@map_name.update
update_map_name
end
def vy
if ($game_system.minimap < 2)
return super - 24
else
return super
end
end
alias set_map_name_opacity opacity=
def opacity=(amt)
@map_name.opacity = amt
set_map_name_opacity(amt)
end
alias show_map_name visible=
def visible=(expr)
@map_name.visible = expr
show_map_name(expr)
end
alias dispose_map_name dispose
def dispose
@map_name.dispose
dispose_map_name
end
end
Thank you very much! BUT...there's a little problem....the name dosen't display...Take a look at this pictures.
(http://img546.imageshack.us/img546/1415/y7gw.png)
Whose custom HUD are you using? I wrote this script in a clean Blizz-ABS project.
Z-HUD
Same script as I posted but with a modified method from Z-HUD added at the bottom. Thus, place this below Z-HUD.
#==========================================================================
# Minimap w/ Map Name (Blizz-ABS)
# By KK20
#--------------------------------------------------------------------------
# Draws map name above the minimap. Place below Blizz-ABS.
#==========================================================================
$mapinfos = load_data("Data/MapInfos.rxdata")
class Minimap < Sprite
alias init_map_name initialize
def initialize
@map_name = Sprite.new
@map_name.bitmap = Bitmap.new(160, 24)
@map_name.x, @map_name.y = 476, 332
@map_name.z = 9001
@init_name = true
init_map_name
end
alias update_map_name update
def update(override = false)
if @init_name or @map_id != $game_map.map_id
@init_name = false
@map_name.bitmap.font.size = 18
@map_name.bitmap.fill_rect(0,0,160,32,Color.new(0,0,0,170))
@map_name.bitmap.draw_text(0, 2, 160, 20, $mapinfos[$game_map.map_id].name, 1)
end
if $game_system.minimap >= 2
@map_name.visible = false
else
@map_name.visible = true
end
@map_name.update
update_map_name
end
def vy
if ($game_system.minimap < 2)
return super - 24
else
return super
end
end
alias set_map_name_opacity opacity=
def opacity=(amt)
@map_name.opacity = amt
set_map_name_opacity(amt)
end
alias show_map_name visible=
def visible=(expr)
@map_name.visible = expr
show_map_name(expr)
end
alias dispose_map_name dispose
def dispose
@map_name.dispose
dispose_map_name
end
#------------------------------------------------------------------------
# Z-HUD Fix
#------------------------------------------------------------------------
def update_minimap_back
if $game_system.minimap == 1
if @minimap_back == nil
@minimap_back = Sprite.new
@minimap_back.bitmap = RPG::Cache.picture(BlizzCFG::Z_MINIMAP_BACK)
@minimap_back.x = self.vx - (@minimap_back.bitmap.width - self.vw) / 2
@minimap_back.y = (self.vy+24) - (@minimap_back.bitmap.height - self.vh) / 2
@minimap_back.z = self.z + 1
@minimap_back.opacity = self.opacity
end
elsif @minimap_back != nil
@minimap_back.dispose
@minimap_back = nil
end
end
end
Thank you very much! It works...but it has a minor issue...When I try to acces the menu (Blizz-Abs pre-menu) the map name dissapears and it wont show until I recall the map again.
It was a z-value issue. Needs just one line added
alias init_map_name initialize
def initialize
@map_name = Sprite.new
@map_name.bitmap = Bitmap.new(160, 24)
@map_name.x, @map_name.y = 476, 332
@map_name.z = 9001 #<=== ADD THIS LINE
@init_name = true
init_map_name
end
Thank you very much! You're the best!
Quote from: KK20 on August 03, 2013, 05:32:17 pm
It was a z-value issue. Needs just one line added
alias init_map_name initialize
def initialize
@map_name = Sprite.new
@map_name.bitmap = Bitmap.new(160, 24)
@map_name.x, @map_name.y = 476, 332
@map_name.z = 9001 #<=== ADD THIS LINE
@init_name = true
init_map_name
end
Hahaha. I see what you did there....
It's my go-to number whenever I work with z-values. :P
I don't get it... all I see is...