[HELP] Scene File Error

Hello everyone!

I've been having this problem for some time now, but I've been working around it!
I use MOG_Scene_File from Mog, which changes the shape of the save screen, and FELSKI_AUTOSAVE!
The MOG plugin uses the Character IDs and links them to an image that we can place in the/Picture Folder!
So I have two images in the Picture Folder that represent the Character with ID_1 and the Character with ID_2!
I only use these two characters in the Game, where they have ID 1 and 2 respectively!
However, when I save the Game, go to the Start screen and click Load Saved Game, the system sometimes gives a 'Loading Error' requesting a completely random Picture, usually being Actor_32, Actor_41 and Actor_42, as far as I remember!

I've already opened Developer_Tools and I can't find the source of this problem, which doesn't show anything about this error!

When you add the ID of the image related to the error to the Picture folder, everything is resolved, but there is a risk that when you save and try to load a saved game, the system will request another image with a different ID!

Does anyone have any idea what might be causing this?

I'll post some images related to the error, but I honestly don't know where to look for more information about the origin of this problem!

TJw4gkR.jpg
The obvious answer is - those aren't pictures that came with MV, so at some point you added them to your project and saved your game. Thus, when you're trying to look at the saves, it wants to load the data it was saved with.

You need to clear out your old saves.
Hi Turan!
Whenever I add a plugin or make a major change, I delete the old Save Files directly from the project folders precisely because I've seen and read cases where the save file ends up trying to search for old settings for something new and this ends up causing errors.
Since I had changed and increased 2 more Attributes within the Game to be shown on the Save and Status Screen, this ended up causing conflicts in the MOG Save Files!
I ended up using GPT, since I don't have much knowledge in js, to help me find the errors and in the end I don't know if it was the best strategy but it ended up working the changes I made!
Basically, the MOG Scene File, because I made these changes, was crossing information, calculations and strange IDs and was always looking for IDs above 30, especially when I used Character 2, so the system tried to show an image linked to them based on this strange calculation, since I only have two Characters in the Game, it returned an error for not finding Picture_32 linked to the Character with ID 2!
I changed the 'refresh Actor Picture' and 'Draw Data' a lot! And it worked using some logs to guide me!

Segue Abaixo as duas alterações que fiz nas Funções:

refresh Actor Picture
Spoiler
JavaScript:
//==============================
// * refresh Actor Picture
//==============================
Scene_File.prototype.refreshActorPicture = function() {
    // Verifica se há dados salvos no arquivo atual
    if (!this._dataWindow || !this._dataWindow.actorID()) {
        console.warn("File vazio ou sem dados salvos.");
        this._ActorPicture.bitmap = null; // Remove qualquer imagem visível
        return;
    }

    // Recupera os dados do ator da janela
    var actorData = this._dataWindow.actorID();

    // Diagnóstico: Verificar o retorno de actorID()
    console.log("actorID() retornou:", actorData);

    // Verificação inicial: Dados nulos ou inválidos
    if (!actorData) {
        console.error("Actor ID não encontrado ou inválido (actorData é nulo ou indefinido).");
        actorData = $gameParty.leader().actorId(); // Força uso do líder do grupo
        console.log("Substituindo por ID do líder do grupo:", actorData);
    }

    // Se actorData for um array, acessa a última posição (caso tenha mais de um valor)
    if (Array.isArray(actorData)) {
        this._actorIndex = actorData[actorData.length - 1];
    } else {
        this._actorIndex = actorData; // Caso contrário, usa o valor diretamente
    }

    // Garantir que a ID seja válida
    if (this._actorIndex !== 1 && this._actorIndex !== 2) {
        console.warn("ID inválida para o ator:", this._actorIndex);
        this._actorIndex = $gameParty.leader().actorId(); // Usa a ID do líder do grupo
    }

    // Depuração: Mostra a ID final
    console.log("ID do Ator Final:", this._actorIndex);

    // Carregar a imagem correspondente ao ator
    try {
        this._ActorPicture.bitmap = ImageManager.loadPicture("Actor_" + String(this._actorIndex));
        console.log("Imagem carregada com sucesso: Actor_" + String(this._actorIndex));
    } catch (e) {
        console.error("Erro ao carregar a imagem para ID:", this._actorIndex, e);
        this._ActorPicture.bitmap = null; // Garante que nenhuma imagem inválida permaneça
        return;
    }

    // Configurações de posição e visibilidade
    this._ActorPicture.x = Moghunter.scFile_ActorX - 100;
    this._ActorPicture.opacity = 255; // Certifica que a imagem é visível
};

Draw data:
Spoiler
JavaScript:
//==============================
// * draw Data
//==============================
Window_FileData.prototype.drawData = function() {
    var actor = this.data().actor;
    var x = Moghunter.scFile_ParX;
    var y = Moghunter.scFile_ParY;
    var s = Moghunter.scFile_ParS;
    var w1 = this.width - 150 + x;  // Correção para w1 conforme seu feedback


    this._actorID = actor[10];
    this.changeTextColor(this.textColor(Moghunter.scFile_TextColor));


    // Corrigindo as posições conforme os valores fornecidos
    this.drawText(String(Moghunter.scFile_PlayTimeWord), x, -90, 120, 'left');  // Play Time corrigido
    this.drawText(String(Moghunter.scFile_LocationWord), x, 112, 120, 'left');  // Location corrigido


    // Desenhando os textos dos atributos na ordem e posição corretas (nomes dos atributos)
    this.drawText(TextManager.levelA, x + 320, y, 120, 'left'); // Nome (Name)
    this.drawText(TextManager.param(0), x + 145, y + s * 1, 120, 'left'); // HP
    this.drawText(TextManager.param(1), x + 145, y + s * 2, 120, 'left'); // MP
    this.drawText(TextManager.param(2), x + 145, y + s * 3, 120, 'left'); // Atk
    this.drawText(TextManager.param(3), x + 145, y + s * 4, 120, 'left'); // Def
    this.drawText(TextManager.param(4), x + 145, y + s * 5, 120, 'left'); // Mat
    this.drawText(TextManager.param(5), x + 145, y + s * 6, 120, 'left'); // Mdf
    this.drawText(TextManager.param(6), x + 145, y + s * 7, 120, 'left'); // Agi
    this.drawText(TextManager.param(7), x + 145, y + s * 8, 120, 'left'); // Luk
    this.drawText("Cor", x + 145, y + s * 9, 120, 'left'); // Defesa Física
    this.drawText("Crítico", x + 145, y + s * 10, 120, 'left'); // Crítico
    if (this._gold) { this.drawText(TextManager.currencyUnit, x + 145, y + s * 11, 120, 'left') }; // Gold


    this.resetTextColor();


    // Desenhando os valores para cada atributo (valores dos atributos em x+280)
    this.drawText(this.data().playtime, w1 - 483, 120, 120, 'right'); // Tempo de jogo
    this.drawText(this.data().location, w1 - 330, 85, 160, 'right'); // Localização
    this.drawText(actor[0], x + 150, y, 120, 'left'); // Nome
    this.drawText(actor[1], x + 280, y, 80, 'right'); // Level
    this.drawText(actor[2], x + 280, y + s * 1, 80, 'right'); // HP
    this.drawText(actor[3], x + 280, y + s * 2, 80, 'right'); // MP
    this.drawText(actor[4], x + 280, y + s * 3, 80, 'right'); // Atk
    this.drawText(actor[5], x + 280, y + s * 4, 80, 'right'); // Def
    this.drawText(actor[6], x + 280, y + s * 5, 80, 'right'); // Mat
    this.drawText(actor[7], x + 280, y + s * 6, 80, 'right'); // Luk
    this.drawText(actor[8], x + 280, y + s * 7, 80, 'right'); // Mdf
    this.drawText(actor[9], x + 280, y + s * 8, 80, 'right'); // Agi
    this.drawText(actor[5], x + 280, y + s * 9, 80, 'right'); // Pdr (Defesa Física)
    this.drawText(actor[11], x + 280, y + s * 10, 80, 'right'); // Cri (Crítico)
    if (this._gold) { this.drawText(this.data().gold, w1 - 40, y + s * 11, 120, 'right') }; // Gold
};

Original thread: https://forums.rpgmakerweb.com/threads/help-scene-file-error.173091/