MZ Skip/Remove Party Command Window (MZ)

Years ago Zevia made a plugin that allowed you to skip the Party Command Window, moved the Escape action to the Actor Command Window, then disabled the escape key to go back to the Party Command Window effectively removing it entirely from the game.

I just tried to use it in MZ and it crashed my game. Would someone be able to re-create what he did for MZ?

Here's the original link... https://forums.rpgmakerweb.com/index.php?threads/party-window-skip.111102/
1. So I figured out how to keep the player from going back to the Party Command Window when in the Actor Command Window.

Code:
//=======================================================================
// Prevents the player from pressing the Escape key from the Actor Command Window
Scene_Battle.prototype.createActorCommandWindow = function() {
    const rect = this.actorCommandWindowRect();
    const commandWindow = new Window_ActorCommand(rect);
    commandWindow.y = Graphics.boxHeight - commandWindow.height;
    commandWindow.setHandler("attack", this.commandAttack.bind(this));
    commandWindow.setHandler("skill", this.commandSkill.bind(this));
    commandWindow.setHandler("guard", this.commandGuard.bind(this));
    commandWindow.setHandler("item", this.commandItem.bind(this));
    commandWindow.setHandler("escape", this.commandEscape.bind(this));
    //commandWindow.setHandler("cancel", this.commandCancel.bind(this));
    this.addWindow(commandWindow);
    this._actorCommandWindow = commandWindow;
};
//=======================================================================

2. And I figured out how to add Escape command in the Actor Command Window.

Code:
//=======================================================================
// Adds the Escape command to the Actor Command Window
Window_ActorCommand.prototype.makeCommandList = function() {
    if (this._actor) {
        this.addAttackCommand();
        this.addSkillCommands();
        this.addGuardCommand();
        this.addItemCommand();
        this.addCommand(TextManager.escape, "escape", BattleManager.canEscape());
    }
};
//=======================================================================

3. Now I just need to figure out how to skip over the Party Command Window and go straight to the Actor Command Window when starting a new battle. Any ideas?
Well, I guess I need to spend a little time in these Java files before making a plugin request. I figured out how to automatically execute the "Fight" command from the Party Command Window so it goes directly to the Actor Command Window and since you can't go back to the Party Window, it's effectively out of the game. Here's the code if you want to make a plugin out of it for yourself.

Code:
//=======================================================================
// Skips over the Party Command Window when first entering Battle
Scene_Battle.prototype.startPartyCommandSelection = function() {
    this._statusWindow.deselect();
    this._statusWindow.show();
    this._statusWindow.open();
    this._actorCommandWindow.setup(null);
    this._actorCommandWindow.close();
    this._partyCommandWindow.setup();
    this.selectNextCommand();  // Automatically chooses "Fight" pushing you into the Actor Window
};
//=======================================================================
Nice work!
Congrats on figuring it out on your own!
Congrats on figuring it out on your own!
Actually this doesn't work.
Actually this doesn't work.
What happens instead?
My mistake. I was attempting to use the code for another purpose. Actually, it does what you said it should, and it is very well done!

I have been attempting to find a way to skip the choice, but retain the ability to press back, and allow the player to choose escape if they still want to try. If you know how to do that, please advise, because I know precious little about this programming language.

If I may further express my vision: Ideally, my situation would enable the player to press right --> and choose defend, a la Final Fantasy.

Until I can find such a solution, I am leaving your plugin on my project, and I've already added your name to the credits document, just in case.

Thanks for the plugin.
If I may further express my vision: Ideally, my situation would enable the player to press right --> and choose defend, a la Final Fantasy.
You're welcome, though you don't need to credit me, I'm just happy it helped with your project. 🙂
Are you looking to do something like what's in my picture, the ability to Fight or "Fortify (Defend)", or Escape?

1693251597238.png
Nah like I have one item in the game right now that lets the party escape. It's a smoke bomb, and maybe if I remove the escape menu, I will just make the smoke bombs cheap or common, so that my menu and gameplay are cleaner, and turn that option into something tangible for the player.
Nah like I have one item in the game right now that lets the party escape. It's a smoke bomb, and maybe if I remove the escape menu, I will just make the smoke bombs cheap or common, so that my menu and gameplay are cleaner, and turn that option into something tangible for the player.
Understood. Removing the Escape command is pretty easy, you'd just want to comment out the command entirely... if I'm understanding you correctly.


Code:
//=======================================================================
// Removes the Escape command... just make sure this is for the appropriate Window.
Window_ActorCommand.prototype.makeCommandList = function() {
    if (this._actor) {
        this.addAttackCommand();
        this.addSkillCommands();
        this.addGuardCommand();
        this.addItemCommand();
        // this.addCommand(TextManager.escape, "escape", BattleManager.canEscape());
    }
};
//=======================================================================
I appreciate you tinkering on my behalf and showing me how the code works. I want to skip the Fight/Escape menu in the beginning of the fight, but keep it accessible via back key/button press if they still want to use it. My suggestion for dropping Escape altogether was actually just a workaround in case I can't figure out how to do that.

Having seen enough of your code by now, I can almost try on my own to see if I can do it. However, if you already know how, please advise! You're very sweet for holding my hand through this process. Wish I had you at every dental appointment.

The more complicated thing I want to do is tidy the interface further by moving Guard to the right.

From the FFV fandom page, a description of the move:
"Defend (Def. in the older translation) is also a regular command everybody can access by pressing the cursor to the right while in battle."

A graphical example below. In the first screen, you see the regular menu. In the second screen, the player pressed right to access the "hidden" Defend command.
@hatesec - does this work for you?
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Skip party command window the first time it appears per battle.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/154179/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (() => {
'use strict';
  // Local flag for tracking if party command window should be skipped.
  let firstPartyCommand = false;

  // Patch - on battle start, also set "first party command" flag.
  void (alias => {
    Game_System.prototype.onBattleStart = function() {
      alias.apply(this, arguments);
      firstPartyCommand = true;
    };
  })(Game_System.prototype.onBattleStart);

  // Patch - on party command start, immediately select "fight" if appropriate.
  void (alias => {
    Scene_Battle.prototype.startPartyCommandSelection = function() {
      alias.apply(this, arguments);
      if (firstPartyCommand) {
        firstPartyCommand = false;
        this.commandFight();
      }
    };
  })(Scene_Battle.prototype.startPartyCommandSelection);

})();
Works like a charm! Thank you so much <3
@hatesec - does this work for you?
Thank you for helping out, I was hoping a real coder would bail me out. Lol


Works like a charm! Thank you so much <3

Awesome!

Original thread: https://forums.rpgmakerweb.com/threads/skip-remove-party-command-window-mz.154179/