Dan Yami
Wall of Flesh
works perfectly fine for meMe too, the dev seems to not be working on it rn
works perfectly fine for meMe too, the dev seems to not be working on it rn
Yet Another Boss Health Bar
v1.2.1, for tModLoader v0.10.0.2
(This is not Boss Health Bars)
What's the difference between this and Boss Health Bars? Preference mostly. Barack Obama Ross' one has more customisation, whereas this one is more silly effects.
DISCLAIMER: I wrote this half asleep, so sorry for any half finished- sentences.
By default this mod supports single NPC bosses, and worm-type bosses. Since some vanilla and mod bosses have more complicated ways of determining damage throughout a fight, you may want to mod in your own specific behaviour:
Available on GitHub
Since 1.2 it's much easier to add quick support for this mod.
METHOD 1
Adding a boss bar for a single NPC (in this case, Zombies). Normally any single NPC boss with the boss flag set as true will be detected by this mod. Stick this in your Load() method, or somwhere similar that gets called at startup. You can add as many as you want (within reason).
For these standard health bars, the following preset styles are available via the first method:Code:public override void Load() { Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { yabhb.Call("RegisterHealthBar", NPCID.Zombie); yabhb.Call("RegisterHealthBar", NPCID.FemaleZombie); yabhb.Call("RegisterHealthBar", NPCID.SwampZombie); } }
RegisterHealthBar
RegisterDemonHealthBar
RegisterMechHealthBar
RegisterDD2HealthBar
Additionally, if you want a miniboss with a tiny health bar:
RegisterHealthBarMini
METHOD 2
However worms and other multi-NPC enemies are a different story. If your boss is using some form of multiple health bars, consider the following:
Like method 1, there are preset multi-npc bars available:Code:public override void Load() { Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { yabhb.Call("RegisterHealthBarMulti", NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail); } }
RegisterHealthBarMulti
RegisterDemonHealthBarMulti
RegisterMechHealthBarMulti
RegisterDD2HealthBarMulti
RegisterHealthBarMultiMini
METHOD 3 (Semi-advanced)
These are more complicated. Say you have some custom textures you want to use. Then the "RegisterCustomHealthBar" method call lets you define several settings, or leave them as null to use default behaviour. The format follows:
For a total of 20 parameters. If you are defining multiple NPCs with "RegisterCustomHealthBarMulti", replace the int NPCID with an int[], eg.Code:string "RegisterCustomHealthBar", int NPCID, // this one cannot be null bool? ForceSmall, string displayName, Texture2D fill, Texture2D left, Texture2D mid, Texture2D right, int midBarOffsetX, int midBarOffsetY, int fillDecoOffsetX, int bossHeadCentreOffsetX, int bossHeadCentreOffsetY, Texture2D fillSmall, Texture2D leftSmall, Texture2D midSmall, Texture2D rightSmall, int fillDecoOffsetXSM, int bossHeadCentreOffsetXSmall, int bossHeadCentreOffsetYSmall
Code:new int[] { NPCID.BrainofCthulhu, NPCID.Creeper }
So how does this work in practice? Say we want to make a health bar for a flying snake (because hey why not), giving it a custom health bar. The textures we have made prior are being stored as: UI/CustomBar*.png
Then it becomes a simple matter of inserting or 20 parameters:
Code:public override void Load() { Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { yabhb.Call("RegisterCustomHealthBar", NPCID.FlyingSnake, // This is the enemy we want to track health for false, // ForceSmall left as false "Murder Dragoram Snake", // We can set a custom display name too // The default bar textures GetTexture("UI/CustomBarFill"), GetTexture("UI/CustomBarLeft"), GetTexture("UI/CustomBarMiddle"), GetTexture("UI/CustomBarRight"), // Since I based the textures off the default, there is no // need to change any of the offsets. null, null, null, null, null, // Small textures. Note you don't have to add small textures, //or any textures at all - just leave these as null to use default GetTexture("UI/CustomBarFillSmall"), GetTexture("UI/CustomBarLeftSmall"), GetTexture("UI/CustomBarMiddleSmall"), GetTexture("UI/CustomBarRightSmall"), // Same deal with offsets null, null, null ); } }
⁽ᶦᵍⁿᵒʳᵉ ᵗʰᵉ ᶠᵃᶜᵗ ᵗʰᵃᵗ ᴵ ᵃᶜᶜᶦᵈᵉⁿᵗˡʸ ʳᵉᵖˡᵃᶜᵉᵈ ᵃˡˡ ʷʰᶦᵗᵉˢ ʷᶦᵗʰ ᵗʳᵃⁿˢᵖᵃʳᵉⁿᶜʸ⁾
METHOD 4 (Advanced)
If you want as much control over the health bar as possible without resorting to just importing this mod, the mod Call "RegisterCustomMethodHealthBar" and "RegisterCustomMethodHealthBarMulti" provide the most options, as most textures and settings are replaced with Func<> calls, allowing for things like expert mode only graphics. Again, use null to indicate where to let base code run instead.
For a total of 21 parameters. The last argument is the addition of a colour function to let you define how the bar's colour changes based on life and lifeMax. An example of how this is used in this mod itself is with the DD2 crystal, where no textures need changing, but the health bar colour behaviour does:Code:string "RegisterCustomHealthBar", int NPCID, // this one cannot be null bool? ForceSmall, Func<NPC, string> getBossDisplayNameNPC, Func<Texture2D> fill, Func<Texture2D> left, Func<Texture2D> mid, Func<Texture2D> right, int midBarOffsetX, int midBarOffsetY, int fillDecoOffsetX, int bossHeadCentreOffsetX, int bossHeadCentreOffsetY, Func<Texture2D> fillSmall, Func<Texture2D> leftSmall, Func<Texture2D> midSmall, Func<Texture2D> rightSmall, int fillDecoOffsetXSM, int bossHeadCentreOffsetXSmall, int bossHeadCentreOffsetYSmall, Func<NPC, int, int, Color> getHealthColour
And, like the previous method, the same rules apply with an int[]{int,int...} in place of a single int when using "RegisterCustomMethodHealthBarMulti".Code:public override void Load() { Func<NPC, int, int, Color> customColour = CustomHealthBarColour; Call("RegisterCustomMethodHealthBar", NPCID.DD2EterniaCrystal, true, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, customColour ); } private Color CustomHealthBarColour(NPC npc, int life, int lifeMax) { float percent = (float)life / lifeMax; float R = 1f, G = 1f; if (percent > 0.5f) { R = 1f - (percent - 0.5f) * 2; } else { G = 1f + ((percent - 0.5f) * 2f); } return new Color(R * 0.75f, G, R); }
Custom Health Bar Texture Rules
The following defines a set of rules as to what you can do and where with custom textured healthbars. For simplicity's sake just use the one's available from github as a template so you won't have to mess with offset values.
. . .
Download
via GitHub
or
via Mod Browser
(tModLoader 0.9 version)
Flashkirby99 - I am making this mod.
Several previous modders - The original idea and previous implementations
github repo
Does this work for the latest Mod Browser?Yet Another Boss Health Bar
v1.2.1, for tModLoader v0.10.0.2
(This is not Boss Health Bars)
What's the difference between this and Boss Health Bars? Preference mostly. Barack Obama Ross' one has more customisation, whereas this one is more silly effects.
DISCLAIMER: I wrote this half asleep, so sorry for any half finished- sentences.
By default this mod supports single NPC bosses, and worm-type bosses. Since some vanilla and mod bosses have more complicated ways of determining damage throughout a fight, you may want to mod in your own specific behaviour:
Available on GitHub
Since 1.2 it's much easier to add quick support for this mod.
METHOD 1
Adding a boss bar for a single NPC (in this case, Zombies). Normally any single NPC boss with the boss flag set as true will be detected by this mod. Stick this in your Load() method, or somwhere similar that gets called at startup. You can add as many as you want (within reason).
For these standard health bars, the following preset styles are available via the first method:Code:public override void Load() { Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { yabhb.Call("RegisterHealthBar", NPCID.Zombie); yabhb.Call("RegisterHealthBar", NPCID.FemaleZombie); yabhb.Call("RegisterHealthBar", NPCID.SwampZombie); } }
RegisterHealthBar
RegisterDemonHealthBar
RegisterMechHealthBar
RegisterDD2HealthBar
Additionally, if you want a miniboss with a tiny health bar:
RegisterHealthBarMini
METHOD 2
However worms and other multi-NPC enemies are a different story. If your boss is using some form of multiple health bars, consider the following:
Like method 1, there are preset multi-npc bars available:Code:public override void Load() { Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { yabhb.Call("RegisterHealthBarMulti", NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail); } }
RegisterHealthBarMulti
RegisterDemonHealthBarMulti
RegisterMechHealthBarMulti
RegisterDD2HealthBarMulti
RegisterHealthBarMultiMini
METHOD 3 (Semi-advanced)
These are more complicated. Say you have some custom textures you want to use. Then the "RegisterCustomHealthBar" method call lets you define several settings, or leave them as null to use default behaviour. The format follows:
For a total of 20 parameters. If you are defining multiple NPCs with "RegisterCustomHealthBarMulti", replace the int NPCID with an int[], eg.Code:string "RegisterCustomHealthBar", int NPCID, // this one cannot be null bool? ForceSmall, string displayName, Texture2D fill, Texture2D left, Texture2D mid, Texture2D right, int midBarOffsetX, int midBarOffsetY, int fillDecoOffsetX, int bossHeadCentreOffsetX, int bossHeadCentreOffsetY, Texture2D fillSmall, Texture2D leftSmall, Texture2D midSmall, Texture2D rightSmall, int fillDecoOffsetXSM, int bossHeadCentreOffsetXSmall, int bossHeadCentreOffsetYSmall
Code:new int[] { NPCID.BrainofCthulhu, NPCID.Creeper }
So how does this work in practice? Say we want to make a health bar for a flying snake (because hey why not), giving it a custom health bar. The textures we have made prior are being stored as: UI/CustomBar*.png
Then it becomes a simple matter of inserting or 20 parameters:
Code:public override void Load() { Mod yabhb = ModLoader.GetMod("FKBossHealthBar"); if (yabhb != null) { yabhb.Call("RegisterCustomHealthBar", NPCID.FlyingSnake, // This is the enemy we want to track health for false, // ForceSmall left as false "Murder Dragoram Snake", // We can set a custom display name too // The default bar textures GetTexture("UI/CustomBarFill"), GetTexture("UI/CustomBarLeft"), GetTexture("UI/CustomBarMiddle"), GetTexture("UI/CustomBarRight"), // Since I based the textures off the default, there is no // need to change any of the offsets. null, null, null, null, null, // Small textures. Note you don't have to add small textures, //or any textures at all - just leave these as null to use default GetTexture("UI/CustomBarFillSmall"), GetTexture("UI/CustomBarLeftSmall"), GetTexture("UI/CustomBarMiddleSmall"), GetTexture("UI/CustomBarRightSmall"), // Same deal with offsets null, null, null ); } }
⁽ᶦᵍⁿᵒʳᵉ ᵗʰᵉ ᶠᵃᶜᵗ ᵗʰᵃᵗ ᴵ ᵃᶜᶜᶦᵈᵉⁿᵗˡʸ ʳᵉᵖˡᵃᶜᵉᵈ ᵃˡˡ ʷʰᶦᵗᵉˢ ʷᶦᵗʰ ᵗʳᵃⁿˢᵖᵃʳᵉⁿᶜʸ⁾
METHOD 4 (Advanced)
If you want as much control over the health bar as possible without resorting to just importing this mod, the mod Call "RegisterCustomMethodHealthBar" and "RegisterCustomMethodHealthBarMulti" provide the most options, as most textures and settings are replaced with Func<> calls, allowing for things like expert mode only graphics. Again, use null to indicate where to let base code run instead.
For a total of 21 parameters. The last argument is the addition of a colour function to let you define how the bar's colour changes based on life and lifeMax. An example of how this is used in this mod itself is with the DD2 crystal, where no textures need changing, but the health bar colour behaviour does:Code:string "RegisterCustomHealthBar", int NPCID, // this one cannot be null bool? ForceSmall, Func<NPC, string> getBossDisplayNameNPC, Func<Texture2D> fill, Func<Texture2D> left, Func<Texture2D> mid, Func<Texture2D> right, int midBarOffsetX, int midBarOffsetY, int fillDecoOffsetX, int bossHeadCentreOffsetX, int bossHeadCentreOffsetY, Func<Texture2D> fillSmall, Func<Texture2D> leftSmall, Func<Texture2D> midSmall, Func<Texture2D> rightSmall, int fillDecoOffsetXSM, int bossHeadCentreOffsetXSmall, int bossHeadCentreOffsetYSmall, Func<NPC, int, int, Color> getHealthColour
And, like the previous method, the same rules apply with an int[]{int,int...} in place of a single int when using "RegisterCustomMethodHealthBarMulti".Code:public override void Load() { Func<NPC, int, int, Color> customColour = CustomHealthBarColour; Call("RegisterCustomMethodHealthBar", NPCID.DD2EterniaCrystal, true, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, customColour ); } private Color CustomHealthBarColour(NPC npc, int life, int lifeMax) { float percent = (float)life / lifeMax; float R = 1f, G = 1f; if (percent > 0.5f) { R = 1f - (percent - 0.5f) * 2; } else { G = 1f + ((percent - 0.5f) * 2f); } return new Color(R * 0.75f, G, R); }
Custom Health Bar Texture Rules
The following defines a set of rules as to what you can do and where with custom textured healthbars. For simplicity's sake just use the one's available from github as a template so you won't have to mess with offset values.
. . .
Download
via GitHub
or
via Mod Browser
(tModLoader 0.9 version)
Flashkirby99 - I am making this mod.
Several previous modders - The original idea and previous implementations
github repo
if you "mean" for tmodloader cough (version 10.0.2) cough the answer is yes.Does this work for the latest Mod Browser?
who is "he"?Hey Dude! I have installed the calamity mod and when I start a boss battle of the mod, he doesn't have a bar. Can you say me how I can put it to him a bar or if I have to have something on? Thanks !
Any boss from the calamity mod.who is "he"?
lots of em are female thoAny boss from the calamity mod.
Okay, so when I start a boss battle the health bar of the calimity's bosses it doesn't appear.lots of em are female tho
you didnt read the part on the first post of "adding your own boss support".So, this mod works only for vanilla bosses, is that what you guys saying?
No, i've seen this, but also i saw the posts about game crashes and etc, so i decide to ask first.you didnt read the part on the first post of "adding your own boss support".
Some modded bosses are not tagged as being bosses. In such a case, this mod doesn't pick it up and the mod creator will have to do it themselves.Okay, so when I start a boss battle the health bar of the calimity's bosses it doesn't appear.
Sorry for my bad English
Which mods are you running?I recently downloaded this mod, and every time a boss shows up, my game crashes. Could someone help?
For some reason all i see when i use this mod is a white bar. Not sure how to fix this.
I need to know how to reproduce this. Will probably need a mod list, and maybe platform too?? I've never come across this issue, does it still happen in the current version?
What do you mean by a "health bar for slimes?" Are you having a Slime Rain event on your world?is there a way to not have the health bar for slimes? its pretty annoying
What do you mean by a "health bar for slimes?" Are you having a Slime Rain event on your world?
Ah, I see what you mean. Yeah, that does sound like a bug. I haven't encountered it, so I didn't know it was a thing.I'm not that person, but the Slime Rain progression bar only works properly if I complete the event by killing all the slimes. If I kill a couple and go underground, the progression bar will persist until I log out. It's not always on the screen, but it pops back in frequently, I think whenever an appropriate slime is around. The progression doesn't count down if you kill new slimes, though. It's always say "67/75" or whatever. It's pretty annoying.