Enemy HP Bars

Last Updated: 2012.02.10
Download Link
Github Link

This script shows HP gauges on enemies as they’re selected for targeting or whenever they’re damaged. The HP gauges will actually slide downward or upward as the enemies take damage.

Included in v1.01 is the option to require the player having slain an enemy once before enemies of that type will show their HP gauge.

Change the colours that the gauges appear for different enemies. You can even hide the gauges for enemies with hidden HP values.

<back gauge: x>

Changes the colour of the enemy HP back gauge to x where x is the text colour used from the “Window” skin image under Graphics\System.

<hp gauge 1: x>
<hp gauge 2: x>

Changes the colour of the enemy HP HP gauge to x where x is the text colour used from the “Window” skin image under Graphics\System.

<hide gauge>
<show gauge>

Hides/shows HP gauge for enemies in battle. These gauges appear whenever the enemy is targeted for battle or whenever the enemy takes HP damage. Note that using the <show gauge> tag will bypass the requirement for needing to defeat an enemy once if that setting is enabled.

And that’s all, folks!

79 comments on “Enemy HP Bars

    • I think there may be a bug in terms of when you have an enemy transform mid-battle. like say you’ve set it to be transformed to another form when the first form loses all health. instead of the bar regenerating for the new enemy, the bar stays put at the empty stage while the new opponent has full health

  1. Hi! I have a problem with the script, as the HP gauge shows up, but it doesn’t decrease as enemies lose HP. I have no non-yanfly scripts installed and it still happens. Do you know what may cause this issue? Thanks in advance.

  2. Yanfly, im sure u heard modifying RGSS300.dll for more bigger scene(1024×768).
    After i had changed use other RGSS300, your “enemy HP bar” scripts dint working…. any idea instead using RGSS300 for changing gameplay scene?
    thx~

    • I don’t think Yanfly will help you here… modification to the original engine is against the terms of service. ( so what you did is actually illegal). I don’t fault you… the limited options to a screen resolution. FF6 had 800 x 600 I believe which was about the end of the sprite era. the only reason i can think of why the developer limited the resolution to just 640 x 480 is so the RTP backgrounds and titles didn’t leave black borders(even though this is achieved with 640 x 480 resolution anyway). if Will find a way to fix this with this hacked DLL, I will ask yanfly if its ok with him and give you the new code. unless he beats me to it…

      • OK… after doing some test with the DLL I discovered that it actually cripples RPG makers functionality altogether so nothing you do in this script will get it to work correctly. the only way your going to get it to work is somehow hack into the DLL again and fix it the issues. Another interesting Issue is that Parallaxes stop altogether…. they don’t display. Editing the DLL is probably the only way to get past the Resolution. Any code you write to change it will be automatically , stopped, readjusted or overwritten by the DLL’s internal code for safety reason’s (the parallax issue).

      • Hi, I’m getting the same bug as Protractor, I’ve tried pasting the core battle engine and hit point gauge addon to a new clean project, with the same results.

        If I make a troop with X enemies, and set any of these to the “appear half way” state (invisible), and then fire up a battle (test or ingame) and select a skill that hits all enemies (or 2 random or anything more than one) then the hit point bars pop up for -all- enemies in the troop.

        If you need me to I can give you a link (dropbox) to a clean project with only the core battle engine and hp scripts in it. I’ve only changed two things :
        1: made the basic attack into a “hit all enemies” skill.
        2: added 2 extra slimes to the default Troop1, and set them to “appear half way”.

        Cheers!

  3. No problem!

    I actually still had the problem even after updating (not sure if anyone else is) but I was able to fix it by inserting:

    “return false if @battler.enemy? && @battler.hidden” in “def gauge_visible? “

    • DOH!, should have read one comment down, which line did you change? (scripting n00b here) I cant seem to locate it?

      • hmm, found it (I think), but I still get the healthbars on the “appear halfway” tagged monsters. strange.

      • arggh, no no I dont, Just me being a real ass and -not- saving after editing the script. Sorry all, I’ll go away now *hangs head in shame*

      • To answer this question for future readers…
        At Line 456, under the definition:
        def gauge_visible?

        You will want to put at the top, the whole code will look like this (starting at line 443):
        #————————————————————————–
        # update_visible
        #————————————————————————–
        def gauge_visible?
        update_original_hide
        return false if @original_hide
        return false if case_original_hide?
        return true if @visible_counter > 0
        return true if @gauge_width != @target_gauge_width
        if SceneManager.scene_is?(Scene_Battle)
        return false if SceneManager.scene.enemy_window.nil?
        unless @battler.dead?
        if SceneManager.scene.enemy_window.active
        return false if @battler.enemy? && @battler.hidden
        return true if SceneManager.scene.enemy_window.enemy == @battler
        return true if SceneManager.scene.enemy_window.select_all?
        return true if highlight_aoe?

        end
        end
        end
        return false
        end

  4. Hey! i put the code above “main”, but nothing happens! the game is exactly the same after and before i put the code! please help me i dont know what happen!

  5. I’m having an issue with the hp bars.
    In a boss battle I’ve set enemies to appear halfway in the troop.
    Everytime I select a skill that target’s all enemies the hp bars of the hidden enemies appear too.
    That ruins the surprise of reinforcements. ;-)
    Is there a way to fix that?

  6. This is a good script… but in my game, I want the player to guess the HP of enemies… let them get busy… sometimes it is good, not to spoil players :)

    however, this is among the best script available, in my opinion…

  7. Interested in knowing whether or not it would be possible to view the hp bars with an event instead of enemy death. IE my main character has a skill called “Be more observant” that let’s him find things out of battle. It would be interesting if using it in battle caused these health bars to appear. Still pretty new with all this so help would be great

  8. Does this script include the Faces for battlers at bottom part? I’ve been looking all over this site for that script and I can’t tell what it is or what its called.

  9. Would it be possible for you to recreate/modify this so it can be used without the use of the core engine?

  10. When very small amounts of damage (one digit) are dealt to an enemy with around 2k HP, graphical glitches occur with the HP bars, including displaying an empty HP bar, displaying the HP bar without a background and not showing any HP bar at all. They seem to occur at random, although not showing any bar at all seems to happen most often.

  11. When I damage an opponent, it says
    “Unable to fin file:
    Grafik/System/hp_dmg”
    How should that pic look like?

    • Unless you changed the script’s code it shouldn’t ask for this file. Are you sure the problem is in the HP Bars script? Also, try installing the Battle Engine if you haven’t done so yet.

  12. It doesn’t work for me. I put the script where it should be, but when I run the game everything is like before… there is no bar for the enemies.

  13. Hmmm Is it possible to have the HP Bar to have fixed location on the screen? I want to use this work like a boss HP Bar that will display Boss HP at the top of the screen reguardless where the boss is at…

    • thats kind of easy…
      heres how i would do it
      1. Determine if the enemy is a boss using a note tag.
      2. make an “if” block, if the above is true then the hp bar will draw on the top of the screen instead of wherever.
      3. test and debug.

  14. I haven’t found it yet, however, i would like bosses to have a bigger health bar than normal monsters.
    If it could be implemented just like the color change, that would be nice.
    Or i just haven’t found the correct syntax (by trying).

    However, awesome job.

    • Okay, it works now, i took silverknightarcher119’s edited script and edited it a little further to suit my preferences. :D

      • DrGurk, could you tell me how you edited the script to give bosses a larger health bar? Also, I haven’t quite figured out how to put the boss health bars at the top. :(

      • you need to edit the params for the bar size for boss mode there in the module called BOSS_GUAGE_WIDTH and BOSS_GAUGE_HEIGHT, to change the color is pretty darn simple actually (you can hard code it in)where you see Color for when you bar is drawn add an (i beleive its line 451 and line 452) color.new(39,54,25,34) instead of “Color1” or whatever.

  15. I understand that much, I just can’t seem to find out how to implement the “boss” tag. It does go into the notebox, right? If so, what do I type in? I’m using silverknightarcher119’s edited script, if that helps.

    P.S. I did manage to get the boss health bar to work by setting line 180 to “true”. But this made everything a boss, which is undesirable. I’m looking into it, so if I get it working, I’ll post again. Otherwise, I still need help.

    • hint: I am SilverKnightarcher119
      note tags should be explained in there, here’s basically how the notetags work,
      when the enemy or class is loaded/created it checks the battler for a string, if the string exist in this case you enemy is marked as “boss” shown with the var on line 180(don’t change it!)

      on your enemy database page you will see a notetag box
      but this in the box “” without the quotes. I’m sorry i forgot to add it to the notetags definitions on the script instruction .

      good luck :)

      • sorry stupid BBC code the note tag is boss with the arrows encapsulating it like the other notetags

  16. Thanks a lot, if not for you, I’d still be typing into the notebox. Finally got it working(I used “”, “”, “”, “”, and “”into the notebox before I finally typed in “”.

    Thanks!

  17. I don’t know why it didn’t show up, but In those quotes, there were all the other notes I tried before I got the right one.

  18. Hello, I have a little request, can you add an MP and TP bar too for the enemies, because I need it for my RPG and can’t figure out how to do it.
    I tried it myself, but I allways have only the MP gauge then, I simply tried to rewrite your script, but that didn’t worked. Can you please help? (\s/)

  19. Hi I am new to implementing custom scripts into RPG Maker. I downloaded this script and everything works except the HP Bars. They do not appear at all. Can Anyone explain why this is and how I can fix it?

    Thanks for the help in advance.

  20. Hey Yanfly I have suggestion for you, could you by any chance make the HP bars show the exact HP of the enemy? For example, show that the slime enemy has 100 HP.

  21. Hey there this is an amazing script I was wondering if there would be anyway that a key item would activate the ability of being able to see the enemy’s health by using a script call or something.

  22. I have taken interest in this amazing script, But for some reason, It doesn’t show up. No error messages on my screen when play testing, And I have done on every monster. Dosen’t work. Any ideas why it doesn’t work? I use the Github, By the way.

  23. found the issue with the version of the script that’s up;
    if you turn the ANIMATE_HP_GAUGE to false the HP bars will show.
    I think it has to do with the line
    @sprite.ox += 4 if YEA::BATTLE::ANIMATE_HP_GAUGE #line 347
    if you put a p(“This is running”) there it will run constantly… so basically making
    @sprite.ox = infinity,
    also @visible_counter -= 1 might be a problem too but it doesn’t cause an error.

  24. I’m using Battle Symphony to spice up my battles, but the HP bars don’t appear anymore. Went through all the options, they should show by default, but nothing has changed.
    Any workarounds, should I use a different battle script?

  25. If you’re here and trying to figure out why the bars won’t show, DDM pointed it out back in Jan.

    1. Change Line “ANIMATE_HP_GAUGE” line to “false”
    2. Profit

  26. I’m so confused with the color, can some explain it more

    im changing the x but the colors are not changing…

  27. Does this work with the sapphire action system iv (sas iv)?
    If not, anyone knows of a enemy hp bars script that does work with it?

    <3

  28. for me, this script does not work, I see in the manual, in the script, in movies on yt but nothing. does not show stripes. Help.

Leave a comment