Grow by percentage, not a flat number

I've looked all over the forums for a way to grow by a percentage when using a skill, and not a flat number. I'm trying to permanently grow all of an actor's stats when they use a skill by a multiplier, and it can be used an infinite amount of times, but I wasn't able to figure it out. Is it possible?
There is a way to do that without scripts, but it has some caveats. Are you using the auto battle trait on any actors in your game?
There is a way to do that without scripts, but it has some caveats. Are you using the auto battle trait on any actors in your game?
I am not using auto battle trait on any actors. What are the caveats and how is it done? Please let me know and thanks in advance! 🙂
What are your requirements for the multiplier?
What are your requirements for the multiplier?
There will be two skills, one that costs 50 TP, can only be used in battle and permanently increases all stats by 1.2x and one that costs 100 TP, can only be used in battle and permanently increases all stats by 1.4x. It can be infinitely stacked
There will be two skills, one that costs 50 TP, can only be used in battle and permanently increases all stats by 1.2x and one that costs 100 TP, can only be used in battle and permanently increases all stats by 1.4x. It can be infinitely stacked
Okay, so the multiplier will never change?

Also is this increasing by the base value or the current value including buffs?
Okay, so the multiplier will never change?

Also is this increasing by the base value or the current value including buffs?
The multiplier will never change, no. To clarify on what I mean by multiplier, it would be a percentage based increase to the base value stats (not current value.) So, for example. I have 100 ATK. I use the 100 TP move for 1.4x stats. I now have 140 ATK. I do it again. I now have 196 ATK and so on.
Ah, never mind. I forgot VX Ace has a character limit in the damage formula unlike MZ. Let me think on this.
Ah, never mind. I forgot VX Ace has a character limit in the damage formula unlike MZ. Let me think on this.
Damn, that is unfortunate. No problem, take as long as you want!

Ah, never mind. I forgot VX Ace has a character limit in the damage formula unlike MZ. Let me think on this.
Any progress so far? I tinkered around myself and couldn't find anything still.
can you go by common event? that would make everything simple

the problem is that common events attached to skills are processed at the end of a battleturn, and never if the battle ends before that moment.

but if that is OK, then you can use the event command change parameter - which can change the value by variable or fixed number.
and the variable can be calculated to be a percentage of any value (through the game data section)

it would be a longer common event and need to include code for identifying the target, but can be done without big problems.
Any progress so far? I tinkered around myself and couldn't find anything still.
I was looking into non-script options but it looks like that's a non-starter, so I'm going to add a method to actors that does the calculation and call that from the formula.

Andar's common event suggestion could work though if you want to go down that route.
can you go by common event? that would make everything simple

the problem is that common events attached to skills are processed at the end of a battleturn, and never if the battle ends before that moment.

but if that is OK, then you can use the event command change parameter - which can change the value by variable or fixed number.
and the variable can be calculated to be a percentage of any value (through the game data section)

it would be a longer common event and need to include code for identifying the target, but can be done without big problems.
Absolutely! If going by common event would make it less of a hassle for you to guide me, then yes, I will compromise the common event activating at the end of the turn. Let me know how to do this.

I was looking into non-script options but it looks like that's a non-starter, so I'm going to add a method to actors that does the calculation and call that from the formula.

Andar's common event suggestion could work though if you want to go down that route.
I am good with either route, although if you are willing to script it that would be nice.
Let me know how to do this.
Several steps.

First, you need an invisible target state - a state with no function, no icon and no messages and preferably a priority to be displayed last in the list of states on the battlescreen.

Second, your skill needs two effects: the target state and a common event.

Third, in the common event you'll need one (identical) sequence for each possible actor. This will make the common event rather long (and tedious if you have a lot of actors), but unfortunately it is neccessary.
Start the sequence with a conditional branch on actor having the target state, disable the else branch as we don't need it.
Then, for each parameter you want to change, do the following:
1 - control variable : game data to load the current value of the actor into a variable
(attention: this is the total including equipment, for the base value you'll need a script line instead of game data)
2 - calculate whatever portion of it you want to add with more control variables
3 - use change parameter to add that variable to the parameter for the actor
4 - repeat 1-3 for all parameters you want to change

End the sequence for the actor with a command to remove the target state from the actor.
All this needs to be inside the conditional branch for that actor

repeat the entire sequence once for each different actor
Several steps.

First, you need an invisible target state - a state with no function, no icon and no messages and preferably a priority to be displayed last in the list of states on the battlescreen.

Second, your skill needs two effects: the target state and a common event.

Third, in the common event you'll need one (identical) sequence for each possible actor. This will make the common event rather long (and tedious if you have a lot of actors), but unfortunately it is neccessary.
Start the sequence with a conditional branch on actor having the target state, disable the else branch as we don't need it.
Then, for each parameter you want to change, do the following:
1 - control variable : game data to load the current value of the actor into a variable
(attention: this is the total including equipment, for the base value you'll need a script line instead of game data)
2 - calculate whatever portion of it you want to add with more control variables
3 - use change parameter to add that variable to the parameter for the actor
4 - repeat 1-3 for all parameters you want to change

End the sequence for the actor with a command to remove the target state from the actor.
All this needs to be inside the conditional branch for that actor

repeat the entire sequence once for each different actor
Okay. You mentioned for the base value I'll need a script line instead of game data? I want to do base value, so what do I do for the script line?
If I remembered that one I would have included it - but my time using VXA and Ruby is too long past.
you'll have to wait for a scripter to post that.
If I remembered that one I would have included it - but my time using VXA and Ruby is too long past.
you'll have to wait for a scripter to post that.
Oh, that is fine. No worries. Thank you for your help : )
Okay, so in your script editor, add this as a new script in the Materials section above main:

Ruby:
class Game_BattlerBase  
  def boost_stats(multiplier)
    for i in 0..7
      base = param_base(i) + Game_BattlerBase.instance_method(:param_plus).bind(self).call(i)
      boost = (base * multiplier - base).to_i
      add_param(i, boost)
    end
  end
end

Then in the damage formula for your skills, do

a.boost_stats(1.2)

or

a.boost_stats(1.4)

The only thing is that if you use this in battle, you'll get a "took no damage!" message.
Any progress so far?
Please be patient. The other people here are volunteers just like you, so waiting for all of 12 hours is not very reasonable.
Okay, so in your script editor, add this as a new script in the Materials section above main:

Ruby:
class Game_BattlerBase 
  def boost_stats(multiplier)
    for i in 0..7
      base = param_base(i) + Game_BattlerBase.instance_method(:param_plus).bind(self).call(i)
      boost = (base * multiplier - base).to_i
      add_param(i, boost)
    end
  end
end

Then in the damage formula for your skills, do

a.boost_stats(1.2)

or

a.boost_stats(1.4)

The only thing is that if you use this in battle, you'll get a "took no damage!" message.
Thank you very very much! This worked!

Please be patient. The other people here are volunteers just like you, so waiting for all of 12 hours is not very reasonable.
I'm aware it was no rush
@Future232 I merged all your double and multi posts. please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/grow-by-percentage-not-a-flat-number.162086/