MZ Where is the battle hud located in the rmmz_Windows.js script?

I'm trying to edit the battle hud, and i can't find where those windows are in the script. Does anyone know where they are located?
When looking for Scene_Battle in rmmz_scenes, you will find this segment:

Code:
Scene_Battle.prototype.createAllWindows = function() {
    this.createLogWindow();
    this.createStatusWindow();
    this.createPartyCommandWindow();
    this.createActorCommandWindow();
    this.createHelpWindow();
    this.createSkillWindow();
    this.createItemWindow();
    this.createActorWindow();
    this.createEnemyWindow();
    Scene_Message.prototype.createAllWindows.call(this);
};

This is a list of all the windows that are displayed during a Battle.

Now you can look in rmmz_windows for those classes, e.g., Window_PartyCommand. Most properties of a UI element are located in rmmz_windows; however, x, y, width and height are defined in Scene_Battle, e.g.

Code:
Scene_Battle.prototype.createStatusWindow = function() {
    const rect = this.statusWindowRect();
    const statusWindow = new Window_BattleStatus(rect);
    this.addWindow(statusWindow);
    this._statusWindow = statusWindow;
};

Scene_Battle.prototype.statusWindowRect = function() {
    const extra = 10;
    const ww = Graphics.boxWidth - 192;
    const wh = this.windowAreaHeight() + extra;
    const wx = this.isRightInputMode() ? 0 : Graphics.boxWidth - ww;
    const wy = Graphics.boxHeight - wh + extra - 4;
    return new Rectangle(wx, wy, ww, wh);
};
Thank you so much! I would have never found that on my own :LZSlol:
The partyCommandWindowRect seems to unaffected by my x and y inputs. Does anyone know why this might be?

It accepts the height and width parameters i set, but not the x and y
The partyCommandWindowRect seems to unaffected by my x and y inputs. Does anyone know why this might be?

It accepts the height and width parameters i set, but not the x and y
You'll have to tell us what exactly you tried.
Ok

The original code was this:

Scene_Battle.prototype.actorCommandWindowRect = function() {
const ww = 192;
const wh = this.windowAreaHeight();
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 0;
const wy = Graphics.boxHeight - wh;
return new Rectangle(wx, wy, ww, wh);
};

I tried this:

Scene_Battle.prototype.actorCommandWindowRect = function() {
const extra = 10
const ww = 1632;
const wh = this.windowAreaHeight();
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 580;
const wy = Graphics.boxHeight() ? + extra - 508 : - wh;
return new Rectangle(wx, wy, ww, wh);
};
Sorry, it was the actorCommandWindowRect that wasn't responding to the x and y parameters i set
It works for literally every other window
OK, so a quick rundown of the different windows here:
  • Party command: Fight, Escape.
  • Actor command: Attack, Guard, (Skill Types), Item.
  • Status window: shows party member faces and info.
By default the status window (Window_BattleStatus, scene property _statusWindow) moves around: it's off to one side during the input phase (when choosing actions) and in the middle otherwise. Scene_Battle is responsible for sliding it between these positions. The target X position is based on its statusWindowX method, but this does not affect the window's Y position.

I think that's the only dynamically-positioned window in the core script battle scene. If that's not the issue, are you using any other plugins?

Edit:

I've moved this thread to Learning JavaScript (from MZ Support). Thank you.

By default the status window (Window_BattleStatus, scene property _statusWindow) moves around: it's off to one side during the input phase (when choosing actions) and in the middle otherwise. Scene_Battle is responsible for sliding it between these positions. The target X position is based on its statusWindowX method, but this does not affect the window's Y position.
Yes, i was intentionally going to get rid of the status window, and make my own individual status windows. It just doesn't fit the aesthetic of my game. I also didn't want any of the windows to be dynamic. My problem is that when i give the Actor command window new coordinates, it just completely ignores them.
I think that's the only dynamically-positioned window in the core script battle scene. If that's not the issue, are you using any other plugins?
Short answer?:

No.

Slightly Long Explanation?:

None that effect windows, other than Super HUDMaker Which still works in RMMZ with FOSSIL.
But that doesn't effect battle windows. You need the Battle Gui Core for that, and that one doesn't work with FOSSIL. I also got rid of Super HUDMaker, because i really just wanted to know how to edit the windows on my own.
Ah...OK, I don't think I properly read your code last time. Notes:
  1. It will generate an error: "Graphics.boxHeight is not a function".
  2. It always returns Y < 0 (off the top of the screen). Looks like you might have meant to add a condition in there, like "boxHeight plus (if A then B else C)"?
  3. By default it also returns X < 0 (off the left side of the screen), because isRightInputMode returns true.
  4. I'm guessing you set the width to 1632 px at some point when testing.
That said, after digging a bit, it turns out the actual problem with the y coordinate is in the core scripts. For some reason, Scene_Battle adjusts the actor command window's y position after creation... 😴

Try this as a plugin instead (copy+paste into a text editor, Save As -> File Type: All Files, Filename: whateverYouLike.js, then import via the Plugin Manager):
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Changes the battle HUD layout!
 * @url https://forums.rpgmakerweb.com/index.php?threads/153433/
 * @help Free to use and/or modify for any project, no credit required.
 */

// Override - redefine actor command window placement.
Scene_Battle.prototype.actorCommandWindowRect = function() {
  const extra = 10
  const ww = 1632;
  const wh = this.windowAreaHeight();
  const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 580;
  const wy = Graphics.boxHeight ? extra - 508 : -wh;
  return new Rectangle(wx, wy, ww, wh);
};

// Patch - reset actor command window Y coordinate after creation. >_>
void (() => {
  // store original method in local `alias` variable.
  const alias = Scene_Battle.prototype.createActorCommandWindow;
  Scene_Battle.prototype.createActorCommandWindow = function() {
    // call original method
    alias.apply(this, arguments);
    // then reset window Y position
    this._actorCommandWindow.y = this.actorCommandWindowRect().y;
  };
})();
This works for me, but as mentioned, those coordinates place it entirely off-screen.

Plugins load after the core scripts, so they can redefine (or extend) core script methods like this. You can put as many overrides as you like in one plugin. Writing edits as a plugin also helps to avoid losing those edits if/when you update your project's core scripts, and makes them easier to track & port. 👋
Thank You!

This works for me, but as mentioned, those coordinates place it entirely off-screen.
Those are the dimensions of my game window. I'm going with an EarthBound style hud


1672768138369.png


The results of those coordinates look like this:
Screenshot 2023-01-03 at 9.55.54 AM.png


As you can see, i "did" get rid of the status window XD. I plan on replacing it with some similar windows to the ones displayed in the EarthBound Hud.
Oh, I see! You have your UI Area size set to be much smaller than your Screen size on the System 2 database tab, right? Those negative coordinates put the window firmly outside the bounds of the UI area, but it will still be on-screen if the UI area is much smaller than the screen.

Regardless, looks like it's working now! Happy RPG Making~ 😂

Original thread: https://forums.rpgmakerweb.com/threads/where-is-the-battle-hud-located-in-the-rmmz_windows-js-script.153433/