MV Assistance with SRDude's Stat Distribution Plugin (Costs)

Hey all!

This is my first thread on this message board since I'm returning to learning RPGMaker, and I've seemed to have ran into an issue with some math. I'm currently using SomeRandomDude's Stat Distribution Plugin and despite taking to it pretty fast I seem to have ran into an issue with some math.

You see, the equation to make it to where costs increase doesn't seem to work or I can't find the specific formula for it. I originally followed the equation posted in the pinned comments of the video, but those relate more to the possibility of your actor leveling up. In the testing I'm doing, I'm trying to do a system where leveling is not used at all leaving the actor at LVL. 1 for the entire adventure; however, they'd be able to allocate 'Stat Points' earned in battle (which I managed to figure out on my own through some tweaking) to midmax. This is highly inspired by the system in StandStill Girl.

Here's the current equation that I got from the video: Math.ceil(actor.atk / 10) + 1 (to make it so that for every point of atk it ups the cost for your MAXHP to be raised.)

And here's one I'm current messing around with: Math.ceil(actor.lvl * 3) + 2 ( I hope that this make it so that for the actor's lvl is multiplied by 3 (the base cost) + 2)

Maybe something like: Math.ceil(stat.cost) + 2?
Here's the current equation that I got from the video: Math.ceil(actor.atk / 10) + 1 (to make it so that for every point of atk it ups the cost for your MAXHP to be raised.)
That's a valid formula, but your math is wrong for what you say you want.

You're dividing atk by 10, so logically the result will only increase every ten points, not every point of atk.

If you make the cost simply be actor.atk, then the cost will be equal to how much atk the actor has, and will increase by one every point it increases. If you add to that or multiply it, it will continue to change every point. But dividing will necessarily not allow it to change every point.

The other thing to make sure you understand is that Math.ceil() means rounding up. So Math.ceil(actor.atk / 10) will be 1 when atk is 10 or less, then 2 as soon as atk is 11. (but since you don't want to be dividing, you shouldn't be using any Math functions anyway)
That's a valid formula, but your math is wrong for what you say you want.

You're dividing atk by 10, so logically the result will only increase every ten points, not every point of atk.

If you make the cost simply be actor.atk, then the cost will be equal to how much atk the actor has, and will increase by one every point it increases. If you add to that or multiply it, it will continue to change every point. But dividing will necessarily not allow it to change every point.

The other thing to make sure you understand is that Math.ceil() means rounding up. So Math.ceil(actor.atk / 10) will be 1 when atk is 10 or less, then 2 as soon as atk is 11. (but since you don't want to be dividing, you shouldn't be using any Math functions anyway)
Okay I get it mostly, the base formula itself is valid, but when I put it in the 'cost' field in the plugin it wasn't really doing anything. Is there a specific place I have to put say like in my actor's notetags?

Also since I'm not dividing or rounding, should I instead do something like actor.atk + 3?
Okay I get it mostly, the base formula itself is valid, but when I put it in the 'cost' field in the plugin it wasn't really doing anything.
...it should do exactly what it says, but you wouldn't see the cost change until you put 10 points into atk. I explained that above.

If you're saying you put 10 or more points in and the cost never changed, then you'd have to see whether the plugin code is functioning properly. In that case, it would help for you to provide some basic information, like what the value of the actor's atk is and what you're seeing for the cost.

Is there a specific place I have to put say like in my actor's notetags?
I've never used the plugin, you should put it where it says. It should be super simple to test, change the cost between several different numbers (like 1 then 10) and see if the cost to increase the parameter is that number.

Also since I'm not dividing or rounding, should I instead do something like actor.atk + 3?
I have no idea what you want your costs to be. That's up to you, your game, how quickly you gain stat points, and how quickly you want the player to be able to increase the parameters. I'm just pointing out how math works (and the one code function).
...it should do exactly what it says, but you wouldn't see the cost change until you put 10 points into atk. I explained that above.

If you're saying you put 10 or more points in and the cost never changed, then you'd have to see whether the plugin code is functioning properly. In that case, it would help for you to provide some basic information, like what the value of the actor's atk is and what you're seeing for the cost.


I've never used the plugin, you should put it where it says. It should be super simple to test, change the cost between several different numbers (like 1 then 10) and see if the cost to increase the parameter is that number.


I have no idea what you want your costs to be. That's up to you, your game, how quickly you gain stat points, and how quickly you want the player to be able to increase the parameters. I'm just pointing out how math works (and the one code function).
My apologies, I probably should've specified some stuff. You see I want the base cost for all stats to be (2) and increase by 2 every time a point is spent. As pictured below V
1729369060795.png
It's just kind of weird that the words you're saying don't seem to be connected to the screenshot you showed.

1 - You're on the stat Max HP and you're basing the cost off of atk. Why?

2 - The formula you have typed there, "atk + 3," does not at all correspond to what you said, "cost is 2 per point in the stat".

I (and others) are happy to help you, but what part of this are you so confused about?
It's just kind of weird that the words you're saying don't seem to be connected to the screenshot you showed.

1 - You're on the stat Max HP and you're basing the cost off of atk. Why?

2 - The formula you have typed there, "atk + 3," does not at all correspond to what you said, "cost is 2 per point in the stat".

I (and others) are happy to help you, but what part of this are you so confused about?
I'm really sorry, I'm really new to forum posting. I've attached some better screenshots below V. I originally used the 'atk' function because I just copied the equation from the original video. I ended up changing it to HP which had a value of 30, so when I divided it by 10 the base cost would've been 3: actor.hp/10 + 1 <== which I originally thought was gonna make it so that for every 3 points of health the cost would go up by 1. However, it just makes it so that the base cost is 4 and it doesn't update even when I spend the points.

1729384003953.png

Picture Example: How the costs looks with the formula I have now (actor.hp/10)
1729384293488.png


Picture Example: The Plugin Window (Super Tools Engine)

I've been experimenting with this, so my screenshots are a bit outdated, my apologies. I've also been brainstorming some possible solutions. My first being maybe I should modify the default equation in the Plugin Parameters, but that exclusively takes into account the 'stat points earned from leveling up' which I've opted out of in my testing.
1729384545406.png

Picture Example: The Plugin Parameters Menu.

I'm wondering if the equation should be something like: [formula1] + [formula2]; One being the base formula which would handle the base cost and the second which would result in the updating cost.
I originally used the 'atk' function because I just copied the equation from the original video. I ended up changing it to HP
That's still wrong. HP is your current HP, which I wouldn't expect to change when you increase the Max HP parameter.

This uses the standard parameter abbreviations. You might be familiar with them from mousing over your damage formula in skills
1729385023759.png


It's also listed in the Stat Distribution plugin documentation (literally the first parameter).

1729385076937.png


Max HP is mhp.

which had a value of 30, so when I divided it by 10 the base cost would've been 3: actor.hp/10 + 1
That's not what that math says. 30 / 10 = 3, then + 1 = 4. These are very basic division and addition and stuff - even if you have problems with math and need to type it into your computer's calculator, I really think you shouldn't be having a hard time getting the correct results.

it doesn't update even when I spend the points.
Because you're not checking the parameter that's going up from the points - as above, it should be mhp.

I'm wondering if the equation should be something like: [formula1] + [formula2]; One being the base formula which would handle the base cost and the second which would result in the updating cost.
Why, what would that accomplish? A plus sign is a part of a formula, it doesn't somehow separate numbers from each other.
I'm really sorry, I'm really new to forum posting.
That isn't the problem here. The problem is that you keep sending mixed messages, as well as not quite having your basic math up to snuff. You might want to take some time to go over the plugin and maybe check out the damage formula thread.
That's still wrong. HP is your current HP, which I wouldn't expect to change when you increase the Max HP parameter.

This uses the standard parameter abbreviations. You might be familiar with them from mousing over your damage formula in skills
View attachment 320886

It's also listed in the Stat Distribution plugin documentation (literally the first parameter).

View attachment 320887

Max HP is mhp.


That's not what that math says. 30 / 10 = 3, then + 1 = 4. These are very basic division and addition and stuff - even if you have problems with math and need to type it into your computer's calculator, I really think you shouldn't be having a hard time getting the correct results.


Because you're not checking the parameter that's going up from the points - as above, it should be mhp.


Why, what would that accomplish? A plus sign is a part of a formula, it doesn't somehow separate numbers from each other.
AH! Okay, I went back and just changed the math to reflect the actual stat and it works! Thank you! The current equation is now: actor.mhp/10 +2
1729388488668.png

The costs are coming out to being decimals, but that should be easy to fix with some experimentation. Thanks for the help!
The costs are coming out to being decimals
I told you in my first reply that was the purpose of Math.ceil().

If you don't want to always round up, Math.round() will round in the traditional style to the nearest integer, whereas Math.floor() will always round down.

Original thread: https://forums.rpgmakerweb.com/threads/assistance-with-srdudes-stat-distribution-plugin-costs.172696/