[XP] Animated BlizzABS HUD (MOG) V0.9

Started by Subsonic_Noise, June 08, 2009, 04:09:46 pm

Previous topic - Next topic

Subsonic_Noise

June 08, 2009, 04:09:46 pm Last Edit: December 28, 2010, 07:37:11 pm by game_guy
Animated BlizzABS HUD (MOG)
Authors: Moghunter, Subsonic Noise, Blizzard
Version: 0.9
Type: BlizzABS HUD
Key Term: Blizz-ABS Plugin



Introduction
I edited the MOG HUD to assign a face for every animation sprite of BlizzABS, so your Hero looks angry when
he attacks etc.


Features
Own features:

  • 100% BlizzABS-compatible
  • Changes the face when the player is attacking, running, etc.
  • Easy to set up (or at least I hope so)


Planned features:

  • A way to animate when hit
  • Icon based states
  • Make it more compact + look better
  • Make the animation look smoother
  • Perhaps real animation (multiple frames eg. _atk1, _atk2, _atk3)
  • Perhaps party HUD



Screenshots
Spoiler: ShowHide

Spoiler: ShowHide



Demo
http://www.megaupload.com/?d=TJTGNL83
It's basically my game, Dystopia, with everything taken out except a few maps, the ABS and my script.
Needs the RTP. It uses my custom controls because the standard BlizzABS controls suck.
(No offense, Blizzard^^) As Dystopia is a german game, I had to change everything back to english very quick, so please excuse the bad spelling etc.
IMPORTANT: In this demo, only attacking is animated. You can, of course, have animated faces for every animation in BlizzABS.
Control: ShowHide

   UP = Arrow Up
   LEFT = Arrow Left
   DOWN = Arrow Down
   RIGHT = Arrow Right
   PREVPAGE = Page Up
   NEXTPAGE = Page Down
   CONFIRM = D
   CANCEL = S
   ATTACK = Space
   DEFEND = Left Shift
   SELECT = Tab
   HUD = C
   HOTKEY = X
   MINIMAP = Y
   RUN = Right Ctrl
   SNEAK = Right Shift
   JUMP = Q

Direct Hotkeying is enabled.


Script

Spoiler: ShowHide

#_______________________________________________________________________________
# MOG XAS Hud V2.2      
# ENHANCEMENT V0.5
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Enhanced with animated faces feature for BlizzABS by Subsonic_Noise
# http://www.google.de
#_______________________________________________________________________________
# My Enhancement just assigns faces to BlizzABS animation sprite, which means
# you can't have animations for actions which have animation sprites disabled
# You can define sprites that don't need a face at Window_Base.animated.
# I'll make an add. condition for _hit because BlizzABS doesn't use Hit Sprites.
#
# Thanks to:
# Blizzard for helping me with this script and not getting annoyed
# Aqua for telling me how to define variables^^ Yeah I'm a N00b.
#_______________________________________________________________________________


module XAS_HUD
   #Position of the HUD
   WINDOW_STATUS_X = 0  
   WINDOW_STATUS_Y = 370
   #ID of the switch that disables the HUD
   DISABLE_STATUS_HUD_SWITCH = 5
 end


$mogscript = {} if $mogscript == nil
$mogscript["XAS_Hud"] = true
###############
# Window_Base #
###############
class Window_Base < Window  

 def animated
#Exceptions can be defined here
   case $game_player.current_sprite[0, 4]
      when ''     then return '_fc'
      when '_idl' then return '_fc'
      when '_itm' then return '_fc'
   end
#returns the current sprite for the draw_face method
   return $game_player.current_sprite[0, 4]
end
 
def draw_maphp2(actor, x, y)
   actor = $game_party.actors[0]    
   self.contents.font.size = 20  
   back = RPG::Cache.picture("BAR_Meter")    
   cw = back.width  
   ch = back.height
   src_rect = Rect.new(0, 0, cw, ch)    
   self.contents.blt(x + 65, y - ch + 30, back, src_rect)  
   meter = RPG::Cache.picture("HP_Meter")    
   cw = meter.width  * actor.hp / actor.maxhp
   ch = meter.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
   text = RPG::Cache.picture("HP_Tx")    
   cw = text.width  
   ch = text.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x + 35, y - ch + 30, text, src_rect)
   self.contents.font.color = Color.new(0,0,0,255)
   self.contents.draw_text(x + 111, y - 1, 48, 32, actor.hp.to_s, 2)
   lowhp = actor.maxhp * 20 / 100
   avhp = actor.maxhp * 50 / 100
   if actor.hp <= lowhp
   self.contents.font.color = Color.new(255,55,55,255)
   elsif actor.hp <= avhp
   self.contents.font.color = Color.new(255,255,55,255)
   else
   self.contents.font.color = Color.new(255,255,255,255)
   end
   self.contents.draw_text(x + 110, y - 2, 48, 32, actor.hp.to_s, 2)    
end  
def draw_mapsp2(actor, x, y)  
   self.contents.font.size = 20  
   back = RPG::Cache.picture("BAR_Meter")    
   cw = back.width  
   ch = back.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x + 65, y - ch + 30, back, src_rect)  
   meter = RPG::Cache.picture("SP_Meter")    
   cw = meter.width  * actor.sp / actor.maxsp
   ch = meter.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
   text = RPG::Cache.picture("SP_Tx")    
   cw = text.width  
   ch = text.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x + 40, y - ch + 30, text, src_rect)
   self.contents.font.color = Color.new(0,0,0,255)
   self.contents.draw_text(x + 111, y - 1, 48, 32, actor.sp.to_s, 2)    
   self.contents.font.color = Color.new(250,255,255,255)
   self.contents.draw_text(x + 110, y - 2, 48, 32, actor.sp.to_s, 2)    
end
def draw_mexp(actor, x, y)
   self.contents.font.size = 16  
   actor = $game_party.actors[0]
   if actor.next_exp != 0
   rate = actor.now_exp.to_f / actor.next_exp
   else
   rate = 1
   end
   bitmap = RPG::Cache.picture("Exp_Meter")
   if actor.level < 99
   cw = bitmap.width * rate
   else
   cw = bitmap.width
   end  
   ch = bitmap.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x + 40 , y - ch + 30, bitmap, src_rect)
   bitmap2 = RPG::Cache.picture("Exp_Back")
   cw = bitmap2.width
   ch = bitmap2.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x + 40 , y - ch + 30, bitmap2, src_rect)
   self.contents.font.color = Color.new(0,0,0,255)
   self.contents.draw_text(x + 55, y + 1, 84, 32, "Exp",0)
   self.contents.font.color = Color.new(255,255,255,255)
   self.contents.draw_text(x + 54, y, 84, 32, "Exp",0)
end
def nada
face = RPG::Cache.picture("")
end  
def draw_heroface(actor,x,y)
   face = RPG::Cache.picture(actor.name + animated) rescue nada
   cw = face.width
   ch = face.height
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x , y - ch, face, src_rect)    
end  
def draw_actor_statemap(actor, x, y, width = 100)
   self.contents.font.size = 16    
   text = make_battler_state_text(actor, width, true)
   self.contents.font.color = Color.new(0,0,0,255)
   self.contents.draw_text(x + 1, y + 1, width, 32, text)
   self.contents.font.color = Color.new(250,255,255,255)
   self.contents.draw_text(x, y, width, 32, text)
end
def draw_actor_levelmap(actor, x, y)
   self.contents.font.size = 20    
   self.contents.font.color = Color.new(0,0,0,255)
   self.contents.draw_text(x, y, 32, 32, "Lv")
   self.contents.font.color = Color.new(50,255,250,255)    
   self.contents.draw_text(x + 1, y + 1, 32, 32, "Lv")
   self.contents.font.color = Color.new(0,0,0,255)
   self.contents.draw_text(x + 30, y, 24, 32, actor.level.to_s, 1)
   self.contents.font.color = Color.new(255,255,255,255)    
   self.contents.draw_text(x + 31, y + 1, 24, 32, actor.level.to_s, 1)    
end
end
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
   return @exp - @exp_list[@level]
end
def next_exp
   return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
   end
end
#####################
# Window_Status_Map #
#####################
class Window_HUD < Window_Base
def reset
   @old_hp = @actor.hp
   @old_sp = @actor.sp
   @old_level = @actor.level
   @old_state = @actor.states.to_s
   @old_exp = @actor.exp
   @old_face = $game_player.current_sprite[0, 4]
end
 
def initialize
   super(0, 0, 240, 120)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.windowskin = RPG::Cache.windowskin("")    
   self.contents.font.bold = true
   self.contents.font.name = "Georgia"
   self.opacity = 0
   @actor = $game_party.actors[0]
   if @actor != nil
   reset
   refresh
   end
 end  
 
def refresh
 self.contents.clear
   draw_maphp2(@actor, 35, 35)
   draw_mapsp2(@actor, - 40, 60)
   draw_heroface(@actor, 0, 70)
   draw_actor_statemap(@actor, 130, 60, 70)
   draw_actor_levelmap(@actor, 80, 10)  
   draw_mexp(@actor, 90, 10)
   reset
end
def update
  @actor = $game_party.actors[0]
  if @actor != nil  
  if @old_hp != @actor.hp or
     @old_sp != @actor.sp or
     @old_level != @actor.level or
     @old_state != @actor.states.to_s or
     @old_exp != @actor.exp or
     @old_face != $game_player.current_sprite[0, 4]
  refresh
  end
  end
end
end
###############
# Game_Player #
###############
class Game_Player2 < Game_Character
   attr_accessor :wref
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog11_main main
def main
   @sthero = Window_HUD.new
   @sthero.x = XAS_HUD::WINDOW_STATUS_X
   @sthero.y = XAS_HUD::WINDOW_STATUS_Y
   if $game_switches[XAS_HUD::DISABLE_STATUS_HUD_SWITCH] == false
   @sthero.visible = true  
   else
   @sthero.visible = false  
   end    
   mog11_main
   @sthero.dispose
end
alias mog11_update update
def update
   if $game_switches[XAS_HUD::DISABLE_STATUS_HUD_SWITCH] == false
   @sthero.visible = true  
   else
   @sthero.visible = false  
   end      
   @sthero.update
   mog11_update
end  
end  



Instructions
1. Download the demo
2. Copy the pictures in the pictures folder.
3. Copy the script in your game, below blizzABS.
4. Make a standard face for your hero(es). Name it (heroname)_fc . Faces should be 60x60 Pixel.
5. Make the animated faces and name them like the animation sprites, e.g. _run or _atk
6. Define the animation frames without an own face in the script.


Compatibility

Not tested with SDK. And I will not test it with SDK the next few years.
Compatible with all scripts I am using, I'll put them up here later.


Credits and Thanks


  • Moghunter for this wonderful HUD
  • Blizzard for BlizzABS and for helping me and not getting annoyed
  • Aqua, also for helping me
  • Subsonic_Noise for the "Animated" Addon.



Author's Notes
Have fun. Peace and Happiness.

Hellfire Dragon

That's pretty cool, good work.

Where did you get that tileset?

Subsonic_Noise

found it. somewhere.
I'll upload it later^^ I think it was Creation Asylium.

Thanks for the comment, but to clear that up, I only made the animated feature,
the HUD itself is by Moghunter. But I suppose you knew that so, Thanks + level up^^


Aqua

Looks good. :)

Make type "Blizz-ABS Hud" and fix the key term (There's a set list of them.  The one you used isn't on there) then it shoudl be DB-able

Hellfire Dragon

Got an erorr, missing BAR_Meter

You have default graphics for this?

Subsonic_Noise

WOW I totally forgot that >.> It needs the default graphics of the MOG HUD.
http://www.rmxp.org/forums/viewtopic.php?t=18933
Just past the graphics from the hud in you pictures folder.

@Aqua: Thanks! I fixed that, but by downloadable, do you mean a demo or the script?

Kagutsuchi

Awesome, I'm probably gonna ue this one for my game ^^

Aqua

I never said downloadable... o.o

DB = Database
DB-able = Able to go into the Database

Hellfire Dragon

Quote from: Subsonic_Noise on June 08, 2009, 05:00:04 pm
WOW I totally forgot that >.> It needs the default graphics of the MOG HUD.
http://www.rmxp.org/forums/viewtopic.php?t=18933
Just past the graphics from the hud in you pictures folder.

@Aqua: Thanks! I fixed that, but by downloadable, do you mean a demo or the script?


Quote from: RMXP.org
RMXP.ORG is temporarily offline!
Due to a hosting outage beyond our control we are currently moving RMXP.ORG to a temporary host. We expect to be online by Tuesday evening. Thank you for your continued support

- The management

Guess we'll have to wait

Subsonic_Noise

Quote from: Aqua on June 08, 2009, 05:46:23 pm
I never said downloadable... o.o

DB = Database
DB-able = Able to go into the Database

Oh OK. I guess it's DB-able now XD
Don't expect updates soon, I am working on it but I don't have Internet XP (I'm at school now...)

Aqua

I also suggest that you host the graphics yourself somewhere... lol
Oh and fix the typos... or I'll do that... XD

G_G

Um blizz this hasnt been moved yet either

ManiacClown

I love the mog graphics they are not "square" ...
The script is cool but would be nice if sow the party info to ...
Bye!

Subsonic_Noise

Alright I put a demo up, so please play it and give feedback, I'm bored.^^
The Demo also contains the tileset for HD.

G_G

Whats an 11 mb Graphics.exe doing in the folder? And whats it for O_o?

Subsonic_Noise

July 04, 2009, 12:16:42 pm #15 Last Edit: July 04, 2009, 12:27:09 pm by Subsonic_Noise
lol.
I have no idea. I'll delete it and reupload the demo.^^
EDIT: The new demo without a 11mb graphics.exe is up now. XD

Blizzard

It extracts the graphics from the RTP.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Subsonic_Noise


Blizzard

Because you don't need it. That file is usually located in the RTP installation folder.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Subsonic_Noise

Quote from: Blizzard on July 04, 2009, 12:30:55 pm
Because you don't need it. That file is usually located in the RTP installation folder.

lol.
How the fuck did it get there? XDDDD

Whatever did someone test the demo?

Rose Guardian

July 06, 2009, 02:07:54 pm #20 Last Edit: July 06, 2009, 02:08:55 pm by Rose Guardian
This is a good script but the attack button in the demo doesn't work for some reason.  I cannot attack.

Subsonic_Noise

Quote from: Rose Guardian on July 06, 2009, 02:07:54 pm
This is a good script but the attack button in the demo doesn't work for some reason.  I cannot attack.

You need to go to the shortcut menu, equip the ammo and press the hotkey. Your Weapon is a gun.^^

Futendra

Sorry for the necro post but I am wondering if anyone can re-upload the Demo? Since megaupload is taken down, the files are no longer available?

MarkHest

Necropost because I'm curious how this works. Anyone got a backup to the files to the health bars? Or have their own version of it so I know what dimensions are used to create the health bar.
I need the pixel height+width so I can create the bars and test it. I can't read the script either so I don't know where to find the dimensions.

Need some help.
   

KK20

December 31, 2013, 07:14:25 pm #24 Last Edit: December 31, 2013, 07:16:16 pm by KK20
Nothing in the code says anything about files being a specific length or width. You just need to make sure your picture file names fit those in the code (which you can see by CTRL + F for Cache.picture).

You can probably use the same images from that thread you also posted in.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Sin86

Again, I apologize for necro posting an old thread but anyone still have the images used for this hud that are required? The links are all dead including the demo link, which was from a site that got shut down years ago.