Ventwig

VTS-Enemy HP Bars (With Boss Bars!)

89 posts in this topic

VTS-Enemy HP Bars - Version 2.02
By Ventwig
(VTS- Because everyone needs an obnoxious acronym to go along with them!)

Introduction
This adds HP/MP bars so you know what's going on with the enemies without having to keep guessing!

Features
-Display enemy battle info: hp, mp, and states
-Can display a longer "boss bar" for bosses
-Choose whether or not to show the current HP amount
-Hide HP or MP for certain enemies
-A dual boss bars feature for epic battles!
-Compatible with Neo Gauge Ultimate Ace and Yanfly Engine Ace
-Looking for more stuff to add! Suggestions would be APPRECIATED!

Screenshots

mR4twMf.pngJaEfHf2.pnguahQa1v.png



Neo Gauge Ultimate Ace
Plug and play gauges!
http://rmrk.net/inde...p?topic=45005.0
By Wortana originally(in VX), translated to Ace by Pacman

 

Wound Damage Patch

See my signature for the Wound Damage script

 

Enemy HP Bars and Wound Damage *Patch*

-Place Enemy HP Bars under Wound Damage 
-Place this patch under both scripts

 

# Enemy HP Bars and Wound Damage *Patch*
# Requires both scripts
# Both Scripts by Ventwig
 
class Window_Enemy_Hud < Window_Base
  if EHUD::NEO_ULTIMATE_ACE == false
   def draw_actor_hp(actor, x, y, width = 124)
    draw_hp_gauge(x, y, width, actor.hp_rate, actor.mhp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a) if EHUD::DRAW_HP_VOCAB == true
    change_color(hp_color(actor))
    draw_text(x+width/4*3, y, 100, line_height, actor.hp) if EHUD::DRAW_HP_NUMBERS == true
    change_color(system_color)
    end
    
    def draw_hp_gauge(x, y, width, rate, rate2, color1, color2)
      fill_w2 = (width * rate2).to_i
      fill_w = (width * rate).to_i
      gauge_y = y + line_height - 8
      contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
      contents.gradient_fill_rect(x, gauge_y, fill_w2, 6, text_color(VTS_WOUNDS::WOUND_COLOR1), text_color(VTS_WOUNDS::WOUND_COLOR2))
      contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
    end
  else
    def draw_actor_hp(actor, x, y, width = 124)
      gwidth = width * actor.hp_rate# / actor.omhp
      gwidth2 = width * actor.mhp_rate# / actor.omhp
      cg = neo_gauge_back_color
      c1, c2, c3 = cg[0], cg[1], cg[2]
      draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
        HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
        
      (1..3).each {|i| eval("c#{i} = WHP_GCOLOR_#{i}")}
      draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
        HPMP_GAUGE_Y_PLUS, gwidth2, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
        width, 30)
        
      (1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
      draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
        HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
        width, 30)
      change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a) if EHUD::DRAW_HP_VOCAB == true
       change_color(hp_color(actor))
    draw_text(x+width/4*3, y, 100, line_height, actor.hp) if EHUD::DRAW_HP_NUMBERS == true
       change_color(system_color)
    end
  end
end

 

How to Use
Copy into materials, but above main.
Check our the configuration and notetags!

Script
This has the newer features in it, but you are FORCED to use the hovering bars. There's no longer an option  to collect all the bars at the top.
http://pastebin.com/Av4S2fFF

FAQ
Q: Will you add <this> in?
A: I'll do my best to do so!

 
Q: Why isn't my boss bar showing?
A: Make sure the boss was the first enemy you put in the troop!
 
Credit and Thanks
-Usage rules are in the script as well as my signature
-Me, Ventiwg :)
-Thanks to everyone who helped my out!

Updates

Version 1 (Apr 8, 2012) - Release
Version 1.2 (Apr 9, 2012) - Boss HP bars!
Version 1.21 (Apr 9, 2012) - Hidden HP!
Version 1.2 (Apr 9, 2012) - Reverted back, hidden HP was buggy
Version 1.3 (Apr 12, 2012) - Fixed a horrible boss HP bug! Thanks Levi Stepp
Version 1.4 (Jul 29, 2012) - Added in HP drawing features with the help of Helladen and Ulises
Version 1.5 (Dec 17, 2012) - Added in MP bars, hiding options, and minion toggles.
Version 1.6 (Dec 20, 2012) - Added in hover features, added in states to boss HP, and added letter drawing, REMOVED ARROW!
Version 1.7 (May 24 2013) - Notetags!
Version 1.75 (Aug 13 2013) - Added in states and separated the script into two versions, one without the option to have all bars on top
Version 1.78 (Aug 16 2013) - Dual Boss bars
Version 1.8 (Aug 17 2013) - Major bugfixes
Version 2.0 (Jun 27 2014) - Rewrote the basis of the script to become much more efficient. Removed features I deemed "useless". If you want                                              them back, then let me know. Also, I was informed of a bug, so I fixed that in this overhaul.

Version 2.01 (Jul 01 2014) - Fixed bug that prevented use of script without NGUA

Version 2.02 (Jul 15 2014) - Removed option to draw both current and max hp (contact me if you want that back), cleaned out that section of                                                  the script, and added option to show the abbreviation "HP". Patch to be compatible with my "Wound Damage"                                                      script is included in this update.

Update Plans
-Boss bars to show bosses whose hp would take a whole row :)
-Showing enemy status via icons.
-Dual-boss battles (you know, those awesome things where theres two super cool enemies working in harmony? Like that, but with TWO GIANT hp bars!)
-Option to show MP
-Hide Info for enemies before they are "scanned"
-Any suggestions would be appreciated!

Edited by Ventwig
Wren and ShinGamix like this

Share this post


Link to post
Share on other sites

I can't seem to figure out how to get the Boss Guage to work without having other enemies on the field with it.

 

I.E: If I have a Boss on the field with 4 other enemies, It works.

 

But if I have just the Boss only, It won't work.

 

Is there a way you can make a note related script so I can add the Guage to the Enemies's Notes or something?

Because there is a part in my game where you 1 versus 1 someone.

and I don't want other enemies on the field just to make the Boss guage appear.

 

 

If I try battleing with just 1 enemy.

 

I get this error.

 

 

bosserror.jpg

 

 

Here is line 236 to 240

 

 

if @enemy1.enemy_id == @boss_enemy.enemy_id
  @boss_troop = true
else
  @boss_troop = false
end

 

 

Share this post


Link to post
Share on other sites

I can't seem to replicate your error.

I've tried battling the boss 4v1, and then 1v1, then changing the boss id to another number...

 

Are you sure you've configured it properly?

this is the code in the script (boss bar configuration)

  #Sets enemies to draw the boss gauges!
 BOSS_ENEMY = [] #Do not touch
 #BOSS_ENEMY[Enemyid for the boss] = true
 BOSS_ENEMY[1] = true 

 

All you have to do is change the number 1 to the id of your boss.

The enemy, not the troop.

The 1v1 works fine for me, so im not really sure what's going wrong...

 

Also, I'm trying to learn RegExp (Notetag thing), but i find it all confusing and making no sense =/

So I was kinda sticking to the configuration this code has.

 

I'll maybe try it some other time, but for now, I'm just gonna leave it with the in-code configuration.

Sorry 'bout that =/

Share this post


Link to post
Share on other sites

I can't seem to replicate your error.

I've tried battling the boss 4v1, and then 1v1, then changing the boss id to another number...

 

Are you sure you've configured it properly?

this is the code in the script (boss bar configuration)

  #Sets enemies to draw the boss gauges!
 BOSS_ENEMY = [] #Do not touch
 #BOSS_ENEMY[Enemyid for the boss] = true
 BOSS_ENEMY[1] = true 

 

All you have to do is change the number 1 to the id of your boss.

The enemy, not the troop.

The 1v1 works fine for me, so im not really sure what's going wrong...

 

Also, I'm trying to learn RegExp (Notetag thing), but i find it all confusing and making no sense =/

So I was kinda sticking to the configuration this code has.

 

I'll maybe try it some other time, but for now, I'm just gonna leave it with the in-code configuration.

Sorry 'bout that =/

 

Okay I got it to work for my Boss.

But now if I fight normal mobs I get the same error.

 

Do I need to copy and paste each troop (EDIT)that isn't a boss(EDIT) in the script like this?

 

BOSS_ENEMY[1] = false
BOSS_ENEMY[2] = false
BOSS_ENEMY[3] = false
[/Code]

and so on~

 

Edited by ItsKouta

Share this post


Link to post
Share on other sites

Oh, oops, i really should've checked that before i published this script XD

 

Well, that's my fault, sorry.

I recommend just commenting out the script with =begin and =end

as i try to fix that problem, thanks for pointing that out

 

EDIT: Got it :) It was actually a quick fix, let me know if you find any more bugs.

Edited by Anton

Share this post


Link to post
Share on other sites

btw can you make it like if I highlight an enemy the hp bar will appear above the enemy.

 

The hp bar will only appear if I highlight the enemy. Since I'm using side view battle, it can be confusing when all the enemy hp bar are above the screen without knowing which hp bar belong to which enemy

Share this post


Link to post
Share on other sites

Hmmm, I could try that, but that may be a little harder.

I'll try though.

 

And I was also planning on making the selected enemy's HP bar highlighted when you've got them selected, anyways :)

Share this post


Link to post
Share on other sites

Hi Ventwig! I love your script and i was wondering if its possible for a boss to have 2 hp bars i.e ( you defeat the boss it then transforms and it has a second set of hp)

Share this post


Link to post
Share on other sites

Hi Ventwig! I love your script and i was wondering if its possible for a boss to have 2 hp bars i.e ( you defeat the boss it then transforms and it has a second set of hp)

 

Hey there!

Thanks, but as of now, sorry, there's no real option.

 

I'm sorry, but i just dont really have a way to do that.

What you could do is that when the boss dies, you can start a new battle with that new boss, but i really didnt put any

multiple boss options or anything.

 

Also, ive made all my scripts on the RMVXA 30 day trial, and it kinda ran out...after 30 days :P

So im stuck without scripting unless i actually decide to buy it. Sorry :(

Share this post


Link to post
Share on other sites

Any way to shut off the actual HP text? I just want the bars but can't figure out what to comment out of your code

Edited by Dojoep

Share this post


Link to post
Share on other sites

Any way to shut off the actual HP text? I just want the bars but can't figure out what to comment out of your code

 

Well, I don't have RPGMaker on me, but this is possible...i think.

I'll try it. Just wondering, do you still want it to say the enemy's name/the word "HP" (or whatever the database abrv. is)?

This may take some trial and error though, with me sending you the untested script and you noting the problems :P

 

The problem is that you can't just comment out parts, seeing as i used the "draw hp" script, ill need to get it to draw the actual bar from scratch.

 

If you can get someone else to do this, too (you can request an edit, im fine with that) and get them to send me a copy to post here, im more than happy to accept that :)

I'll give them full credit too

Edited by Ventwig

Share this post


Link to post
Share on other sites

You can also define draw_actor_hp in the Window_Enemy_Hud instead of using the def inherited from Window_Base, like so:

 

class Window_Enemy_Hud < Window_Base
def draw_actor_hp(actor, x, y, width = 124)
 # Just the gauge
 draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
end
end

 

Example.

 

EDIT: And from scanning over the Neo Gauge script, you'd have to use this definition instead:

 

def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
end

Edited by #tag this

Share this post


Link to post
Share on other sites

Thanks a bunch #tag-this.

I'll add that in right away!

 

Edit:

the new, untested version is currently out!

(Sorry for the ugly spacing)

I dont have ace on me right now, so i cant test it or fix the spacing parts.

Could someone please help me brush that new part up?

I havent used RGSS3 in about 4 months now :P

 

Okay, thanks, once i get a note it's good, ill edit the main post

Edited by Ventwig

Share this post


Link to post
Share on other sites

It appears that you have the boolean check for HP text backwards.

 

This looks good though, thanks for making it.

Edited by Helladen

Share this post


Link to post
Share on other sites

Hello, the script works great, I even customize them for my own needs very easily, which is perfect :lol: But I would like to know if there is any way or how I can do to change the length of the bars, because HP is superimposed with numbers. Another question, but is not so important, with reference to the above, instead of increasing the length of the bar, reducing the text. Currently reads 100/100 for example, can it be changed to 100 and reduce the damage directly?

 

Greetings, Thanks :)

Share this post


Link to post
Share on other sites

It appears that you have the boolean check for HP text backwards.

 

This looks good though, thanks for making it.

 

Hm? Sorry, i forgot all of this stuff :P

What's boolean again? XD

 

Hello, the script works great, I even customize them for my own needs very easily, which is perfect :lol: But I would like to know if there is any way or how I can do to change the length of the bars, because HP is superimposed with numbers. Another question, but is not so important, with reference to the above, instead of increasing the length of the bar, reducing the text. Currently reads 100/100 for example, can it be changed to 100 and reduce the damage directly?

 

Greetings, Thanks :)

Hm, you mean that instead of saying: [HP_100/100]

you want it to just display the CURRENT HP, like [HP___100]?

Yeah, i was thinking of this, too. I'll try adding that in.

Like the last addition, though, it will require someone else to test it :P

I'll try that later today.

Share this post


Link to post
Share on other sites

Exactly, or some way to prevent the letters mixed with numbers, change the font size or something that can be done manually, without changing much the script.

If you would like to take this as a suggestion perfect, but I'm asking you if I can make such changes or I have to wait until you make them, and if they could do, tell me how.

 

Sorry if you do not understand, poor English.

 

Greetings from Argentina

Share this post


Link to post
Share on other sites

You could try the non-text bars if you want, but i might work on it :D

I'm not sure exactly how its done, but ill find it.

 

I need a way to see the original way to draw the hp.

Could someone please send me the part of window_base that defines draw_actor_hp? Thanks

 

If nobody knows how, jut go to script and go to the search all and type "def draw_actor_hp", look for the one under window_base.

Thanks :D

Share this post


Link to post
Share on other sites

Sorry, I don't know where to put the indentations

 

def draw_actor_hp(actor, x, y, width = 124)

# Just the gauge

draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)

end

else

def draw_actor_hp(actor, x, y, width = 124)

gwidth = width * actor.hp / actor.mhp

cg = neo_gauge_back_color

c1, c2, c3 = cg[0], cg[1], cg[2]

draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +

HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)

(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}

draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +

HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,

width, 30)

end

end

end

Share this post


Link to post
Share on other sites

 

You say in the comment to set it true to show HP text, but when it is true it doesn't show it. I would change it.

Edited by Helladen

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.