MZ hiii~ its me again, more base stats stuff.

ok so, yesterday I made a thread asking for help with getting and retrieving the base stats.

and from the help I received, I got that for me to receive the stats I need without damaging the system(item, leveling, class etc.) I would have to do;

JavaScript:
$gameActors.actor(1).param(0)

changing the id for each actor(I'm only using one) and that param takes in an integer from 1 -8 which allows you to retrieve the different stat info.

now seeing how the whole thing is setup, I realize that I cant pass in a number by doing the reverse which is slightly inconvenient but it seems to be like that for a reason so you know, ideally I wouldn't want to change anything there.

but being able to delete or reset the base value / accumulated data and perform calculations on it is something I really need to know how to do.

so my question is, um is there a way the system does that and where? And then if not how would I go about safely changing the accumulated data?
(max hp, max mp, attack, defense, m. attack, m. defense, agility and luck). <<----- these stats.

Any help would be very much appreciated.

( ̄▽ ̄)ノ
that is not how the engine works.

the base value is set by the class in the database, it depends on the level (although you can set it to a constand number), and it cannot be set in any way other than changing the graphs in the database.

however there is a second value that can hold any number, and is used to store changes of the parameter done by the event command.

and the function that you mentioned is not a value (thereby can't be set to anything, but a function adding together base value, equipment values, modification value and all trait effects.


you need to take three steps back - all your questions so far were too specific to get you the help you need.

instead you need to describe what you want as the general mechanic using parameters, and then we can tell you whether it can be done by the engine, or if you need to use a plugin to completely replace the entire parameter handling.
oops, sorry mods~
that is not how the engine works.

the base value is set by the class in the database, it depends on the level (although you can set it to a constand number), and it cannot be set in any way other than changing the graphs in the database.

however there is a second value that can hold any number, and is used to store changes of the parameter done by the event command.

and the function that you mentioned is not a value (thereby can't be set to anything, but a function adding together base value, equipment values, modification value and all trait effects.


you need to take three steps back - all your questions so far were too specific to get you the help you need.

instead you need to describe what you want as the general mechanic using parameters, and then we can tell you whether it can be done by the engine, or if you need to use a plugin to completely replace the entire parameter handling.

(╮°-°)╮┳━━┳ ( ╯°□°)╯ ┻━━┻
ahhhh!!
…..
ok...
ok ill put it back ┬─┬ノ( º _ ºノ)

alright, what I'm trying to do is create a system where the stats are changeable from a menu at the users' pace and capabilities. And I know its not meant to be used like that, in addition there's always the option to just create new stats etc. and have those be saved, calculated with etc... oh did I mention I'm not using the battle system either?

anyway the stats are in such a way that the function returns the stat value, but what I'm wondering is, if i cant change the values at that point, can I go back a couple of steps and change them from there instead? I know at least 3 maybe more values are calculated on with the result being passed into its final state. with items, level etc. affecting the values.... Is it not possible to change just one of those or maybe even pass in an extra value or maybe change the formula so it has a case where it resets to base if a certain condition is met?

whatever it is, its just complicated to where I cant even trace where what does what and when... so I was hoping someone else might have an idea about how to punch, tackle or even hug this problem. I rarely get stuck on something like this so its sorta frustrating not being able to proceed and I'm wayyyyyyyyyyyyy behind schedule too. wu~

edit!

Ah! what I forgot to mention is I'm not gonna be using a large portion for the system in the way that its intended to be used. I'm just preserving the system because its good resource? and not to mention I'm sorta using the items even though its in a different way.
Everything you need to know about params aka (max hp, max mp, attack, defense, magic attack, magic defense, agility, and luck) is in you js folder. The file name is rpg_objects.js

This is the function for the normal params. (Max HP, Max MP, Attack, etc..)
Game_BattlerBase.prototype.param = function(paramId) {
var value = this.paramBase(paramId) + this.paramPlus(paramId);
value *= this.paramRate(paramId) * this.paramBuffRate(paramId);
var maxValue = this.paramMax(paramId);
var minValue = this.paramMin(paramId);
return Math.round(value.clamp(minValue, maxValue));
};

You will notice that variable value equals paramBase + paramPlus. paramPlus is stuff like armor and weapon param values and param values from event calls that increase or subtract params.

paramRate is the trait that multiplies the stats. paramBuffRate is from buffs.

Like I said everything you need to know about RPG Maker MV or MZ is in the js folder. Notepad++ and knowledge of javascript will help a lot. 2 to 4 weeks to learn the basics.

Edit: For custom stuff for your game, you will need to know javascript or commission someone to make a plugin or find one for free.
@ougitou1 in that case you better look for a plugin to change the way the engine handles the params - there should be several.

It IS possible to zero a parameter in the default engine - but that is done by giving the additional values enough negatives to compensate for the points the actor gets from the base class.
After all, if the base class is 100 ATK and you set the modification to -100ATK, then the param function will return zero.

However that is not something to do multiple times because the engine has no way to remember what change to the param was done why, and multiple resets can mess up your game balance.

so if you want the ability to go back to zero (and probably redistribute points), then it is better if the engine was changed to enable that directly.
Everything you need to know about params aka (max hp, max mp, attack, defense, magic attack, magic defense, agility, and luck) is in you js folder. The file name is rpg_objects.js

This is the function for the normal params. (Max HP, Max MP, Attack, etc..)
Game_BattlerBase.prototype.param = function(paramId) {
var value = this.paramBase(paramId) + this.paramPlus(paramId);
value *= this.paramRate(paramId) * this.paramBuffRate(paramId);
var maxValue = this.paramMax(paramId);
var minValue = this.paramMin(paramId);
return Math.round(value.clamp(minValue, maxValue));
};

You will notice that variable value equals paramBase + paramPlus. paramPlus is stuff like armor and weapon param values and param values from event calls that increase or subtract params.

paramRate is the trait that multiplies the stats. paramBuffRate is from buffs.

Like I said everything you need to know about RPG Maker MV or MZ is in the js folder. Notepad++ and knowledge of javascript will help a lot. 2 to 4 weeks to learn the basics.

Edit: For custom stuff for your game, you will need to know javascript or commission someone to make a plugin or find one for free.
ok ill take a look at this now, thanks.
(@^◡^)

@ougitou1 in that case you better look for a plugin to change the way the engine handles the params - there should be several.

It IS possible to zero a parameter in the default engine - but that is done by giving the additional values enough negatives to compensate for the points the actor gets from the base class.
After all, if the base class is 100 ATK and you set the modification to -100ATK, then the param function will return zero.

However that is not something to do multiple times because the engine has no way to remember what change to the param was done why, and multiple resets can mess up your game balance.

so if you want the ability to go back to zero (and probably redistribute points), then it is better if the engine was changed to enable that directly.

um well, its not like I'm opposed to the idea of rewriting how they are handled, its just that I'm trying to avoid that unless its absolutely necessary, since it would put way more time on a project that's already very time sensitive and to get some to do it will prolly put the projects budget in the red. I had planned to use someone for art work since I'm horrid when it comes to art. I am fairly ok when it comes to making music and most other area though. ill look into the whole balance thing tho.
thank you~.
ok ill take a look at this now, thanks.
(@^◡^)



um well, its not like I'm opposed to the idea of rewriting how they are handled, its just that I'm trying to avoid that unless its absolutely necessary, since it would put way more time on a project that's already very time sensitive and to get some to do it will prolly put the projects budget in the red. I had planned to use someone for art work since I'm horrid when it comes to art. I am fairly ok when it comes to making music and most other area though. ill look into the whole balance thing tho.
thank you~.
Are you looking to make them start at zero?

Sorry I was very confused with your post because it was not very concise and went in many directions with random fluff.

I have made a plugin that starts stats at zero except for Max HP and Max MP.

You will have to save it as ParameterMin0.js If you want MP to start as zero, then after case 1: turn return 1; to return 0;

JavaScript:
Game_BattlerBase.prototype.paramMin = function(paramId) {
return 0;
};

Game_Actor.prototype.paramBase = function(paramId) {
    switch(paramId) {
    case 0:
        return 1;
        break;
    case 1:
        return 1;
        break;
    default:
        return 0;
    }
};

Also I do not know what Andar is talking about. By default the minimum is 1 except of Max MP which can go down to 0.

Default code in rpg_objects.js
JavaScript:
Game_BattlerBase.prototype.paramMin = function(paramId) {
    if (paramId === 1) {
        return 0;   // MMP
    } else {
        return 1;
    }
};

Another plugin that can help you achieve 0 minimum stats is Yanfly's YEP_BaseParamControl. In the plugin manager within the YEP_BaseParamControl plugin settings is an eval for minimum for each stat
Are you looking to make them start at zero?

Sorry I was very confused with your post because it was not very concise and went in many directions with random fluff.

I have made a plugin that starts stats at zero except for Max HP and Max MP.

You will have to save it as ParameterMin0.js If you want MP to start as zero, then after case 1: turn return 1; to return 0;

JavaScript:
Game_BattlerBase.prototype.paramMin = function(paramId) {
return 0;
};

Game_Actor.prototype.paramBase = function(paramId) {
    switch(paramId) {
    case 0:
        return 1;
        break;
    case 1:
        return 1;
        break;
    default:
        return 0;
    }
};

Also I do not know what Andar is talking about. By default the minimum is 1 except of Max MP which can go down to 0.

Default code in rpg_objects.js
JavaScript:
Game_BattlerBase.prototype.paramMin = function(paramId) {
    if (paramId === 1) {
        return 0;   // MMP
    } else {
        return 1;
    }
};

Another plugin that can help you achieve 0 minimum stats is Yanfly's YEP_BaseParamControl. In the plugin manager within the YEP_BaseParamControl plugin settings is an eval for minimum for each stat

sorry my internet went before I could reply yesterday. And no I'm not really thinking to put the values back to zero. My intention is to simply be able to have the method of accumulating stats to be the same but with me having the ability to nerf the stats. so I can kind of have a grindy game.

anyway while my internet was out last night I worked on it till like 3 or 4ish and I finally solved it.

the funny thing is I saw the method and made a note of it sometime before I asked for help. I literally added it in saying //$gameActors.actor().addParam(id, value); right where I intended to use it in the future after my initial read-through of objects.js but I'm so dumb I forgot.

well that method would add so it wasn't as straight forward as, you know "use this". anyway what i did was this
JavaScript:
Game_BattlerBase.prototype.addParam = function(paramId, value) {
    this._paramPlus[paramId] += value;
    this.refresh();
};

//tried it.... it worked, I was like hmmmmm?
//ok so I looked for something doing the opposite.
//no such luck. so I did what any self respecting
//game developer would do, i made my own... but slightly different

Game_BattlerBase.prototype.subtractParam = function(paramId, value) {
    this._paramPlus[paramId] -= value;
    this.refresh();
};


and that's it, to use it I simply did
$gameActors.actor(actor id).addParam(paramid, the exact value I want to add);

and
$gameActors.actor(actor id).subtractParam(paramid, the exact value I want to subtract);

lol and it worked. I feel silly for beating myself up about it now when the solution was so simple. doubting my own sanity and all.

but I appreciate both of you for helping and guiding me, since I couldnt have come to this solution without your combined guidance.

@Zeireth and @Andar
thank you both. (⁀ᗢ⁀)

if you need anything in the future let me know ok? maybe ill be able to help~.
@ougitou1 You don't need a separate function.

$gameActors.actor(1).addParam(0, -10);
@ougitou1 You don't need a separate function.

$gameActors.actor(1).addParam(0, -10);
thats a solution but my way is a bit tidier and since the whole thing gets a bit crowded I think its a good idea to keep things linear. Thanks tho! (you get + 10 points!)
sorry my internet went before I could reply yesterday. And no I'm not really thinking to put the values back to zero. My intention is to simply be able to have the method of accumulating stats to be the same but with me having the ability to nerf the stats. so I can kind of have a grindy game.

anyway while my internet was out last night I worked on it till like 3 or 4ish and I finally solved it.

the funny thing is I saw the method and made a note of it sometime before I asked for help. I literally added it in saying //$gameActors.actor().addParam(id, value); right where I intended to use it in the future after my initial read-through of objects.js but I'm so dumb I forgot.

well that method would add so it wasn't as straight forward as, you know "use this". anyway what i did was this
JavaScript:
Game_BattlerBase.prototype.addParam = function(paramId, value) {
    this._paramPlus[paramId] += value;
    this.refresh();
};

//tried it.... it worked, I was like hmmmmm?
//ok so I looked for something doing the opposite.
//no such luck. so I did what any self respecting
//game developer would do, i made my own... but slightly different

Game_BattlerBase.prototype.subtractParam = function(paramId, value) {
    this._paramPlus[paramId] -= value;
    this.refresh();
};


and that's it, to use it I simply did
$gameActors.actor(actor id).addParam(paramid, the exact value I want to add);

and
$gameActors.actor(actor id).subtractParam(paramid, the exact value I want to subtract);

lol and it worked. I feel silly for beating myself up about it now when the solution was so simple. doubting my own sanity and all.

but I appreciate both of you for helping and guiding me, since I couldnt have come to this solution without your combined guidance.

@Zeireth and @Andar
thank you both. (⁀ᗢ⁀)

if you need anything in the future let me know ok? maybe ill be able to help~.
I do not mean to be rude. I personally do not know your game. Do what you want.

If your whole point is to make stats grindy, then why do you need to subtract to nerf them in game? You can set your stats to almost infinity. I say almost infinity because of memory.

I disagree with you that adding more redundant functions make your code tidier. It makes it ugly and bloated.

Infinity in javascript is like 1.797693134862315E+308 or greater.
JavaScript:
Game_BattlerBase.prototype.paramMax = function(paramId) {
    return Infinity;
};

Also for paramMin, you can return -infinity. I personally would not use huge numbers in my game. The highest my game reaches for stats is 9,999,999 for mhp and mmp, and 999,999 for the rest. There is caps on almost all my stats including xparams and sparams.

First time I ever heard making a game grindy through stats. I do admit that I like grindy games such as Diablo, Titan Quest, and Path of Exile. How they handle the grind is through random equipment and huge exponential curves. Take example Path of Exile. You can reach level 100, but the grind to 100 is a chore. from 95 to 96 is like gaining as much xp as 1 to 95 and then some.

My game uses prefixes and suffixes for certain items. The chances of getting perfect rolls is over 1 in 1,000,000. There is many ways to make a game grindy.

One thing that will frustrate players is purposely subtracting their hard earned progress. If progress involves stat grinding and you arbitrarily try to make the game longer and grindy by subtracting their stats, then the most likely situation is they will rage quit and delete the game.

Do not use linear if you want grindy. Use diminishing returns. Make things harder to gain value the more they have of it. Set caps to stats and make the remaining 5% to 10% the hardest to achieve.

For example how Path of Exile handles players that focus all their attention to make increased x% physical damage is by making it less effective, and to do that is by using diminishing returns.
hmmm..
I do not mean to be rude. I personally do not know your game. Do what you want.

If your whole point is to make stats grindy, then why do you need to subtract to nerf them in game? You can set your stats to almost infinity. I say almost infinity because of memory.

I disagree with you that adding more redundant functions make your code tidier. It makes it ugly and bloated.

Infinity in javascript is like 1.797693134862315E+308 or greater.
JavaScript:
Game_BattlerBase.prototype.paramMax = function(paramId) {
    return Infinity;
};

Also for paramMin, you can return -infinity. I personally would not use huge numbers in my game. The highest my game reaches for stats is 9,999,999 for mhp and mmp, and 999,999 for the rest. There is caps on almost all my stats including xparams and sparams.

First time I ever heard making a game grindy through stats. I do admit that I like grindy games such as Diablo, Titan Quest, and Path of Exile. How they handle the grind is through random equipment and huge exponential curves. Take example Path of Exile. You can reach level 100, but the grind to 100 is a chore. from 95 to 96 is like gaining as much xp as 1 to 95 and then some.

My game uses prefixes and suffixes for certain items. The chances of getting perfect rolls is over 1 in 1,000,000. There is many ways to make a game grindy.

One thing that will frustrate players is purposely subtracting their hard earned progress. If progress involves stat grinding and you arbitrarily try to make the game longer and grindy by subtracting their stats, then the most likely situation is they will rage quit and delete the game.

Do not use linear if you want grindy. Use diminishing returns. Make things harder to gain value the more they have of it. Set caps to stats and make the remaining 5% to 10% the hardest to achieve.

For example how Path of Exile handles players that focus all their attention to make increased x% physical damage is by making it less effective, and to do that is by using diminishing returns.

ahh I really want to explain. but that would expose too much of the game's overall mechanics.... simply put the whole nerfing stats thing will be like forma'ing in warframe.


yes you waste a few stats points... of more than a few, but the end gain will be much better because of it.

so its not a bad thing.
besides. This will allow for some interested mechanics. heck even I'm excited for them.~

(〜 ̄△ ̄)〜 ⁽⁽◝( • ω • )◜⁾⁾

♪(/_ _ )/♪ ♪ヽ(^^ヽ)♪

(ノ≧∀≦)ノ

Original thread: https://forums.rpgmakerweb.com/threads/hiii-its-me-again-more-base-stats-stuff.148581/