Upgrading a player's health?

I've seen similar questions, but nothing that really helps currently.

Right now, I have a normal health bar, but I want a player to be able to add health to his health bar when certain items are found and picked up.

What is the easiest way to do this, anyone know?

Thanks guys!

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Simple add to the attribute you're using for the health total.

    In one of the objects you pick up add this to the rule in the item.

    Rule

    When overlaps and collides with (main actor)

    Change attribute player.health to player.health+20

    The last number can be any amount you want.
  • HexxissHexxiss Member Posts: 12
    Thanks! That definitely helped, but now another strange issue is coming up.

    So currently when the character collides with something, it loses health, and when it touches a health pack, it gains that health back, which is perfect.

    However, now should it collect a health back when it's at full health, if it gets hit again the health bar doesn't change unless it gets hit ANOTHER time. Almost like it has a hidden extra 10 health.

    Is there any way to max out the characters health at a certain point, so no matter how much health it collects, it will top out at a certain point?
  • carlblanchetcarlblanchet Member Posts: 755
    edited November 2012
    Lets say your life bar's max is 100 and each health pack is +10. ok.
    [When overlaps or collides with health pack AND health is < 91]-> add 10.

    Since you weren't telling the health bar to stop at 100 it was going to 110 when collecting a health pack at 100.
  • HexxissHexxiss Member Posts: 12
    Awesome! thank you both so much, it's all up and running good now!
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited November 2012
    Great! Seems like a good example for a GS logic video.
Sign In or Register to comment.