Hinting enemy health with name color

Greetings, I was wondering if it's possible to change the enemy name font color according to its remaining HP (like changing it from white to yellow, to orange), like in Octopath Traveler or Dragon Quest XI. I mainly use Yanfly plugins for the battle UI. Do you know any plugin that could help me with this?

Thanks in advance.
Yanfly Core Engine plugin has some parameters that changes HP color font depending how much HP enemy has, but it is very simple.
I didn't play either of games you mentioned, but you can give it a try for YEP_CoreEngine plugin, and here the params you edit.
https://prnt.sc/pwuw00
Yanfly Core Engine plugin has some parameters that changes HP color font depending how much HP enemy has, but it is very simple.
I didn't play either of games you mentioned, but you can give it a try for YEP_CoreEngine plugin, and here the params you edit.
https://prnt.sc/pwuw00
I tried this and unfortunately it only applies to the actors, the enemy's name doesn't change its color when its HP gets reduced.
@LordScribble Is there a specific plugin that you use that displays the name of the enemy? That is not a feature that is in RPG Maker by default.
@LordScribble Is there a specific plugin that you use that displays the name of the enemy? That is not a feature that is in RPG Maker by default.
All the plugins I used to modify the battles are from yanfly, so it must be Yanfly Core Engine or Yanfly Battle Engine Core.
@LordScribble Ok, so you want to be able to change the font color on the enemy selection window where the enemy name is displayed? I can tinker around with some add-on code to do that.
@LordScribble Ok, so you want to be able to change the font color on the enemy selection window where the enemy name is displayed? I can tinker around with some add-on code to do that.
Thanks for wanting to help, I think its a good way to show players how the battle is going on, especially against bosses with higher health.
@LordScribble Here is a super-quick edit of Battle Engine Core with the font color applied to the 'Enemy Select' > 'Show Select Box' option, at the moment. Right now the plugin will use the 'critical' color once the enemy is below fifty percent health. Unfortunately, I have to step away from the computer for a bit. But, if this is kind of what you are after, I will finish up later on and add in more configuration options for the trigger HP and color used.
@LordScribble Here is a super-quick edit of Battle Engine Core with the font color applied to the 'Enemy Select' > 'Show Select Box' option, at the moment. Right now the plugin will use the 'critical' color once the enemy is below fifty percent health. Unfortunately, I have to step away from the computer for a bit. But, if this is kind of what you are after, I will finish up later on and add in more configuration options for the trigger HP and color used.
Yes, that's it, thank you very much!
@LordScribble Here, give this addon plugin a try : Addon for YEP_BattleEngineCore

Replace the modified YEP_BattleEngineCore plugin I uploaded in the previous post with a fresh copy and include the addon plugin to your project beneath YEP_BattleEngineCore.

Using the 'Enemy Font Color' option in the addon plugin configuration, you can add as many color triggers as you want. A color trigger uses a simple snippet of javascript which is evaluated whenever the enemy selection boxes are visible. Keep in mind that the snippet of code will need to return a true or false value in order to activate the color. The plugin will start at the top of the color list and test each trigger. If a trigger is activated, the remainder of the list is skipped. If no trigger is activated, then the font color reverts to the default.



So, for example, if you wanted a different color to be used whenever an enemy is at half health, you would use the following code :

Code:
// The variable 'b' contains enemy Battler data

// If '_hp' (Current HP) is less than 'mhp' (Max HP) divided by two
b._hp < b.mhp / 2

You could also set a certain color for when a certain state is applied :

Code:
// If state #21 is applied on the enemy
b.isStateAffected(21)

If you want a color to always be active (useful for the last entry on the list), you can simply put 'true' in the trigger.
@LordScribble Here, give this addon plugin a try : Addon for YEP_BattleEngineCore

Replace the modified YEP_BattleEngineCore plugin I uploaded in the previous post with a fresh copy and include the addon plugin to your project beneath YEP_BattleEngineCore.

Using the 'Enemy Font Color' option in the addon plugin configuration, you can add as many color triggers as you want. A color trigger uses a simple snippet of javascript which is evaluated whenever the enemy selection boxes are visible. Keep in mind that the snippet of code will need to return a true or false value in order to activate the color. The plugin will start at the top of the color list and test each trigger. If a trigger is activated, the remainder of the list is skipped. If no trigger is activated, then the font color reverts to the default.



So, for example, if you wanted a different color to be used whenever an enemy is at half health, you would use the following code :

Code:
// The variable 'b' contains enemy Battler data

// If '_hp' (Current HP) is less than 'mhp' (Max HP) divided by two
b._hp < b.mhp / 2

You could also set a certain color for when a certain state is applied :

Code:
// If state #21 is applied on the enemy
b.isStateAffected(21)

If you want a color to always be active (useful for the last entry on the list), you can simply put 'true' in the trigger.
Thanks, I've been trying but it still uses only the yellow from your first edit to the plugin. Just to be sure, what do you mean exactly by "fresh copy"? A fresh copy from your edit or from the original BattleEngineCore plugin (without edits)? Maybe I'm doing something wrong.
@LordScribble Ah, I mean, either the original BattleEngineCore without the edits or a new copy of BattleEngineCore. Basically, we want to get rid of the edited version.
@LordScribble Ah, I mean, either the original BattleEngineCore without the edits or a new copy of BattleEngineCore. Basically, we want to get rid of the edited version.
Okay, it works perfectly fine, the color changes without any issues! Thank you so much for the help!
@LordScribble Nice! Glad it is working for you.

Original thread: https://forums.rpgmakerweb.com/threads/hinting-enemy-health-with-name-color.115255/