Scale HP and MP with stats

I've done a lot of searching, but I haven't been able to find a script that does this.
I'm hoping to be able to have a players max HP and MP be determined by an equation involving their stats. Such as, MaxHP = ATK * 10. Their stats will be changing with leveling, so their MaxHP and MP would need to change when their stats that adjust them change.

I can't find a way to do this without a script. Is there a script that can accomplish what I'm after out there, or is anyone able to make it easily? Thank you in advance for your replies.
There are scripts out there that do this. Try look for States with conditions or formula.

Why must it be based on atk? And why can't you simply use the mhp = 110% settings? It will change as you gain more base max hp anyway.

edit:

Sorry, misread stats for states.

What you want is do-able by eventing alone.

You can +- your character's parameters via eventing alone.

So the trick is:

Do control variables and save the character's parameters in the game variables.

eg

Control Variables:[0001] = Actor 1's MAX HP

Control Variables:[0002] = Actor 1's MAX MP

Control Variables:[0003] = Actor 1's ATK

Control Variables:[0004] = Actor 1's MAT

then minus your actor's max hp with variable 1 (minimum will stop at 1)

then do your formula with variable 3

Control Variables:[0003] *= 10

and add variable 3 to your actor's max hp.

do the same for max mp

The problem with this is, you will end up with 1 current hp/mp everytime you do this. so you will need to "cure" you actors after the change.

or you can simply plug in this script below Material and above Main (not tested, let me know if it doesn't work)

Code:
class Game_BattlerBase  def mhp;  param(2)*10;   end  def mmp;  param(4)*10;   endend
There are scripts out there that do this. Try look for States with conditions or formula.

Why must it be based on atk? And why can't you simply use the mhp = 110% settings? It will change as you gain more base max hp anyway.

edit:

Sorry, misread stats for states.

What you want is do-able by eventing alone.

You can +- your character's parameters via eventing alone.

So the trick is:

Do control variables and save the character's parameters in the game variables.

eg

Control Variables:[0001] = Actor 1's MAX HP

Control Variables:[0002] = Actor 1's MAX MP

Control Variables:[0003] = Actor 1's ATK

Control Variables:[0004] = Actor 1's MAT

then minus your actor's max hp with variable 1 (minimum will stop at 1)

then do your formula with variable 3

Control Variables:[0003] *= 10

and add variable 3 to your actor's max hp.

do the same for max mp

The problem with this is, you will end up with 1 current hp/mp everytime you do this. so you will need to "cure" you actors after the change.

or you can simply plug in this script below Material and above Main (not tested, let me know if it doesn't work)

class Game_BattlerBase  def mhp;  param(2)*10;   end  def mmp;  param(4)*10;   endend
The script you listed works as expected, and I can use it. The problem you mentioned with them needing to be healed for every time they gain a point is there. Is there a way you know of that I can heal them for X when their stat is increased? If not, I can probably work around it.

Thank you very much for your help.
The script you listed works as expected, and I can use it. The problem you mentioned with them needing to be healed for every time they gain a point is there. Is there a way you know of that I can heal them for X when their stat is increased? If not, I can probably work around it.

Thank you very much for your help.
depends on how you are changing that.

the params in the game is kinda fixed to the database table/chart. so we need to "overwrite" the part where they read from the original param table as shown in the script i gave you.

but it shouldn't be killing the character unless you have atk at 0 (which is impossible, because the game has atk fixed to minimum 1)

you will need to be specific on what you did that killed the character so i can know what caused it.

edit:

to auto heal the characters when they level up, use this:

class Game_Actor < Game_Battler    alias meowface_level level_up  def level_up   meowface_level   recover_all  endend

the rest i am sure you can do with simple eventing.
depends on how you are changing that.

the params in the game is kinda fixed to the database table/chart. so we need to "overwrite" the part where they read from the original param table as shown in the script i gave you.

but it shouldn't be killing the character unless you have atk at 0 (which is impossible, because the game has atk fixed to minimum 1)

you will need to be specified on what you did that killed the character so i can know what caused it.
For now, I have a test stat of HP. If a character has 1/10 HP as one class, then changed to a class with a max of 1 HP, it puts him at 0/1. I've included an image showing what I mean.

EDIT: I think an easy solution to this would just be to not start them with a starting value of 1. I just figured that in the event of being at 1 HP, changing a class should be allowed. It might be the only way to heal at the time.

EDIT: image removed
nope, that's caused by the job change script you are using.

instead of healing the hp it's scaling it based on % and round up any digits smaller than 1.

so 0.1 = 0

it's not caused by the scripts i gave you.

you will get that death with a 1 hp class with or without the scripts i gave you.
nope, that's caused by the job change script you are using.

instead of healing the hp it's scaling it based on % and round up any digits smaller than 1.

so 0.1 = 0

it's not caused by the scripts i gave you.

you will get that death with a 1 hp class with or without the scripts i gave you.
I'll look through it to see if I can't fix it. Thank you for your help. I'll be using the script you provided.
You're welcome!

Original thread: https://forums.rpgmakerweb.com/threads/scale-hp-and-mp-with-stats.46131/