Okay so, I was unable to find anything about this, but what I'm trying to do is make a state grow/permanently increase an actor's stats by a percentage, instead of just a flat number. The grow mechanic only increases by a flat +1000 max and I want it to increase by a percentage instead, for every turn that a state is active on an actor, the percentage will increase. Is this possible?
Grow by a multiplier/percentage for every turn a state is active
RPG Maker VXAce SupportBump. It's been nearly a month and I still haven't figured this out.
Bump. I still haven't made it past this roadblock.
Sure thing
Code:
class Game_Actor
alias grow_turn_end on_turn_end
def on_turn_end
if state?(999) # <-- change state id here
[0,1,2,3,4,5,6,7].each do |param_id|
growth = 0.1 # <-- Growth value here
add_param(param_id, param_base(param_id) * growth)
end
end
grow_turn_end
end
end
I get an error when trying this in-game.
Script 'Multiplier State Grow' line 7: NoMethodError occurred.
undefined method 'param_add' for
#<Game_Actor:0x113c6138
Is it possible to add multiple states as well?
Oh, it should be add_param.
The code is fixed.
The code is fixed.
Another error:
Script 'Game_BattlerBase' line 456: NoMethodError occurred.
undefined method '+' for nil:NilClass
Sure thing, the code is fixed, again.
Original thread: https://forums.rpgmakerweb.com/threads/grow-by-a-multiplier-percentage-for-every-turn-a-state-is-active.138197/