- Current Location:
- PureZC
- » PureZC Forums
- » Scripts
- » Boss Health Bar
Boss Health Bar
Overview
Creator:
Moosh
Added: 03 Feb 2018
Tags:
FFC
Downloads: 73
|
View Script
Download Example (1.11 MB) |
Information
Four FFC scripts for two types of health bars.
Description Setup Reviews Comments
Both types of health bars come in two scripts: one for single enemies and one for keeping track of health for a group of enemies. The first is a lot simpler only requiring some color constants be set to use. The second uses tiles and is a little more work to set up.
Features include:
Update 6/29/20: Fixed a compatibility bug with ghost.zh that caused enemies to have 1 HP remaining during death animations.
Features include:
- Boss names, either grabbed from the enemy or from a ZQuest string.
- Damage tracking
- Draining animations for each hit
- Vertical health bars like in Mega Man (these use the tiled version and are a bit weird to set up)
Update 6/29/20: Fixed a compatibility bug with ghost.zh that caused enemies to have 1 HP remaining during death animations.
There's a couple setting constants that can toggle features on the health bar off if you don't want them. These are:
Non-Tiled Health Bars:
Constants:
These scripts have a lot of nonessential constants you can tweak. I'll only list off the most important ones here:
This health bar is used for single enemies or multiple enemies where each has their own unique health bars. The arguments go as follows:
This health bar is used for groups of enemies that you want to share a single health pool for their health bar. It supports up to 6 different enemies in the pool, and allows for duplicates of the same enemy. The arguments go as follows:
Constants:
This one uses a lot more constants, and may be a bit more trial and error to use if you're not familiar with ZC's screen space:
Font Colors:
First the main health bar:
The arguments for the tiled health bars are the same as the normal ones, but I'll list them again for convenience.
HealthBar_Tiled_Single:
This health bar is used for single enemies or multiple enemies where each has their own unique health bars. The arguments go as follows:
D0: The enemy ID of the enemy on the screen to attach the health bar to.
D1: Which ZQuest string to use for the enemy's title. If 0, will use the enemy's editor name. If you don't want a name, you can set this to a blank string.
D2: If multiple enemies of the same ID are using the health bar script, this argument specifies which one of them to attach the health bar to.
D3: Set to 1 if you want the health bar to disappear shortly after the enemy dies. Otherwise, set it to 0 and it will hang around until you leave the screen.
HealthBar_Tiled_Group:
This health bar is used for groups of enemies that you want to share a single health pool for their health bar. It supports up to 6 different enemies in the pool, and allows for duplicates of the same enemy. The arguments go as follows:
D0-D5: The enemy IDs of the enemies to use to calculate health.
D6: Which ZQuest string to use for the enemy's title.
D7: Set to 1 if you want the health bar to disappear shortly after the enemy dies. Otherwise, set it to 0 and it will hang around until you leave the screen.
This script requires std.zh and (optional) ghost.zh. If you're not using ghost you can swap out the uncommented line in HealthBar_GetHP() function for the commented one below it.
- HEALTHBAR_DRAW_DAMAGE: Set to 0 to disable damage tracking.
- HEALTHBAR_DRAW_CHIP: Set to 0 to disable smooth draining animations as you take off health.
Non-Tiled Health Bars:
Constants:
These scripts have a lot of nonessential constants you can tweak. I'll only list off the most important ones here:
- C_HEALTHBAR_FONT: Color of the names and damage tracking numbers drawn above the health bars. Color constants have an 0x in front of them to indicate to the script that they're hexadecimal. The first digit afterwards (0-F) is the CSet and the second is the color.
- C_HEALTHBAR_FONTBG: Color of the outline for the font.
- C_HEALTHBAR_OUTLINE: Color for the outline of the health bar
- C_HEALTHBAR_BAR: Color of the health bar
- C_HEALTHBAR_DRAIN: Color of the draining portion of the health bar
- C_HEALTHBAR_BG: Color of the background of the health bar
This health bar is used for single enemies or multiple enemies where each has their own unique health bars. The arguments go as follows:
- D0: The enemy ID of the enemy on the screen to attach the health bar to.
- D1: Which ZQuest string to use for the enemy's title. If 0, will use the enemy's editor name. If you don't want a name, you can set this to a blank string.
- D2: If multiple enemies of the same ID are using the health bar script, this argument specifies which one of them to attach the health bar to.
- D3: Set to 1 if you want the health bar to disappear shortly after the enemy dies. Otherwise, set it to 0 and it will hang around until you leave the screen.
This health bar is used for groups of enemies that you want to share a single health pool for their health bar. It supports up to 6 different enemies in the pool, and allows for duplicates of the same enemy. The arguments go as follows:
- D0-D5: The enemy IDs of the enemies to use to calculate health.
- D6: Which ZQuest string to use for the enemy's title.
- D7: Set to 1 if you want the health bar to disappear shortly after the enemy dies. Otherwise, set it to 0 and it will hang around until you leave the screen.
Constants:
This one uses a lot more constants, and may be a bit more trial and error to use if you're not familiar with ZC's screen space:
Font Colors:
- C_HEALTHBAR_TILED_FONT: Color of the names and damage tracking numbers drawn above the health bars. Color constants have an 0x in front of them to indicate to the script that they're hexadecimal. The first digit afterwards (0-F) is the CSet and the second is the color.
- C_HEALTHBAR_TILED_FONTBG: Color of the outline for the font.
- HEALTHBAR_TILED_UNIQUEFIRSTLAST: Set to 1 if you want the health bar to use unique tile blocks for the first and last tile.
- HEALTHBAR_TILED_DRAWCAPS: Set to 1 if you want the health bar to draw cap tiles on either ends (these only have two states, full and empty and are mainly used in place of unique first and last for health bars where you want fancy end decorations.
- HEALTHBAR_TILED_VERTICAL: Set to 1 if you want the health bar to go vertically. This will disable name labels and damage tracking numbers.
- HEALTHBAR_TILED_X/HEALTHBAR_TILED_Y: X and Y position of the starting block. Remember that Y goes down instead of up in ZC.
- HEALTHBAR_TILED_NUM_BLOCKS: The number of tile blocks making up the health bar.
- HEALTHBAR_TILED_SPACING: The spacing between tile blocks. This can be negative to make your bar go backwards from the starting block, which you'll probably want to do for vertical bars. It can also be smaller if want for example a health bar made of 8x8 pixel blocks.
- HEALTHBAR_TILED_STATES: How many possible states each tile block can have. 17 would be exactly one state for every pixel of the tile across, including fully empty.
- CS_HEALTHBAR_TILED: The CSet the health bar is drawn in. Doesn't matter if yours is 8-bit like mine.
First the main health bar:
- TIL_HEALTHBAR_TILED_MAIN: The tile for the main tile block. Most of them will use this.
- TIL_HEALTHBAR_TILED_FIRST: The tile for the starting tile block.
- TIL_HEALTHBAR_TILED_LAST: The tile for the ending tile block.
- TIL_HEALTHBAR_TILED_FIRSTCAP: The tile for the start cap. (First of two tiles, one with the bar filled, one empty)
- TIL_HEALTHBAR_TILED_LASTCAP: The tile for the end cap.
- TIL_HEALTHBAR_TILED_DRAIN_MAIN: The tile for the main tile block. Most of them will use this.
- TIL_HEALTHBAR_TILED_DRAIN_FIRST: The tile for the starting tile block.
- TIL_HEALTHBAR_TILED_DRAIN_LAST: The tile for the ending tile block.
- TIL_HEALTHBAR_TILED_DRAIN_FIRSTCAP: The tile for the start cap. (First of two tiles, one with the bar filled, one empty)
- TIL_HEALTHBAR_TILED_DRAIN_LASTCAP: The tile for the end cap.
The arguments for the tiled health bars are the same as the normal ones, but I'll list them again for convenience.
HealthBar_Tiled_Single:
This health bar is used for single enemies or multiple enemies where each has their own unique health bars. The arguments go as follows:
D0: The enemy ID of the enemy on the screen to attach the health bar to.
D1: Which ZQuest string to use for the enemy's title. If 0, will use the enemy's editor name. If you don't want a name, you can set this to a blank string.
D2: If multiple enemies of the same ID are using the health bar script, this argument specifies which one of them to attach the health bar to.
D3: Set to 1 if you want the health bar to disappear shortly after the enemy dies. Otherwise, set it to 0 and it will hang around until you leave the screen.
HealthBar_Tiled_Group:
This health bar is used for groups of enemies that you want to share a single health pool for their health bar. It supports up to 6 different enemies in the pool, and allows for duplicates of the same enemy. The arguments go as follows:
D0-D5: The enemy IDs of the enemies to use to calculate health.
D6: Which ZQuest string to use for the enemy's title.
D7: Set to 1 if you want the health bar to disappear shortly after the enemy dies. Otherwise, set it to 0 and it will hang around until you leave the screen.
This script requires std.zh and (optional) ghost.zh. If you're not using ghost you can swap out the uncommented line in HealthBar_GetHP() function for the commented one below it.
No reviews found!
Eddy
Posted 30 April 2020 - 03:23 PM
So I noticed this script seems to work funky with Moldorms. The health bar works fine for the first segment, but when I kill it, the bar disappears. It looks like the health bar only considers the last segment of the Moldorm and not the rest of the enemy. Not sure if there's a workaround so that it can display the health bar for all segments combined or if they can display one at a time as you kill them?
There could also be the case where I just missed some obvious instruction somewhere But otherwise, I love this script!
There could also be the case where I just missed some obvious instruction somewhere But otherwise, I love this script!