[Resolved][XP]A Script to Configure Stat Changes

Started by Wraith89, May 20, 2020, 01:53:38 am

Previous topic - Next topic


May 20, 2020, 01:53:38 am Last Edit: May 21, 2020, 12:55:09 am by Wraith89
In the default editor, there is the states editor, which allows one to create states for various purposes, including stat buffs and debuffs. However, I noticed the native editor can only allow a maximum value of 200% (for example, let's make Sharp raise actor's strength, but it cannot go over 200%, etc). Is there a way to raise this via a script? Of course, the editor would not allow it, but I was thinking more of a script call which can change the values of specific stats to override the editor's limitations. Thank you.


I can get you started on a possible script implementation.

If you look at Game_Battler, under the various stats (let's pick Strength for example), you'll see
  def str
    n = [[base_str + @str_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].str_rate / 100.0   # <========= This line right here
    n = [[Integer(n), 1].max, 999].min
    return n
You can refer to the Help file for RPG::State for the various parameters you can access.

So you might be thinking "Cool, I can just manually set this value to whatever I want by doing"
$data_states[13].str_rate = 500
Which, yes, you can, but you must specifically make this call at some point after Scene_Title loads, as seen in its main method.

It's entirely up to you how you want to make these calls. You can alias Scene_Title#main and make your modifications at the end, like so:
class Scene_Title
  alias define_custom_state_params main
  def main
    $data_states[13].str_rate = 500
Now, whenever you transition to a new scene after Scene_Title, you override the database values with your own custom values.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!


That is exactly the answer I was looking for. I'll test this out soon. I think using the "Chain Status Effect" of Blizzard's Tons of Addons Part 2, this information can help people make stacking buff skills on RMXP. Thank you very much for all your help!