In our game you can reset your stats to default, I was wondering if there was a quick way to set a stat to a specific number for a character?
Quick Way to Set Stats
RPG Maker MV SupportThere's a Change Parameter command on the very first tab of event commands.
It can't set, just add or subtract, so it takes three commands - set a variable equal to the actor's current parameter. Subtract the number you want from that variable. Subtract the variable from the parameter.
It can't set, just add or subtract, so it takes three commands - set a variable equal to the actor's current parameter. Subtract the number you want from that variable. Subtract the variable from the parameter.
I was hoping for a simpler way, but if it does not exist I suppose I'll have to do it that way.
You can use the JavaScript commands directly, of course, but if you're not versed with it I don't know that it's simpler.
The trick with going straight to the code is that there are potentially a lot of things in the game that affect your parameters. Using the event commands will account for all of them and put the stats where you want. If you code it without being careful, you'll end up with "I set Attack to 8, why is it showing 15?"
The trick with going straight to the code is that there are potentially a lot of things in the game that affect your parameters. Using the event commands will account for all of them and put the stats where you want. If you code it without being careful, you'll end up with "I set Attack to 8, why is it showing 15?"
What I'm going to have to do then is keep track of how much each stat is boosted (given there is no levels in this game), I THINK I know how I can do that, but I would hate to double post if I am wrong.
You used a script that was like
user.usedSigils=user.usedSigils ? user.usedSigils+1 : 1; in that other post - can I make a similar thing but for each stat like user.HPIncreased? Of course I don't completely understand the process. Like for HP I'd want it to be +5 because every increase is 5 HP, but would that be +5 : 1 because I confess I am bad at math and am not sure what the 1 stands for.Edit: Okay did some testing. The 1 is just how much is added the first time it's created! With this discovery my skills can only improve!
Yea, the base values are from the class, then you have flat bonuses from equips & Change Parameters, then any traits/buffs. So you'd need Change Parameters or its script equivalent (
addParam) here.I've moved this thread to MV Support. Thank you.
This was about MV, right?
Yes, and thank you. Although after some testing I got things to work so I suppose this has been solved. I was gonna keep it open but things seem to be running smoothly. I will have it closed.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/quick-way-to-set-stats.146479/