MZ I made visible HP value of enemy in HUD Maker, but I need script that sets condition under which it is shown

I really couldn't came up with better title. As you see on gif below, in battle there is enemy HP value that I made through HUD Maker, and enemy HP gauge from Theo Gauges plugin. And since this plugin doesn't have option to show enemy hp value as well (I wish it did), I decided to make one using HUD Maker. But problem is, the number stays up during the whole battle, while I need it to appear only when:
- You choosing an enemy (in the way like "choose enemy X, can't see value of enemy Y/Z", so you can see enemy HP value only when choosing that one enemy)
- Enemy is getting hit (should stay for entire duration of getting hit, so it would be in sync with enemy gauge)
- Enemy is recovering it's HP (same as above, generally I want it to be shown whenever hp gauge is shown, and preferably in sync)
And I guess that's it. HUDMaker has condition named "Custom Code", so I think it can be done in form of script, and be put there, so it checks when to show HP value? I believe so. The point of all of that is that I want my game to be more on strategic side, and not seeing exact HP value of enemies could be really bad for a player.
Thanks in advance.
j2yzoSBB29.gif
Bump
Bump
Hello my friend!

I'm using a HUDmaket too and I found that it is best to give to it - constants. So you create a new constant, than you calculate it in your common event in MZ, and than give it to hud maker.

I use this trick even in gauges - and it goes well.
That sounds nice, could you please put it in more details so I would try it tomorrow?
Hello my friend!

I'm using a HUDmaket too and I found that it is best to give to it - constants. So you create a new constant, than you calculate it in your common event in MZ, and than give it to hud maker.

I use this trick even in gauges - and it goes well.
For example on hit: Use a common event to control varibles or switches, add it to attack.
1702502307428.png


In common event go something like (try the timings for animation to match)
1702502381343.png

In HudMaker make an option to show in switch is active (or constant) (sry name on screen does not match)
1702502502061.png


May get tedious with timings and maybe it is better to use a plugin CommonEventBeforeCast but i think it should be something like that.
For example on hit: Use a common event to control varibles or switches, add it to attack.
If you want HUD elements to display or change when an enemy is being hit, that won't do it.

Common Events on a skill resolve after the skill is complete, so the player would select the skill, see it happen, the enemy takes damage, there's the popup, and only then will this event happen.

For many HUD Maker timings, you can simply look up or ask for the code reference to see when the specific time you're looking for is true (usually a state in the BattleManager).

If there isn't a corresponding timing in the BattleManager for what you want to do, it will be much more effective to use a plugin that offers timing-specific notetags.

The OP is using VisuStella's plugins, and the Battle Core has notetags for every phase of a skill's resolution.

If you aren't using/don't want to use VisuStella, I have an alternative in my Eval Tags plugin.
If you want HUD elements to display or change when an enemy is being hit, that won't do it.

Common Events on a skill resolve after the skill is complete, so the player would select the skill, see it happen, the enemy takes damage, there's the popup, and only then will this event happen.
Welp, there is this plugin for that matter too.
Welp, there is this plugin for that matter too.
1 - A common event is still the least efficient way to do this. It won't ruin your game, but there's no reason to be taking up an event slot or two for a single line of code each.

2 - That plugin runs the common event when the skill is used, so it has no idea whether it's going to hit or not. The ones I mentioned above with notetags have timing specific to occur when the skill successfully hits the target.
If I understand this correctly, if I use BattleCore action sequences notetag, the setup I was shown in the beginning will work, right?

Original thread: https://forums.rpgmakerweb.com/threads/i-made-visible-hp-value-of-enemy-in-hud-maker-but-i-need-script-that-sets-condition-under-which-it-is-shown.163364/