Conditional Branch: Health/Healing

● ARCHIVED · READ-ONLY
Started by captain2424 4 posts View original ↗
  1. I'm trying to set this bed up with an event that will heal you only if you have already taken damage.  I'm pretty sure I need to use a conditional branch, but that's about as far as I've gotten...
    Any help would be much appreciated!

    rpgmakervxacehelp.png
  2. And what should happen if the player hasn't taken any damage?


    Excess healing is simply ignored, so if you have the event heal all time it will cause not problems.


    However, if you really want to check if damage was taken, then you need a combination of control variable (to get the HP numbers and calculate with them) and conditional branches (to check if the HP is lower than max or not).


    If you do not know how to use variables and conditional branches, then I suggest you do some basic tutorials - you can follow the link in my signature to the most important ones, especially the variables guide.
  3. If the player hasn't recieved any damage I would just have text that reads "you don't have time to lay around!"

    Would you suggest letting the event heal all the time?

    Also, thank you for helping!!
  4. I'd suggest having the event heal you all the time (assuming you're using Recover All rather than only wanting to restore HP), since it might not just be damage that the player has taken, but also loss of mana, states like Poison, etc.

    However, if you want to do exactly what you were asking for, do a "Script..." event command and use the following:

    $game_switches[33] = false
    for actor in $game_party.members
    if actor.hp < actor.mhp
    $game_switches[33] = true
    end
    end

    Then, do a Conditional Branch on Switch #33 (or whatever switch you feel like using as a "one shot" switch that events can freely turn ON or OFF for their own purposes) - IF SWITCH #33 IS ON should be the exact condition.  Inside the first block, include the healing and appropriate text, and inside the second ("Else") block, have a Message that says "You don't have time to lie around!".