Simple Question: How do you change the number of steps it takes for a state to heal you with HRG on?

● ARCHIVED · READ-ONLY
Started by Mahoken 5 posts View original ↗
  1. I want a potion I made to heal you every 10 steps by a certain amount for another specified steps. It seems like the number a steps it takes is always random. Where can I change the amount of steps it takes to heal?
  2. You could make the item call a common event which saves the current step count, then activate a switch that is used by a parallel process common event which checks the step count (waiting every few frames or so), then compare it with the original step count and if the difference is 10, heal then disable the common event.


    You would need to add some checks though to prevent bugs if you would use the items multiple times without each one finishing the effect before you use the next one
  3. I just tested this and it is definitely not random.

    Instead, it is ruled by the following two methods in Game_Actor:

    #-------------------------------------------------------------------------- # * Number of Steps Regarded as One Turn in Battle #-------------------------------------------------------------------------- def steps_for_turn return 20 end #-------------------------------------------------------------------------- # * End of Turn Processing on Map Screen #-------------------------------------------------------------------------- def turn_end_on_map if $game_party.steps % steps_for_turn == 0 on_turn_end perform_map_damage_effect if @result.hp_damage > 0 end endSo, by default, every 20 steps it's treated like one "turn" in battle for the purposes of these States.

    Now, the first trigger of this HP degen/regen effect will seem "random" because it's using your total step count.  So if this state is added to an actor while your total step count for the game is 98, it will trigger two steps later.  And if it's added while your total step count is 105, it will take 15 more steps before it triggers the first time.

    If you want to ensure that it will take the full 20 (or whatever number you enter in the first method) steps before it triggers the first time, the best way would probably need to create a new property for RPG::State and use that to check the total steps variable against.  Or you can "cheat" by lowering the total steps variable to the last multiple of 20 ($game_party.steps = ($game_party.steps / 20).to_i * 20) when any state is applied to an ACTOR (you can do this in Game_Battler's add_state method), but like Engr. Adik's suggestion, this would also essentially reset the steps count for one state if a second state is added to someone.
  4. There is no way to change that counter? I mean, a plugin or script that make a number "X" of steps count as one turn in battle?
  5. [necro]Arthur Franca[/necro]
    The query is over 3 years old. It is most unlikely that the OP is still waiting for an answer.