TheGentlemanLoser

"And when we fall, we will fall together..."
Veteran
Joined
Dec 30, 2020
Messages
223
Reaction score
270
First Language
English
Primarily Uses
RMMV
Hey so my game doesn't use the LUK stat for anything, MAT is the overall mental stat, MDF has been repurposed as cyber affinity/technical ability, come to think of it as it's using Chrono ABS it doesn't use AGI for much either but I'll figure out something for AGI to do...

Anyway my question is how do I (safely) remove the Luck stat from the equip scene, which is the only scene in the game where it currently displays. I changed the name of the stat to ' ' (blank) but it still displays that blank and a number (1, what I set the stat to since I'm not using it) next to the blank which is pretty janky.

This is a "sequel" of sorts to my "press button, thing happen" thread so I'll repeat I have almost no idea what I'm doing when it comes to JS but I'm willing to learn and this seemed simple enough I could maybe figure out how to do it w/ some help. If possible, like, don't do it for me just like give me some hint how to do it (safely) myself? I mean, it might be so simple that it really just makes sense to tell me exactly what to do because it's like literally one or two lines of code or w/e in which case that'd be appreciated too but like I said I'm trying to learn.

thankee!
 

Mimironi

But what do I know?
Veteran
Joined
Mar 4, 2013
Messages
529
Reaction score
537
First Language
English
Primarily Uses
RMMV
Well, since you said you'd prefer to not have the answer straight up given to you and would like hints, I will try!

I guess the most I can say is to go into rpg_windows.js, since this is how windows and text inside of windows are created, and look into areas that have to do with what you're looking for.

In your case, you want to remove luck from the equip scene, so try to find any scenes that have to do with the equipment scene and see how these scenes call for certain things, like stat parameters and such.

One last hint is that the rpg_windows.js plugin doesn't refer to these stat parameters as their actual words. If you're looking for a part inside rpg_windows.js that says "luck", then you wont find it.

...Hope this isn't too vague or too much info. I actually have little knowledge on plugins, myself! I've just found myself editing many pieces of plugins over the years ahaha
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
947
Reaction score
497
First Language
English
Primarily Uses
RMMV
Follow the functions in the equip scene until you find the window that lists your stats. Look for something with .param(7) and that's your luck value - just delete that line that displays the parameter.

(Or, more correctly, make a copy of that whole function into a plugin, and delete the line there)
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,484
Reaction score
721
First Language
indonesian
Follow the functions in the equip scene until you find the window that lists your stats. Look for something with .param(7) and that's your luck value - just delete that line that displays the parameter.

(Or, more correctly, make a copy of that whole function into a plugin, and delete the line there)
this answer...

but it's only if not using other plugin that modify the windows... if you use other plugin for your equip scene... you might want to modify that plugin method instead... BUT if using VisuStella... their code is obfuscated... which mean we cannot read the code and modify the method... so maybe try using this "hack" snippet instead...
Code:
var estAliasTrickWindowEquipStatusDrawItem = Window_EquipStatus.prototype.drawItem;
Window_EquipStatus.prototype.drawItem = function(x, y, paramId) {
    if (paramId == 7) return;
    estAliasTrickWindowEquipStatusDrawItem.call(this, x, y, paramId);
};
this should skip the paramId 7 which is luk when drawing the parameter...
place it below all other plugin that modify window_EquipStatus

i did not test it btw... sorry if there's error...

hope this help
 

TheGentlemanLoser

"And when we fall, we will fall together..."
Veteran
Joined
Dec 30, 2020
Messages
223
Reaction score
270
First Language
English
Primarily Uses
RMMV
I don't have visustella (imagine being able to afford to actually pay for plugins lol), I am using chrono engine which probably monkeys it around, I feel like I should alias this anyway instead of editing the base code in rpg_scene (or w/e it is) because best practices/not breaking anything but I am not sure how.

just got back to this now let's see here... (will edit post w/ more once I figure out if and how my dumb ass is going to break the game with this simple edit)

EDIT1: hmm, I can't find param(7) or for that matter .param(n) where n = anything,

I think that rpg_window.js has the target code specifically somewhere in here, lines 2242-2362...

JavaScript:
//-----------------------------------------------------------------------------
// Window_EquipStatus
//
// The window for displaying parameter changes on the equipment screen.

function Window_EquipStatus() {
    this.initialize.apply(this, arguments);
}

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

Window_EquipStatus.prototype.initialize = function(x, y) {
    var width = this.windowWidth();
    var height = this.windowHeight();
    Window_Base.prototype.initialize.call(this, x, y, width, height);
    this._actor = null;
    this._tempActor = null;
    this.refresh();
};

Window_EquipStatus.prototype.windowWidth = function() {
    return 312;
};

Window_EquipStatus.prototype.windowHeight = function() {
    return this.fittingHeight(this.numVisibleRows());
};

Window_EquipStatus.prototype.numVisibleRows = function() {
    return 7;
};

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

Window_EquipStatus.prototype.refresh = function() {
    this.contents.clear();
    if (this._actor) {
        this.drawActorName(this._actor, this.textPadding(), 0);
        for (var i = 0; i < 6; i++) {
            this.drawItem(0, this.lineHeight() * (1 + i), 2 + i);
        }
    }
};

Window_EquipStatus.prototype.setTempActor = function(tempActor) {
    if (this._tempActor !== tempActor) {
        this._tempActor = tempActor;
        this.refresh();
    }
};

Window_EquipStatus.prototype.drawItem = function(x, y, paramId) {
    this.drawParamName(x + this.textPadding(), y, paramId);
    if (this._actor) {
        this.drawCurrentParam(x + 140, y, paramId);
    }
    this.drawRightArrow(x + 188, y);
    if (this._tempActor) {
        this.drawNewParam(x + 222, y, paramId);
    }
};

Window_EquipStatus.prototype.drawParamName = function(x, y, paramId) {
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.param(paramId), x, y, 120);
};

Window_EquipStatus.prototype.drawCurrentParam = function(x, y, paramId) {
    this.resetTextColor();
    this.drawText(this._actor.param(paramId), x, y, 48, 'right');
};

Window_EquipStatus.prototype.drawRightArrow = function(x, y) {
    this.changeTextColor(this.systemColor());
    this.drawText('\u2192', x, y, 32, 'center');
};

Window_EquipStatus.prototype.drawNewParam = function(x, y, paramId) {
    var newValue = this._tempActor.param(paramId);
    var diffvalue = newValue - this._actor.param(paramId);
    this.changeTextColor(this.paramchangeTextColor(diffvalue));
    this.drawText(newValue, x, y, 48, 'right');
};

...lemme try changingthis line...

"
Window_EquipStatus.prototype.numVisibleRows = function() {
return 7;
};"

...to return 6 instead of return 7... (once again editing this post once more when I see why for myself why that is bad/dumb/wrong)

EDIT2: that...worked...and it didn't break anything?? that I can tell, yet? I seem to have experienced a totally uncharacteristic moment of freak competence? probably a fluke lol

so if I created a "plugin" with just

JavaScript:
Window_EquipStatus.prototype.numVisibleRows = function() {
    return 7;
};

would that do the same thing but w/o altering the base code? or do I need to include the whole function (which I think starts being defined in line 2247?)[/code]
 
Last edited:

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
704
Reaction score
580
First Language
English
Primarily Uses
RMMV
would that do the same thing but w/o altering the base code? or do I need to include the whole function (which I think starts being defined in line 2247?)

Basically the last version of a function that gets defined is the one that your game considers to be the 'real' version.

So yes, it'll take priority over the base code.

The only question is whether or not some existing plugin you have already alters that line of code.

There are two ways you can check what's going on with this.

First, you can use a program to search within files (I recommend agent ransack over windows search but that'll work okay) in the js folder to see if anything redefines what 'Window_EquipStatus.prototype.numVisibleRows' is. If no plugins use the name, they aren't monkeying around with it directly.

Second, you can open it up in the 'sources' tab of the debugger, and put a breakpoint in the middle of Window_EquipStatus.prototype.numVisibleRows. When you open the equip menu, the game will pause, and the sources tab will now have a 'Call Stack' on the right hand side. That shows you where you currently are in the code, and the function that called numvisible rows, and the function that called that, and so on and so forth.

So you'd be able to click to go back and look at where you are in initialize

Window_EquipStatus.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();

for instance.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
947
Reaction score
497
First Language
English
Primarily Uses
RMMV
would that do the same thing but w/o altering the base code? or do I need to include the whole function
That is the whole function.

Also, I don't know why you said you couldn't find .param(anything) when the code you quoted has it in four places. You wouldn't care about TextManager.param(paramid), but every place you see ._actor.param(paramid) that's an actor's parameter.

The code you changed will do what you want visually - you're telling the window it has fewer lines we can see, but the code is still trying to put the Luck parameter there every time you look at the equip screen.

If you want to actually stop the game from going through all those steps that are just forbidden from being displayed, you want to look at line 2284, where you can see the variable starting at i and going to < 6 (e.g. 5), and the following line it's sending the parameter of i + 2 (e.g. ending at 7, which is Luck). Changing that line to say i<5 should do the trick.
 

Latest Threads

Latest Posts

Latest Profile Posts

I can come up with all of the magic skills in the world, but I can hardly think of creative physical weapon skills within the JRPG realm. One of those ones....
It's time for episode 19 of our Make a Cliff Map in RPG Maker MZ... I mean, Make a Game in RPG Maker MZ! Today we're working on our cliff map again. Let's see if we can finish it this time!

A side story is almost getting into the next stage. Almost everything in this game has real-life references.
unfinishedbuildingwip1.jpg
Everyday life is full of absurdity. This is just a reflection.
TFW you discover how the script batching works in VNMaker... after you've had the program for almost 3 years.

Forum statistics

Threads
111,408
Messages
1,060,908
Members
144,765
Latest member
tinsel2
Top