Buy stats with Gold a la Dark Souls

Hi all - I've been trying to figure this out for awhile now:

I've done away with exp and would like my character to earn stats by buying them with gold. I plan on having six npcs, each devoted to upgrading a specific stat.

I have this so far: player speaks to npc, "would you like to upgrade HP?," answer yes, event checks if there is enough gold, if there is, HP is upgraded (we'll say, 100 HP per time), then a variable for how many times the player has upgraded HP counts up one.

The problem: how do I make it more expensive each time to upgrade both a single stat, and all stats in general, a la Dark Souls?

Something like this: HP upgrade=price of HP upgrade + (variable x 0.25) is what I'm thinking, but I have no idea how to implement this...

Also, and I'm sure it's possible, just tough to understand, to have all the stats become more expensive, when you buy one:

if player upgrades HP, then HP becomes 0.25 more expensive for the next upgrade, and all other stats become 0.05 more expensive to upgrade. More complicated and not entirely necessary, but it would be cool.

I'm pretty new to actually going into the scripts, so I was hoping to do this with just events...& I appreciate any help or suggestions! : )
Basically, you use the mathematical operations in control variable command to increase cost and display.

Before the question, calculate the current price based on the number variable into a second variable.

Then display not a fixed price, but the variable number as a price - and compare to that instead of a fixed number in the conditional branch as well.
assignbonus4.png


This is a script I did as a commission that I could pretty easily modify for what you're asking for. I'm just trying to get the original client's permission to make it public.
https://dekitarpg.wordpress.com/2013/05/30/d13x-ispds/ 🙂
Wow, I'll have to look into those custom stat scripts : )

This is what I have below.

I tested it and it seems to work okay, but I'm still trying to wrap my head around getting a more exponential curve for the costs of the upgrades...right now it's set to increase by 100 each time. It'd be nice to have it increase by a low multiplier. 

I'm surprised I got this far haha!

stats.png
If you want it to increase by 25% each time (using your event) multiply the variable value by 125 then divide by 100 rather than adding 100 to it.

Original thread: https://forums.rpgmakerweb.com/threads/buy-stats-with-gold-a-la-dark-souls.39641/