MV Basic Plugin help

This is the first plugin I've attempted to make (just a snippet to change font size), and I'm not sure if I'm understanding the process of overwriting parameters from the core scripts: changing the parameter in the editor doesn't change the font size. I have some experience with RGSS, so I'm not sure if I'm just not quite grasping javascript.
Just gonna drop my feedback on the code. Feel free to take it or leave it. 🙂

My main issue is that you shouldn't overwrite a method whenever possible. Instead use an alias. (see snippet below)

Code:
// annonomous function to wrap our code
(function(){
    const alias_initialize = Bitmap.prototype.initialize;
    Bitmap.prototype.initialize = function(){
        // call the old method before doing any changes
        alias_initialize.apply(this, arguments);
        // do changes here:..
    }
})();// < auto call the anon function

There is also no default method of 'standardFontSize'. not sure if your overwriting that from some other plugin or if its a function you are intending to add for yourself.

Default windows use the $gameSystem.fontXXX functions to get the information:
Code:
Window_Base.prototype.resetFontSettings = function() {
    this.contents.fontFace = $gameSystem.mainFontFace();
    this.contents.fontSize = $gameSystem.mainFontSize();
    this.resetTextColor();
};

Anyway I hope this helps some. 🙂
I'm not particularly worried about overwriting these functions since this plugin is for use in my own project and not for general use, and I'm pretty close to just changing the values in the default scripts and moving on because I'm really, really short on patience these days.

There is also no default method of 'standardFontSize'. not sure if your overwriting that from some other plugin or if its a function you are intending to add for yourself.

Default windows use the $gameSystem.fontXXX functions to get the information:
Code:
Window_Base.prototype.resetFontSettings = function() {
    this.contents.fontFace = $gameSystem.mainFontFace();
    this.contents.fontSize = $gameSystem.mainFontSize();
    this.resetTextColor();
};

Anyway I hope this helps some. 🙂
This doesn't help but not because this isn't helpful information, but because I'm a total dunce right now.

I found that changing the number in line 50 of RPG_Windows changed the size of the in-game font, so I copied that into this plugin to overwrite it. I'm not trying to create anything new, I'm just doing this so I don't have to go back into the default scripts if I change to a different font later on.
There is also no default method of 'standardFontSize'. not sure if your overwriting that from some other plugin or if its a function you are intending to add for yourself.
In RMMV there's a function with this name.

Have you ever tried to press F12, to go into the Source Code, make a breakpoint and then to debug it? Your code looks good as far as I scanned it.
Just gonna drop my feedback on the code. Feel free to take it or leave it. 🙂

What you mentioned is only relevant in MZ, the OP is writing code in MV.

@Cryranos Your code is actually mostly correct, you just mistyped the name of your own variables.

You declared your parameters as Kryrzanos.Parameters, but then later tried to access them as Kryrzanos.Param. If you just fix that, it should work.

A quick way to find these sorts of problems is open up the dev console and checking whether variables have the values you expect them to have. I found the above issue by typing Kryrzanos.Param.Fontsize in the console and seeing that it was undefined.

You can also clean the code up a bit, you don't really need to set the font size on both Bitmap and Window_Base, the Window_Base resetFontSettings function already changes its internal bitmap font size to standardFontSize . Cleaning things up a bit:

Code:
var Imported = Imported || {};
Imported.KRY_Fontsize = true;

var Kryrzanos = Kryrzanos || {};
Kryrzanos.Fontsize = {};
Kryrzanos.Parameters = PluginManager.parameters('KRY_Fontsize');

Kryrzanos.Parameters.Fontsize = Number(Kryrzanos.Parameters['Font Size']) || 28;

Window_Base.prototype.standardFontSize = function() {
    return Kryrzanos.Parameters.Fontsize;
};
You declared your parameters as Kryrzanos.Parameters, but then later tried to access them as Kryrzanos.Param. If you just fix that, it should work.

A quick way to find these sorts of problems is open up the dev console and checking whether variables have the values you expect them to have. I found the above issue by typing Kryrzanos.Param.Fontsize in the console and seeing that it was undefined.

You can also clean the code up a bit, you don't really need to set the font size on both Bitmap and Window_Base, the Window_Base resetFontSettings function already changes its internal bitmap font size to standardFontSize . Cleaning things up a bit:

<CODE>
So I changed it to that and now the window text has completely disappeared. Now the parameter is undefined AND the text isn't showing up. I made another snippet to change the enemy/actor MHP/MMP/parameters and that one is returning correct variables and otherwise working as intended now that I've fixed the aforementioned misnamed variables.
I actually figured it out. Both of my snippets are in separate plugins and both use Kryrzanos.Parameters to store their variables. I assume if i either collapsed them into one plugin or renamed the parameters category in one that would fix the new issue?
You have to store the parameters from different plugins in different places, yeah. If you name them the same thing, one plugin would be overwriting the other.

There's a bunch of different ways to do this, there's no real "correct" way. You can look at other people's plugins if you want examples. I do mine like this:

Code:
// One plugin
var Knight = Knight || {};
Knight.Parameters = PluginManager.parameters('KNT_VisualParts');

Knight.Param = Knight.Param || {};
Knight.Param.Parts = {};
Knight.Param.Parts.RootFolder = String(Knight.Parameters['Root Folder']);
Knight.Param.Parts.DefaultCategory = String(Knight.Parameters['Default Part Category']);
Knight.Param.Parts.DefaultPriority = JSON.parse(Knight.Parameters['Part Drawing Order']);

// ...other parameters

Code:
// Another plugin
var Knight = Knight || {};
Knight.Parameters = PluginManager.parameters('KNT_Editor');

Knight.Param = Knight.Param || {};
Knight.Param.Editor = {};
Knight.Param.Editor.KEFilterType = String(Knight.Parameters['Doodad Selection Effect']);
Knight.Param.Editor.KEFont = String(Knight.Parameters['Editor']);
Knight.Param.Editor.KEPanelFont = String(Knight.Parameters['Edit Panel']);
Knight.Param.Editor.KEToggleKey = String(Knight.Parameters['Editor Toggle Key']).toLowerCase();

So I overwrite Knight.Parameters with each plugin, but it doesn't matter because I store all of the values I actually care about somewhere else that isn't overwritten.
You have to store the parameters from different plugins in different places, yeah. If you name them the same thing, one plugin would be overwriting the other.

Alright, I combined them into a single "Core Parameters" plugin in this case. Now only the default values are returning no matter how I set them in the editor.
You did the same thing again. You stored your parameters in Kryrzanos.Param, but you're trying to read them from Kryrzanos.Parameters
I figured out what was wrong just before your response; it was just some typographical errors. I'm all good now I think. I'm definitely feeling the big dumb these days

Original thread: https://forums.rpgmakerweb.com/threads/basic-plugin-help.132155/