RMMZ Making ex parameters scale off of regular ones?

Navas

The Grate Lord
Regular
Joined
Dec 20, 2016
Messages
200
Reaction score
101
First Language
Dutch
Primarily Uses
RMMZ
Hi again,

I am looking for a way to make ex parameters scale off of a regular parameter (e.g. cri and cev scaling with mdf).
I had accomplished this by using the YEP Extra Parameters plugin which for some reason works mostly flawlessly in MZ, but it does seem to cause a visual error in the menus:

1686136074391.png

As seen here, when I switch between equipment, the parameter does change, but the number on the right isn't -1% but 0%.

Visustella's core engine seems to have a formula section similar to the old extra parameters plugin (shown below), but for now I'm only interested in changing 2 of the ex parameters' formulas and not all of them.

JavaScript:
// Determine the variables used in this calculation.
let xparamId = arguments[0];
let base = this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId);
let plus = this.xparamPlus(xparamId);
let paramRate = this.xparamRate(xparamId);
let flatBonus = this.xparamFlatBonus(xparamId);

// Formula to determine total parameter value.
let value = (base + plus) * paramRate + flatBonus;

// Final value
return value;

Old example formula in the YEP plugin:
1686136282635.png

How would I accomplish this?
 

Another Fen

Regular
Regular
Joined
Jan 23, 2013
Messages
697
Reaction score
395
First Language
German
Primarily Uses
Hey,

I don't know which menus you are using, but my guess would be that the menu probably rounds each value individually, so (7.8% -> 7.4%) would be rounded to 8%, 7% and 0% respectively.

If that is the case, you could try to track down the rounding issues in your menu plugins and fix them, or try to change your formulas so they only produce integral percentages:

Math.round( (original formula) * 100) / 100
 

Navas

The Grate Lord
Regular
Joined
Dec 20, 2016
Messages
200
Reaction score
101
First Language
Dutch
Primarily Uses
RMMZ
1686146585701.png

Using the Math formula appears to fix it, so I guess this was in fact the case :kaocry:
Thanks for your help!
 

Latest Threads

Latest Profile Posts

Man, the enemies in the new Sonic Frontiers update are totally roided up. I wanted a little more difficulty myself, but Sonic Team turned the dial a bit too far.

At least the new tracks for roaming Ouranos Island as Amy, Knuckles, and Tails slap hard.
mz_quest_victory_scene.gif


This battle victory screen has been pretty fun to work on. Not only can party members set new personal records for their contributions to the fight, but when they do, the party remarks on the accomplishment!
When you love all your children equally, but the world sees it differently.
popular.png
Found an old, unfinished project of mine, where you fight movie screenplays as an up-and-coming actress.
Turns out I used VX way back when. I may need to remake this in MZ, the premise was kinda hilarious.
1696205441250.png
1696205637522.png
Holy crow, logging in to 33 notifications! That was unexpected.

Forum statistics

Threads
134,981
Messages
1,252,582
Members
177,865
Latest member
donghoreplicaturbowatch
Top