Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

> Display opponents HP
t5yvxc
post Apr 8 2012, 05:02 PM
Post #1


Level 9
Group Icon

Group: Revolutionary
Posts: 142
Type: Event Designer
RM Skill: Undisclosed




Is there a script out there that can display an opponents HP? I would like to add something like that to my game. I remember when I use to play old Final Fantasy games, how tedious and boring it felt to fight a boss you had no clue on how much progress your actually making. Especialy for example if lets say you die and the boss was only at 5% HP, considering you see no HP bar you wouldn't know that and I think that kind of aspect can discourage someone stuck on a boss. Its a a huge better feel IMO to see the enemies HP. Thanks in advance.


__________________________
Click here to find out your IQ
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies (1 - 6)
Night_Runner
post Apr 8 2012, 06:21 PM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,523
Type: Scripter
RM Skill: Undisclosed




I also found FF tedious and boring, so have a script

CODE
#==============================================================================
# ** VXAce: Night_Runner's Enemy HP Bars
#------------------------------------------------------------------------------
# History:
#  Date Created: 9/April/2012
#  Created for: t5yvxc
#   @> http://www.rpgrevolution.com/forums/index.php?showtopic=56134
#
# Description:
#  This script will show bars above the enemy, displaying their health.
#  The width is set by the width of the battler's graphic, and the colours
#  are taken from the colors used for the actor's hp bars in the pause menu.
#  (defined on lines 160, 161, & 162 of Window_Base)
#
# How to Install:
#  Copy this entire script. In your game's editor select Tools >>
#  Script Editor.
#  Along the left side scroll to the bottom, right click on 'Main Process'
#  and select 'Insert'.
#  Paste in the window on the right.
#==============================================================================



#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#  Edited to show a HP bar.
#==============================================================================

class Sprite_Battler
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Bitmap
  #--------------------------------------------------------------------------
  def update_bitmap
    new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
    if (@this_bitmap != new_bitmap) or (@last_hp != @battler.hp)
      # Store the bitmap & hp so we only have to redraw it when something
      # changes
      @this_bitmap = new_bitmap
      @last_hp = @battler.hp
      # Create a bitmap if you can
      self.bitmap.dispose unless self.bitmap.nil? or self.bitmap.disposed?
      self.bitmap = Bitmap.new(new_bitmap.width, new_bitmap.height + 32)
      # Create a temporary window, and get the HP colors from it
      temp_window = Window_Base.new(0, 0, 32, 32)
      c1 = temp_window.hp_gauge_color1
      c2 = temp_window.hp_gauge_color2
      bc = temp_window.gauge_back_color
          # Dispose the window so the player doesn't see it
      temp_window.dispose
      # Get the width of the battler
      b_width = new_bitmap.width
      # Fill in the background for the HP bar
      self.bitmap.fill_rect(0, 0, b_width, 6, bc)
      # Fill in the hp bar
      fill_w = b_width * @battler.hp / @battler.mhp
      self.bitmap.gradient_fill_rect(0, 0, fill_w, 6, c1, c2)
      # Draw the battler
      self.bitmap.blt(0, 32, new_bitmap, new_bitmap.rect)
      # Run the init_visibility command
      init_visibility
    end
  end
end



#==============================================================================
# ** End of Script.
#==============================================================================


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Laue
post Apr 9 2012, 01:49 AM
Post #3


Level 2
Group Icon

Group: Member
Posts: 26
Type: Developer
RM Skill: Intermediate




QUOTE (Night_Runner @ Apr 9 2012, 05:21 AM) *
I also found FF tedious and boring, so have a script "happy.gif

CODE
#==============================================================================
# ** VXAce: Night_Runner's Enemy HP Bars
#------------------------------------------------------------------------------
# History:
#  Date Created: 9/April/2012
#  Created for: t5yvxc
#   @> http://www.rpgrevolution.com/forums/index.php?showtopic=56134
#
# Description:
#  This script will show bars above the enemy, displaying their health.
#  The width is set by the width of the battler's graphic, and the colours
#  are taken from the colors used for the actor's hp bars in the pause menu.
#  (defined on lines 160, 161, & 162 of Window_Base)
#
# How to Install:
#  Copy this entire script. In your game's editor select Tools >>
#  Script Editor.
#  Along the left side scroll to the bottom, right click on 'Main Process'
#  and select 'Insert'.
#  Paste in the window on the right.
#==============================================================================



#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#  Edited to show a HP bar.
#==============================================================================

class Sprite_Battler
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Bitmap
  #--------------------------------------------------------------------------
  def update_bitmap
    new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
    if (@this_bitmap != new_bitmap) or (@last_hp != @battler.hp)
      # Store the bitmap & hp so we only have to redraw it when something
      # changes
      @this_bitmap = new_bitmap
      @last_hp = @battler.hp
      # Create a bitmap if you can
      self.bitmap.dispose unless self.bitmap.nil? or self.bitmap.disposed?
      self.bitmap = Bitmap.new(new_bitmap.width, new_bitmap.height + 32)
      # Create a temporary window, and get the HP colors from it
      temp_window = Window_Base.new(0, 0, 32, 32)
      c1 = temp_window.hp_gauge_color1
      c2 = temp_window.hp_gauge_color2
      bc = temp_window.gauge_back_color
          # Dispose the window so the player doesn't see it
      temp_window.dispose
      # Get the width of the battler
      b_width = new_bitmap.width
      # Fill in the background for the HP bar
      self.bitmap.fill_rect(0, 0, b_width, 6, bc)
      # Fill in the hp bar
      fill_w = b_width * @battler.hp / @battler.mhp
      self.bitmap.gradient_fill_rect(0, 0, fill_w, 6, c1, c2)
      # Draw the battler
      self.bitmap.blt(0, 32, new_bitmap, new_bitmap.rect)
      # Run the init_visibility command
      init_visibility
    end
  end
end



#==============================================================================
# ** End of Script.
#==============================================================================

Is there a way to merge it with Yanfly's show enemy hp bars? As in, this is shown in their hp bar?
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Apr 10 2012, 06:13 AM
Post #4


Level 50
Group Icon

Group: +Gold Member
Posts: 1,523
Type: Scripter
RM Skill: Undisclosed




Where can I find Yanfly's script?


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Laue
post Apr 10 2012, 10:22 AM
Post #5


Level 2
Group Icon

Group: Member
Posts: 26
Type: Developer
RM Skill: Intermediate




Here you go
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Apr 12 2012, 04:42 AM
Post #6


Level 50
Group Icon

Group: +Gold Member
Posts: 1,523
Type: Scripter
RM Skill: Undisclosed




Okey dokey, I think I understand the scripts happy.gif

What features of my script did you want ported over to Yanfly's script?


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
Laue
post Apr 12 2012, 06:49 AM
Post #7


Level 2
Group Icon

Group: Member
Posts: 26
Type: Developer
RM Skill: Intermediate




Oh my, my mistake. For some reason I thought your scripts shows enemy hp in numbers. And I wanted that in Yanfly's HP bars, maybe even tied to this.

My bad.

This post has been edited by Laue: Apr 12 2012, 06:49 AM
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 05:29 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker