Hi again! 🙂
I'm trying to add a plugin parameter where a formula can be written.
I've tried several things, but the result still gives a NaN. = /
Here's the code:
I would give the option if the developer wants to use the default formula of Rpg Maker Mv or want to put one of their own. If he wants, then he can write his own formula (Eli.Param.Utilities.Expformset).
I got it all right. Except when I try to put this parameter in the code instead of the formula that is commented on the right side.
Then i got the NaN result.
In the "@param" i've tried several things, like change the @type (even remove it).
Also i'v tried to do this:
Expformset: eval(String(Eli.Parameters['ExpFormSet'])),
I don't know what can i do anymore uhauhauauahau
Any help?
I'v consulted this links to seek help, but i failed to achieve success.
https://forums.rpgmakerweb.com/inde...w-plugin-manager-in-rpg-maker-mv-1-5-0.79764/
https://forums.rpgmakerweb.com/index.php?threads/rpgmakermv-how-to-eval.81780/
Thanks!
I'm trying to add a plugin parameter where a formula can be written.
I've tried several things, but the result still gives a NaN. = /
Here's the code:
Code:
* @param CustomExpForm
* @text Enable Custom Exp Form?
* @type boolean
* @on Enable
* @off Disable
* @desc
* @default false
*
* @param ExpFormSet
* @text Set Your Exp Form
* @type text
* @desc
* @default (level-1) * 100
* @parent CustomExpForm
var Imported = Imported || {};
Imported.Eli_Utilities = true;
var Eli = Eli || {};
Eli.Utilities = Eli.Utilities || {};
Eli.Parameters = PluginManager.parameters('Eli_Utilities');
Eli.Param = Eli.Param || {};
Eli.Param.Utilities = {
Customxpform: eval(Eli.Parameters['CustomExpForm']),
Expformset: eval(Eli.Parameters['ExpFormSet']),
};
(function() {
Game_Actor.prototype.expForLevel = function(level) {
if (Eli.Param.Utilities.Customxpform == false) {
var c = this.currentClass();
var basis = c.expParams[0];
var extra = c.expParams[1];
var acc_a = c.expParams[2];
var acc_b = c.expParams[3];
return Math.round(basis*(Math.pow(level-1, 0.9+acc_a/250))*level*
(level+1)/(6+Math.pow(level,2)/50/acc_b)+(level-1)*extra);
} else {
return Eli.Param.Utilities.Expformset; //(level-1) * 100;
}
};
})();
I would give the option if the developer wants to use the default formula of Rpg Maker Mv or want to put one of their own. If he wants, then he can write his own formula (Eli.Param.Utilities.Expformset).
I got it all right. Except when I try to put this parameter in the code instead of the formula that is commented on the right side.
Then i got the NaN result.
In the "@param" i've tried several things, like change the @type (even remove it).
Also i'v tried to do this:
Expformset: eval(String(Eli.Parameters['ExpFormSet'])),
I don't know what can i do anymore uhauhauauahau
Any help?
I'v consulted this links to seek help, but i failed to achieve success.
https://forums.rpgmakerweb.com/inde...w-plugin-manager-in-rpg-maker-mv-1-5-0.79764/
https://forums.rpgmakerweb.com/index.php?threads/rpgmakermv-how-to-eval.81780/
Thanks!