Recover HP after Battle

● ARCHIVED · READ-ONLY
Started by Zwei 13 posts View original ↗
  1. How to let the HP and MP recover after a battle?

    And how to let TP going on after a battle?
  2. If it's an evented encounter, you can just use the "Full Recovery" command in the first tab of the events command window (under the actors tab)

    If it's a random encounter, you'll have to add the "Full Recovery" command in the troops page of the database, giving it to spawn at 'End of Battle'.
  3. And for keeping TP that the characters have accumulated, on each actor (first tab database) in the Features section, click and select 'Other' (last tab)

    Select Special Flag

    From the drop down menu, select Preserve TP

    You do this for every actor you want to have this feature.
  4. Thx!
  5. To do that, have a switch turn on at the start of every battle, then make a Autorun Common Event require that switch, make the Common Event heal everyone+turn off switch.

    As for TP, yea give every Actor the Preserve tp feature.
  6. Zoltor said:
    To do that, have a switch turn on at the start of every battle, then make a Autorun Common Event require that switch, make the Common Event heal everyone+turn off switch.

    As for TP, yea give every Actor the Preserve tp feature.
    Sry but can I knw how to do step by step?
  7. Here's a scriplet for you to post into the Materials section of the script editor that will fully restore each party member's HP and TP after battle:

    class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Processing at End of Battle #-------------------------------------------------------------------------- alias :on_battle_end_heal :on_battle_end def on_battle_end on_battle_end_heal    remove_state(death_state_id) @hp = mhp @mp = mmp end endIf you want to heal a fixed amount (like 20) instead of the battler's entire HP/MP pool, use @hp += 20 instead of @hp = mhp.

    IMPORTANT: The original scriptlet I provided had a bug when party members are KOed.  They would be fully healed but the KO state would not be removed.  This has been corrected in the scriptlet above, which should now work perfectly.
  8. @Wavelength

    The script says MP, not TP.  Just substitute?
  9. Wavelength said:
    Here's a scriplet for you to post into the Materials section of the script editor that will fully restore each party member's HP and TP after battle:

    class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Processing at End of Battle #-------------------------------------------------------------------------- alias :on_battle_end_heal :on_battle_end def on_battle_end on_battle_end_heal @hp = mhp @mp = mmp end endIf you want to heal a fixed amount (like 20) instead of the battler's entire HP/MP pool, use @hp += 20 instead of @hp = mhp.
    It might be more useful to do something like @hp += mhp/5 (i.e. 20%).  Unless HP doesn't grow much, healing 20 HP in late game, if your party members have 2,000 HP is basically scratch damage.

    But I like this approach, since it doesn't require a new Common Event just for the healing, and doesn't require extra setup steps in each Troop.
  10. Zwei said:
    Sry but can I knw how to do step by step?
    In the troop tab, there's a event section, , set the condition at turn 0, and trigger at Battle.

    turn on a switch.

    then create a autorun common event, that requires said switch to be on

    Heal all party members.

    With that said though, scripting is a slightly better option, However I am wondering why Wavelength is healing battlers(after the battler is dead at that? ), instead of party/Actors.
  11. ksjp17 said:
    @Wavelength

    The script says MP, not TP.  Just substitute?
    There were two parts to the question: (1) How do I heal HP & MP after a battle and (2) How do I let TP persist between battles.  You answered part 2 perfectly (the Preserve TP After Battle option) and it doesn't require scripting.  I was answering part 1.

    Or am I misunderstanding your concern?

    whitesphere said:
    It might be more useful to do something like @hp += mhp/5 (i.e. 20%).  Unless HP doesn't grow much, healing 20 HP in late game, if your party members have 2,000 HP is basically scratch damage.
    Yeah.  I was just giving a quick example with the 20 since I think he wants a full heal - but I agree, using mhp/5 would be a more useful formula than just "20".

    whitesphere said:
    But I like this approach, since it doesn't require a new Common Event just for the healing, and doesn't require extra setup steps in each Troop.
    Thank you :)   I do think it's the best way, since it scales to as many enemy troops as you want without requiring any additional

    Zoltor said:
    With that said though, scripting is a slightly better option, However I am wondering why Wavelength is healing battlers(after the battler is dead at that? ), instead of party/Actors.
    The reason is because it seemed like the cleanest way to do it.  I was originally looking to iterate through each actor in the party and heal them inside the "Determine Win/Loss results" method in BattleManager, but that would require an overwrite.  I could probably do it inside Victory/Escape/Abort/Defeat processing, but that would require several aliased methods instead of one very simple one.  In theory this might be doing the same heal for Troop members, but that's irrelevant since the battle has already ended.  You don't get any bizarre behavior at the end of the Battle scene just because this extra functionality is running.

    I've tested my code and it seems to work perfectly for each type of battle result.  If you lose the battle and it's not a "Continue if Game Over", you get the Game Over screen.  Otherwise, no matter what the result of battle is, your party is healed.
  12. For anyone who's using this scriptlet, please be sure to note that it has been updated to include the line remove_state(death_state_id) - this corrects a bug where a KOed party member would still be treated as KOed after the battle ended, because they still had State 1 applied even though their HP and MP were restored.
  13. I just got a "Like" in this topic so it's obviously still being looked at sometimes, so I thought it would be worth mentioning: several months ago I created this script to provide a much more comprehensive and flexible answer to this problem.  The scriptlet I posted in script 7 still works fine, but this full script allows you to control the behavior at a much finer level.