Display HP Left /Max HP in MZ

Hi!

I dont like how MZ displays the HP.

I want to change it so that it displays the Max HP also, not only the HP left (see images).




Spoiler: Image MV
Screenshot 2024-09-15 230324s.png


Spoiler: Image MZ
Screenshot 2024-09-15 230246.png


I am using the Vizustella main menu plugin, but i cant find the option to change that.

Does someone have a idea how to do it?
It's not from VisuStella, if you test with a blank project you'll see MZ is simply different in that regard than MV.

Copy the below into a text editor, save as a *.js file, include as a plugin:
Code:
Sprite_Gauge.prototype.drawValue = function() {
    const currentValue = this.currentValue();
    const width = this.bitmapWidth();
    const height = this.textHeight();
    this.setupValueFont();
    this.bitmap.drawText(currentValue + '/' + this.currentMaxValue(), 0, 0, width, height, "right");
};
It's not from VisuStella, if you test with a blank project you'll see MZ is simply different in that regard than MV.

Copy the below into a text editor, save as a *.js file, include as a plugin:
Code:
Sprite_Gauge.prototype.drawValue = function() {
    const currentValue = this.currentValue();
    const width = this.bitmapWidth();
    const height = this.textHeight();
    this.setupValueFont();
    this.bitmap.drawText(currentValue + '/' + this.currentMaxValue(), 0, 0, width, height, "right");
};
I tried that code but sadly it has no effect.

no matter wich plugin order (i even tried new project)

Btw thats a terrible design decision by MZ.. especially in battles.
I don't see how that's possible.

I made a new project, included that plugin, saved the project, play tested it, New Game, pressed Escape:
1726444527266.png


Are you saving the project and starting a new game, not loading a save?
What you're looking for is not in the MainMenuCore plugin but in the SkillsStateCore.
Follow the path shown in the screenshots and apply the modification highlighted in light blue.

1726461216152.png
What you're looking for is not in the MainMenuCore plugin but in the SkillsStateCore.
It's possible the OP's main project has this and and your solution will be the best answer.

But the OP did not say they're using that plugin - in which case the code I gave should've worked - and that doesn't address why the code I provided wouldn't work in a new project.
It's possible the OP's main project has this and and your solution will be the best answer.

But the OP did not say they're using that plugin - in which case the code I gave should've worked - and that doesn't address why the code I provided wouldn't work in a new project.

Are you sure about your statement? What if I told you that the fact your plugin doesn't work on a new project suggests that the reason might actually be the presence of the SkillsStateCore plugin? Showing why your script doesn't work isn't the request of the OP, and I'm sure that by investigating, you'll be able to uncover the mystery. If you'd like, I can still answer your request (hint: try your plugin with the SkillsStateCore activated).

P.S. Your script doesn't need an external .js file; it can easily be integrated as a script within RPG Maker.
What if I told you that the fact your plugin doesn't work on a new project suggests that the reason might actually be the presence of the SkillsStateCore plugin?
😅 So? Turan acknowledged that in the first sentence of the post you quoted:
It's possible the OP's main project has this and and your solution will be the best answer.
Also, I could easily write a plugin that breaks compatibility with Turan's suggestion, regardless of load order. No point getting pompous over an assumption.

P.S. Your script doesn't need an external .js file; it can easily be integrated as a script within RPG Maker.
But since a plugin runs once on boot, rather than getting clumsily eval'd whenever the player starts a new game or loads a save, there's no value in implementing it as a script call.

PS: like Turan said in the second sentence of the post you quoted, the OP claimed to try it in a new project, i.e. with no plugins, and said it didn't work there. Which suggests they either misimplemented that solution (e.g. press F8 or F12 during playtest to open the dev tools window and check the Console tab for load errors), or there is a non-plugin reason for the failure. 👋
Apologies,

I was indeed using the skillsStateCore-Plugin, and thats why ATT_Turans Code did not work.

It works in a blank project with no other plugins.


What you're looking for is not in the MainMenuCore plugin but in the SkillsStateCore.
Follow the path shown in the screenshots and apply the modification highlighted in light blue.

View attachment 317875

This worked also.

BUT... the result is a bit off.
Spoiler: Image
Screenshot 2024-09-16 104806.png


It overlaps with the HP/MP-Display. I tried to offset the x-value, but then it disappears, if it is smaller than 0.


I couldnt find a Option to change the Fontsize or make the Gauge bigger…
I realize now that the way I responded was a bit ambiguous. I am aware that it's often difficult to respond to requests that lack detail, and this makes finding solutions more complicated. My response was not intended to be rude; I find discussions like this helpful for finding shared solutions through dialogue. I apologize if my message was perceived as inappropriate, as that was not my intention. I really appreciate the solutions provided by Att_Turan, and the growth-oriented conversations stemming from them are helping me improve the way I present my own solutions. Due to my work, my explanations are often too formal and technical, and I’m working on improving this.

So if my message somehow offended @ATT_Turan, I apologize. It was not my intention.


@paradajz
To customize the font size, you can add the line of code shown in the screenshot. By default, it uses the default size, which should be 26. You can experiment to find the size that best fits your project.

1726479401570.png
I realize now that the way I responded was a bit ambiguous. I am aware that it's often difficult to respond to requests that lack detail, and this makes finding solutions more complicated. My response was not intended to be rude; I find discussions like this helpful for finding shared solutions through dialogue. I apologize if my message was perceived as inappropriate, as that was not my intention. I really appreciate the solutions provided by Att_Turan, and the growth-oriented conversations stemming from them are helping me improve the way I present my own solutions. Due to my work, my explanations are often too formal and technical, and I’m working on improving this.

So if my message somehow offended @ATT_Turan, I apologize. It was not my intention.


@paradajz
To customize the font size, you can add the line of code shown in the screenshot. By default, it uses the default size, which should be 26. You can experiment to find the size that best fits your project.

View attachment 317885

Awesome, now i got it looking right!


Thank you very much! :LZYcheeze:
Are you sure about your statement? What if I told you that the fact your plugin doesn't work on a new project suggests that the reason might actually be the presence of the SkillsStateCore plugin?
Then I would say that is not the correct usage of "new project" - the whole point is to make a new project with no other plugins active in order to test specific code.

P.S. Your script doesn't need an external .js file; it can easily be integrated as a script within RPG Maker.
That is very bad practice. Anything that overwrites a function should always be put into a plugin.

I acknowledge your follow-up post.

Original thread: https://forums.rpgmakerweb.com/threads/display-hp-left-max-hp-in-mz.171931/