[RMVX ACE] RETRIEVING HOW MUCH OF A PARAMETER HAS BEEN ADDED VIA EVENTS OR ITEMS

Posts

Pages: 1
Short question: How do you, using a script, retrieve the amount of parameter that has been added via items (like the sample "power up" item) or events?

Longer description: I am using Yanfly's Dynamic Stats script. The percent increase function works as expected for your "base" parameter, but any additional parameter increase caused by the above mentioned effects is not counted. I wish for it to be.

I think the following code is responsible for the percent increase:
#--------------------------------------------------------------------------
  # new method: bonus_per_params
  #--------------------------------------------------------------------------
  def bonus_per_params
    return 0 if $game_temp.nil? || $game_temp.eds_actor.nil?
    n = 0
    actor = $game_temp.eds_actor
    for i in 0...8; n += @per_params[i] * actor.param_base(i); end
    return n
  end
After doing some digging, I found that items that are used to increase parameters permanently eventually make their way to the following code:
#--------------------------------------------------------------------------
  # * Increase Parameter
  #--------------------------------------------------------------------------
  def add_param(param_id, value)
    @param_plus[param_id] += value
    refresh
  end
This made me think maybe I could just change the line referring to actor.param_base with the following:
for i in 0...8; n += @per_params[i] * (actor.param_base(i)+actor.param_plus[i]); end
But that doesn't work. It didn't change the behavior at all.

What should I try next?
TehGuy
Resident Nonexistence
1827
If I understand what you're asking for (which I really don't, sorry), my first thought would be to just continually add n into an array index depending on the parameter, so something like (pseudocode ahead)

if param_id == <parameter> then

access an index of array A depending on param_id
increment the value stored at A[x] by n


Or are you saying that multiple items that affect a single parameter don't stack like they should (like item A increments HP by 50% and item B increments it by another 20% and things dont work)?
Pages: 1