Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Moshan on July 28, 2013, 03:41:06 pm

Title: Blizz-Abs Little Add-on
Post by: Moshan on July 28, 2013, 03:41:06 pm
 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 :
Spoiler: ShowHide
(http://img541.imageshack.us/img541/5964/nf1.png)

I would appreciate if someone could help me with this.
Title: Re: Blizz-Abs Little Add-on
Post by: KK20 on July 30, 2013, 12:31:18 am
*puts on checklist*
Title: Re: Blizz-Abs Little Add-on
Post by: Moshan on July 30, 2013, 03:39:33 am
 Thanks for helping! I think it might be useful for more people.
Title: Re: Blizz-Abs Little Add-on
Post by: KK20 on August 01, 2013, 02:36:46 pm
#==========================================================================
# 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
Title: Re: Blizz-Abs Little Add-on
Post by: Moshan on August 01, 2013, 03:52:26 pm
 Thank you very much! BUT...there's a little problem....the name dosen't display...Take a look at this pictures.
Spoiler: ShowHide
(http://img546.imageshack.us/img546/1415/y7gw.png)
Title: Re: Blizz-Abs Little Add-on
Post by: KK20 on August 01, 2013, 07:16:54 pm
Whose custom HUD are you using? I wrote this script in a clean Blizz-ABS project.
Title: Re: Blizz-Abs Little Add-on
Post by: Moshan on August 02, 2013, 04:11:51 am
 Z-HUD
Title: Re: Blizz-Abs Little Add-on
Post by: KK20 on August 02, 2013, 04:30:48 pm
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
Title: Re: Blizz-Abs Little Add-on
Post by: Moshan on August 03, 2013, 05:44:49 am
 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.
Title: Re: Blizz-Abs Little Add-on
Post by: 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
Title: Re: Blizz-Abs Little Add-on
Post by: Moshan on August 04, 2013, 05:56:30 am
 Thank you very much! You're the best!
Title: Re: Blizz-Abs Little Add-on
Post by: WhiteRose on August 04, 2013, 02:22:53 pm
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....
Title: Re: Blizz-Abs Little Add-on
Post by: KK20 on August 06, 2013, 09:17:37 pm
It's my go-to number whenever I work with z-values. :P
Title: Re: Blizz-Abs Little Add-on
Post by: Zexion on August 06, 2013, 10:14:32 pm
I don't get it... all I see is...
Spoiler: ShowHide
it's over 9000!!