MZ Automatic opening of the Skill Windows ?

Hello !

I'm trying to automatically open the Skill windows instead of the actor windows, to make my user only being able to use skills.

At first, I tried something like this (directly in rmmz_scene to test it out)

Scene_Battle.prototype.startActorCommandSelection = function() {
this._statusWindow.show();
this._statusWindow.selectActor(BattleManager.actor());
this._partyCommandWindow.close();
this._actorCommandWindow.show();
this._actorCommandWindow.setup(BattleManager.actor());
//Script Edit
this._actorCommandWindow.close();
this.commandSkill();
};
(Kinda nooby ikr) But this only open a skill windows without any skills loaded. I was pretty sure that the actor was defined at this stage, but I guess I'm missing a function or 2, I kinda ignore how the whole thing works.

Thanks for any help !
Actors can have multiple types, and each one gets a command in that window. So commandSkill checks the index of the currently-selected actor command to see which skill type has been selected.

You could try one of these:
  1. Select first "skill type" command:

    this._actorCommandWindow.selectSymbol("skill");
  2. Select command index 1 (second command in the list):

    this._actorCommandWindow.select(1);
Also, I recommend you call the command window's processOk method rather than skipping directly to the scene's commandSkill method.

I wrote a quick plugin that seems to work for me, with no other plugins active:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Redirect all actor commands to the actor's first skill type.
 * @url https://forums.rpgmakerweb.com/index.php?threads/151654/
 * @help Free to use and/or modify for any project, no credit required.
 */

// Catches initial setup
void (alias => {
    Window_ActorCommand.prototype.setup = function(actor) {
        alias.apply(this, arguments);
        this.selectSymbol("skill");
        this.processOk();
    };
})(Window_ActorCommand.prototype.setup);

// Catches cancel of skill selection
void (alias => {
    Window_ActorCommand.prototype.show = function() {
        alias.apply(this, arguments);
        this.selectSymbol("skill");
        this.processOk();
    };
})(Window_ActorCommand.prototype.show);
It has 2 patches. To allow players to back out of skill selection, remove the second part~

Original thread: https://forums.rpgmakerweb.com/threads/automatic-opening-of-the-skill-windows.151654/