Help changing MOG's Scene File

Hey there folks 🙂

I hope this is the right forum for this (I wasn't sure if this is the right one or if I should post it in "Learning JS"). I've just started learning JS so I need help.
So, I'm using Moghunter's Scene File. I managed to edit it the way I like it to be but now I ran into two problems.

First of all: I want to have the picture depending on a variable instead of the actor ID. That's because the picture should change depending on the story progression (which is "saved" within a variable). For example, it should be the picture Actor_1 when the variable is under 5, Actor_2 when the variable is between 6 and 11 and so on. But I'm not sure how I need to change the JS to do that.
The picture is drawn with this line:
this._ActorPicture.bitmap = ImageManager.loadPicture("Actor_" + String(this._actorIndex));

The second thing is that I want to show the name and level of all party members instead of HP, MP and such things of the first party member. With the default script it shows the name and level (and all stats) of the actor on the first position. Like I said, it should show the name and level of all party members that are currently in the group. I think the plugin part that's needed is the following (I deleted all the parts I don't need already):
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 - 120 + x;;
this._actorID = actor[10];
this.changeTextColor(this.textColor(Moghunter.scFile_TextColor));
this.drawText(TextManager.levelA, w1, y, 120, 'left'); // Level
this.resetTextColor();
this.drawText(actor[0], x, y, 120, 'left'); // Name
this.drawText(actor[1], w1, y, 80, 'right'); // Level
};


I hope someone can help me and tell me how I need to change the according parts 🙂
Anyone able to help? It would be really appreciated 🙂
If you keeping add this:

Code:
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 - 120 + x;;
this._actorID = actor[10];
this.changeTextColor(this.textColor(Moghunter.scFile_TextColor));
this.drawText(TextManager.levelA, w1, y, 120, 'left'); // Level
this.resetTextColor();
this.drawText($gameParty.members()[0]._name, x, y, 120, 'left'); // Name actor in position 1 in the party
this.drawText($gameParty.members()[0]._level, w1, y, 80, 'right'); // Level  actor in position 1 in the party
this.drawText($gameParty.members()[1]._name, x, y, 120, 'left'); // Name  actor in position 2 in the party
this.drawText($gameParty.members()[1]._level, w1, y, 80, 'right'); // Level  actor in position 2 in the party

And keep changing the position of each "drawtext". Maybe can work?
I believe that if there is no actor in the group's specified position, nothing will be drawn.
For example, it should be the picture Actor_1 when the variable is under 5, Actor_2 when the variable is between 6 and 11 and so on.

You can use an "if" statement to change the value of something based on some condition. If you're not sure what an "if" statement is, I'd encourage you to read more here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else

Here's an example based on your example:
Code:
let fileName;
if ($gameVariables.value(X) < 5) {
    fileName = 'Actor_1';
} else if ($gameVariables.value(X) < 11) {
    fileName = 'Actor_2';
} else {
    fileName = 'Actor_3';
}
this._ActorPicture.bitmap = ImageManager.loadPicture(fileName);
Thanks to both of you 🙂
I managed to get it to work like I want it to. Even though Eliaquims suggestion didn't work 😉

You can use an "if" statement to change the value of something based on some condition. If you're not sure what an "if" statement is, I'd encourage you to read more here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else

Here's an example based on your example:
Code:
let fileName;
if ($gameVariables.value(X) < 5) {
    fileName = 'Actor_1';
} else if ($gameVariables.value(X) < 11) {
    fileName = 'Actor_2';
} else {
    fileName = 'Actor_3';
}
this._ActorPicture.bitmap = ImageManager.loadPicture(fileName);

I felt really stupid after reading that. Why hadn't I thought of if functions sooner?! xD
It worked btw. And it was far easier than I thought originally. Sometimes one is just at a loss even though the solution is that simple 😅

Original thread: https://forums.rpgmakerweb.com/threads/help-changing-mogs-scene-file.107441/