MV Request support with a Skill scene plugin

Hi, im not expert in javascript programing but i am working with a selfmade plugin code using AI, this plugin should work with SRD_SuperToolsEngine.js.

The thing is in the following capture:
1722882986312.png


This is my skill scene and i would like to simply show the actor status, skill description at right and the skill list in bottom using two rows to display it...

The problem is that the skills arent being properly listed on and it is just empty.

The skills has been previously configured in the data base of rpg maker mv and assigned to the actor but not even one are showing up...

This is my plugin code:

JavaScript:
(function() {
    function Window_SkillStatus() {
        this.initialize.apply(this, arguments);
    }

    Window_SkillStatus.prototype = Object.create(Window_Base.prototype);
    Window_SkillStatus.prototype.constructor = Window_SkillStatus;

    Window_SkillStatus.prototype.initialize = function(x, y, width, height) {
        Window_Base.prototype.initialize.call(this, x, y, width, height);
        this._actor = null;
        this.refresh();
    };

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

    Window_SkillStatus.prototype.refresh = function() {
        this.contents.clear();
        if (this._actor) {
            var x = this.textPadding();
            var y = this.lineHeight();
            var faceWidth = 144; // Ancho del retrato
            var barX = x + faceWidth + this.textPadding(); // Posición X de las barras
            var barWidth = this.contents.width - faceWidth - this.textPadding() * 3; // Ancho de las barras
            this.drawActorFace(this._actor, x, 0, faceWidth, 144);
            this.drawActorSimpleStatus(this._actor, x, y + 144);
            this.drawActorHp(this._actor, barX, y, barWidth);
            this.drawActorMp(this._actor, barX, y + this.lineHeight() * 2, barWidth);
        }
    };

    Window_SkillStatus.prototype.drawActorHp = function(actor, x, y, width) {
        width = width || 186;
        var color1 = this.hpGaugeColor1();
        var color2 = this.hpGaugeColor2();
        this.drawGauge(x, y, width, actor.hpRate(), color1, color2);
        this.changeTextColor(this.systemColor());
        this.drawText(TextManager.hpA, x, y, 44);
        this.drawCurrentAndMax(actor.hp, actor.mhp, x, y, width,
                              this.hpColor(actor), this.normalColor());
    };

    Window_SkillStatus.prototype.drawActorMp = function(actor, x, y, width) {
        width = width || 186;
        var color1 = this.mpGaugeColor1();
        var color2 = this.mpGaugeColor2();
        this.drawGauge(x, y, width, actor.mpRate(), color1, color2);
        this.changeTextColor(this.systemColor());
        this.drawText(TextManager.mpA, x, y, 44);
        this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,
                              this.mpColor(actor), this.normalColor());
    };

    Window_SkillStatus.prototype.setSkillWindow = function(skillWindow) {
        this._skillWindow = skillWindow;
    };

    Scene_Skill.prototype.create = function() {
        Scene_ItemBase.prototype.create.call(this);
        this.createHelpWindow();
        this.createStatusWindow();
        this.createSkillListWindow();
        this.createActorWindow();
    };

    Scene_Skill.prototype.createHelpWindow = function() {
        this._helpWindow = new Window_Help();
        this.addWindow(this._helpWindow);
    };

    Scene_Skill.prototype.createStatusWindow = function() {
        var wy = this._helpWindow.height;
        var wh = Graphics.boxHeight - wy;
        this._statusWindow = new Window_SkillStatus(0, wy, Graphics.boxWidth / 2, wh);
        this._statusWindow.setActor(this.actor());
        this.addWindow(this._statusWindow);
    };

    Scene_Skill.prototype.createSkillListWindow = function() {
        var wy = this._helpWindow.height;
        var wx = this._statusWindow.width;
        this._skillListWindow = new Window_SkillList(wx, wy, Graphics.boxWidth - wx, Graphics.boxHeight - wy);
        this._skillListWindow.setHelpWindow(this._helpWindow);
        this._skillListWindow.setActor(this.actor());
        this._skillListWindow.setHandler('ok', this.onSkillOk.bind(this));
        this._skillListWindow.setHandler('cancel', this.popScene.bind(this));
        this.addWindow(this._skillListWindow);
        this._statusWindow.setSkillWindow(this._skillListWindow);
        this._skillListWindow.refresh(); // Asegúrate de refrescar la ventana para cargar las habilidades
    };

    Scene_Skill.prototype.start = function() {
        Scene_ItemBase.prototype.start.call(this);
        this.refreshActor();
        this._skillListWindow.activate(); // Activa directamente la ventana de lista de habilidades
        this._skillListWindow.selectLast(); // Selecciona la última habilidad seleccionada
    };

    Scene_Skill.prototype.refreshActor = function() {
        var actor = this.actor();
        this._statusWindow.setActor(actor);
        this._skillListWindow.setActor(actor);
        this._skillListWindow.refresh(); // Asegúrate de refrescar la ventana para cargar las habilidades
    };

    Scene_Skill.prototype.onSkillOk = function() {
        this.actor().setLastMenuSkill(this.item());
        this.determineItem();
    };

    Scene_Skill.prototype.onItemCancel = function() {
        this._skillListWindow.deselect();
        this._skillListWindow.activate();
    };

    Scene_Skill.prototype.createActorWindow = function() {
        this._actorWindow = new Window_MenuActor();
        this._actorWindow.setHandler('ok', this.onActorOk.bind(this));
        this._actorWindow.setHandler('cancel', this.onActorCancel.bind(this));
        this.addWindow(this._actorWindow);
    };

    // Asegurarse de que la ventana de habilidades esté configurada correctamente
    Window_SkillList.prototype.setActor = function(actor) {
        if (this._actor !== actor) {
            this._actor = actor;
            this.refresh();
            this.resetScroll();
        }
    };

    Window_SkillList.prototype.includes = function(item) {
        return this._actor && this._actor.isLearnedSkill(item);
    };

    Window_SkillList.prototype.makeItemList = function() {
        if (this._actor) {
            this._data = this._actor.skills().filter(function(item) {
                return this.includes(item);
            }, this);
        } else {
            this._data = [];
        }
    };

    Window_SkillList.prototype.refresh = function() {
        this.makeItemList();
        this.createContents();
        this.drawAllItems();
    };

})();

I would appreciate a little help here 🙂
Using ai to code is a bad idea, even more so if you can't code yourself, as you have no way of fixing the crap it makes up. Aisde from that, it's not allowed to ask for help with ai code IIRC.
Yeah, generally the programmers here won't look at AI code. If someone want to play code janitor for ChatGPT though all the more power to them.
JavaScript:
Window_SkillStatus.prototype.setActor = function(actor) {
    if (this._actor !== actor) {
        this._actor = actor;
        this.refresh();
    }
};

// should be cleaner if
Window_SkillStatus.prototype.setActor = function(actor) {
    if (this._actor !== actor) return;
    this._actor = actor;
    this.refresh();
};

but there is much more that isn't right either, and AI is bad practice as it doesn't know
the engine, and gives also a lot of unless code you don't want either.

if there is a plugin, use that or ask, as most status window and skill related can be
found inside the core and only require minimal modification.

and we don't help people using AI to "fix" their code.

it's better request or your on your own when using AI. (unless you code it 100% yourself)
// should be cleaner if
Window_SkillStatus.prototype.setActor = function(actor) {
if (this._actor !== actor) return;
this._actor = actor;
this.refresh();
};
to be fair, thats exactly what the engine does for window setActor functions
1722908047561.png

but also did you mean "if (this._actor === actor) return;"? the whole point of the function is to change the window's ._actor. you'd make the function unable to do anything worthwhile if you instantly end it when the new actor isnt the same as current one
to be fair, thats exactly what the engine does for window setActor functions
re checking, I use it differently in my check. so that can work or return by:
if (this._actor === actor) return;

so it won't change if it's the same actor, but either could work. but I don't trust AI anyway 😛
as debugging can be a pain ^^

it's useful for some question for in depth explanation to see how you can use it,
more friendly way, as AI don't know the core, I can puzzle around.

but I do not rely on it for making the plugins.
Using ai to code is a bad idea, even more so if you can't code yourself, as you have no way of fixing the crap it makes up. Aisde from that, it's not allowed to ask for help with ai code IIRC.

re checking, I use it differently in my check. so that can work or return by:
if (this._actor === actor) return;

so it won't change if it's the same actor, but either could work. but I don't trust AI anyway 😛
as debugging can be a pain ^^

it's useful for some question for in depth explanation to see how you can use it,
more friendly way, as AI don't know the core, I can puzzle around.

but I do not rely on it for making the plugins.

Oh well, my apologies for having requested something that was not allowed in this forum, ty anyway 🙂

Original thread: https://forums.rpgmakerweb.com/threads/request-support-with-a-skill-scene-plugin.170881/