MV [SOLVED] Adding Max HP/MP to status menu

Hi! Hope everyone's doing well.

This is how my status menu currently looks for actors, and I'd like to add a Max HP/MP number at the top of the other stats.
1711539943296.png

Something like this.
1711540143810.png

If anybody's got a quick solution to this I'd greatly appreciate it 🙂
It would help if you gave us some idea as to how you made the status screen you already have - it's clearly unrelated to the default one.

Max HP and Max MP are simply the properties mhp and mmp of the actor you're referencing.
I don't really know how to answer that, but here's the code for the status window I have in windows.js

JavaScript:
//-----------------------------------------------------------------------------
// Window_Status
//
// The window for displaying full status on the status screen.

function Window_Status() {
    this.initialize.apply(this, arguments);
}

Window_Status.prototype = Object.create(Window_Selectable.prototype);
Window_Status.prototype.constructor = Window_Status;

Window_Status.prototype.initialize = function() {
    var width = Graphics.boxWidth;
    var height = Graphics.boxHeight;
    Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
    this._actor = null;
    this.refresh();
    this.activate();
};

Window_Status.prototype.setActor = function(actor) {
    if (this._actor !== actor) {
        this._actor = actor;
        this.refresh();
    }
};

Window_Status.prototype.refresh = function() {
    this.contents.clear();
    if (this._actor) {
        var lineHeight = this.lineHeight();
        this.drawBlock1(lineHeight * 0);
        this.drawHorzLine(lineHeight * 1);
        this.drawBlock2(lineHeight * 2);
        this.drawHorzLine(lineHeight * 1);
    }
};

Window_Status.prototype.drawBlock1 = function(y) {
    this.drawActorName(this._actor, 6, y);
};

Window_Status.prototype.drawBlock2 = function(y) {
    this.drawExpInfo(0, y);
    this.drawParameters(300, y);
};


Window_Status.prototype.drawHorzLine = function(y) {
    var lineY = y + this.lineHeight() / 2 - 1;
    this.contents.paintOpacity = 48;
    this.contents.fillRect(0, lineY, this.contentsWidth(), 2, this.lineColor());
    this.contents.paintOpacity = 255;
};

Window_Status.prototype.lineColor = function() {
    return this.normalColor();
};

Window_Status.prototype.drawBasicInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    this.drawActorLevel(this._actor, x, y + lineHeight * 0);
    this.drawActorIcons(this._actor, x, y + lineHeight * 1);
    this.drawActorHp(this._actor, x, y + lineHeight * 2);
    this.drawActorMp(this._actor, x, y + lineHeight * 3);
    this.drawActorSimpleStatus(this._actor, x, y, + lineheight * 4);
};

Window_Status.prototype.drawParameters = function(x, y) {
    var lineHeight = this.lineHeight();
    for (var i = 0; i < 6; i++) {
        var paramId = i + 2;
        var y2 = y + lineHeight * i;
        this.changeTextColor(this.systemColor());
        this.drawText(TextManager.param(paramId), x, y2, 160);
        this.resetTextColor();
        this.drawText(this._actor.param(paramId), x + 160, y2, 60, 'right');

    }
};

Window_Status.prototype.drawExpInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    var expTotal = TextManager.expTotal.format(TextManager.exp);
    var expNext = TextManager.expNext.format(TextManager.level);
    var value1 = this._actor.currentExp();
    var value2 = this._actor.nextRequiredExp();
    if (this._actor.isMaxLevel()) {
        value1 = '-------';
        value2 = '-------';
    }
    this.changeTextColor(this.systemColor());
    this.drawText(expTotal, x, y + lineHeight * 0, 270);
    this.drawText(expNext, x, y + lineHeight * 2, 270);
    this.resetTextColor();
    this.drawText(value1, x, y + lineHeight * 1, 270, 'right');
    this.drawText(value2, x, y + lineHeight * 3, 270, 'right');
};

Window_Status.prototype.drawEquipments = function(x, y) {
    var equips = this._actor.equips();
    var count = Math.min(equips.length, this.maxEquipmentLines());
    for (var i = 0; i < count; i++) {
        this.drawItemName(equips[i], x, y + this.lineHeight() * i);
    }
};

Window_Status.prototype.drawProfile = function(x, y) {
    this.drawTextEx(this._actor.profile(), x, y);
};

Window_Status.prototype.maxEquipmentLines = function() {
    return 6;
};
I don't really know how to answer that
You would answer it by supplying the code and saying where you got the code?

There is no windows.js - is that the name of a plugin that's making these changes, or are you saying you directly modified the rpg_windows.js file?

This is the default status screen, so you've clearly done more than just changing the windowskin and font.
1711556794839.png
or are you saying you directly modified the rpg_windows.js file?
I just edited rpg_windows.js, none of my plugins I'm using change the status window itself.
I just edited rpg_windows.js, none of my plugins I'm using change the status window itself.
Okay. For future reference, that's not a good practice - you should always put your changes into a plugin file, that way you have reference to the original code and you can manipulate the loading order to ensure compatibility between plugins.

So if you did the editing, you would just put back in a section that draws this._actor.mhp and mmp someplace.
you would just put back in a section that draws this._actor.mhp and mmp someplace.
Is there a specific section I would put it in? I would assume it'd be above
JavaScript:
this.draw.ExpInfo
I have it like this at the moment
JavaScript:
Window_Status.prototype.drawBlock2 = function(y) {
    this._actor.mhp
    this._actor.mmp
    this.drawExpInfo(0, y);
    this.drawParameters(300, y);

Edit: I've tried repositioning them as well but I'm getting a TypeError saying "this._actor.mhp is not a function."
Edit: I've tried repositioning them as well but I'm getting a TypeError saying "this._actor.mhp is not a function."
Because just saying this._actor.mhp is not a functional code statement. You would need to use one of the text-drawing functions provided in MV just like all the other pieces of data in there do.

Someone else may be able to give you more help.

Good luck with your project.
Super quick and dirty solution! As yeah, overwriting directly isn't exactly good practice, it really doesn't matter as long as it gets the job done in YOUR project so long as other plugins don't overwrite it since load order and blah blah blah. Just call this.drawHPMPInfo(0,y); somewhere where the EXP and the like are already being drawn, most likely in the drawBlock2()function for Window_Status.

JavaScript:
Window_Status.prototype.drawHPMPInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    var HP = this._actor.mhp;
    var MP = this._actor.mmp;
    this.changeTextColor(this.systemColor());
    this.drawText("Max HP", x, y + lineHeight * 4, 270);
    this.drawText("Max MP", x, y + lineHeight * 6, 270);
    this.resetTextColor();
    this.drawText(HP, x, y + lineHeight * 5, 270, 'right');
    this.drawText(MP, x, y + lineHeight * 7, 270, 'right');
};

I already aligned the text like EXP and ToNextEXP are drawn based on what you gave us. Just be sure to change the Max HP/Max MP strings there to whatever custom terms you're using (or even replace it with TextManager input instead of my lazy way of just making it a string lol)

Hope this helps you!
Super quick and dirty solution! As yeah, overwriting directly isn't exactly good practice, it really doesn't matter as long as it gets the job done in YOUR project so long as other plugins don't overwrite it since load order and blah blah blah. Just call this.drawHPMPInfo(0,y); somewhere where the EXP and the like are already being drawn, most likely in the drawBlock2()function for Window_Status.

JavaScript:
Window_Status.prototype.drawHPMPInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    var HP = this._actor.mhp;
    var MP = this._actor.mmp;
    this.changeTextColor(this.systemColor());
    this.drawText("Max HP", x, y + lineHeight * 4, 270);
    this.drawText("Max MP", x, y + lineHeight * 6, 270);
    this.resetTextColor();
    this.drawText(HP, x, y + lineHeight * 5, 270, 'right');
    this.drawText(MP, x, y + lineHeight * 7, 270, 'right');
};

I already aligned the text like EXP and ToNextEXP are drawn based on what you gave us. Just be sure to change the Max HP/Max MP strings there to whatever custom terms you're using (or even replace it with TextManager input instead of my lazy way of just making it a string lol)

Hope this helps you!
This works perfectly, Thank you Sundial!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-adding-max-hp-mp-to-status-menu.167209/