Grow by a multiplier/percentage for every turn a state is active

Future232

Villager
Member
Joined
Dec 5, 2020
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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?
 

Future232

Villager
Member
Joined
Dec 5, 2020
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Bump. It's been nearly a month and I still haven't figured this out.
 

Future232

Villager
Member
Joined
Dec 5, 2020
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Bump. I still haven't made it past this roadblock.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,317
Reaction score
7,848
First Language
Indonesian
Primarily Uses
RMVXA
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
 
Last edited:

Future232

Villager
Member
Joined
Dec 5, 2020
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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
        param_add(param_base(param_id) * growth, param_id)
      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?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,317
Reaction score
7,848
First Language
Indonesian
Primarily Uses
RMVXA
Oh, it should be add_param.
The code is fixed.
 

Future232

Villager
Member
Joined
Dec 5, 2020
Messages
19
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Oh, it should be add_param.
The code is fixed.
Another error:

Script 'Game_BattlerBase' line 456: NoMethodError occurred.

undefined method '+' for nil:NilClass
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,317
Reaction score
7,848
First Language
Indonesian
Primarily Uses
RMVXA
Sure thing, the code is fixed, again.
 

Latest Threads

Latest Posts

Latest Profile Posts

Well today was blown away with nothing to show for it. I made a new character to my game who I was going to have a protection mechanic where he protects my main character randomly unless it's a critical, and no matter what, to check if an attack received will be critical, means checking the apply method. This means rewriting the entire method and I refused to do that.
This was originally made for a "castle" challenge, but we just decided to keep it for our actual game :)

1632415929108.png
Would a simple item rarity plugin be useful to someone? Basically, you would set notetag to an item to set its rarity and it would change the text colour of the item.
Stuff that bothers me: When I answer resource requests and the people don't even bother to answer wheather that was what they needed or say thank you in any way.
I'm tempted to leave the Fight/Escape choice in the Boss Battle submission and make Escape pop up Nedry from Jurassic Park: "Uh uh unh!"

Forum statistics

Threads
115,310
Messages
1,088,845
Members
149,958
Latest member
futuretechupdates
Top