Announcement

Collapse
No announcement yet.

Health bar test, Simple damage via trigger.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Health bar test, Simple damage via trigger.

    Hello peoples. I have a HUD with a health bar and I want to test it.
    How would I go about doing this?
    I have a the fire asset in the scene and a trigger volume over the fire.
    Click image for larger version

Name:	fire trig.JPG
Views:	1
Size:	31.2 KB
ID:	1137236

    In my level Blueprint I have this:
    Click image for larger version

Name:	fire trig bp.JPG
Views:	1
Size:	42.3 KB
ID:	1137237

    The print "OUCH!" works fine but the player doesn't receive damage. I'm new to Blueprints which seams quite different to kismet.

    how would I get this working? thanks!

    #2
    Try dragging the Other Character pin to the Damaged Actor pin. I'm not 100% familiar with damaging characters, but that's the first thing I'd attempt.

    Also, it's best to put the Print String after the thing you want to test so you know if it got stuck before that spot. In your example, the string will always print despite what damage is done.
    Gooner44
    Cribbage Sample Project on MP

    Comment


      #3
      Hey, I did what you said but it doesn't seam to work. I also put the print string after the damage and it still shows up as "OUCH!" but doesn't deal damage!

      :S any ideas?

      Comment


        #4
        Just tried this in the ShooterGame sample and you need to hook up a 'GetPlayerCharacter' to the 'Damaged Actor' pin in the 'Apply Damage' node. Here's an image of what it looks like for me:

        Click image for larger version

Name:	Damage.png
Views:	1
Size:	44.5 KB
ID:	1053285

        Also, connecting 'Other Actor' from the trigger worked for me as well and is likely safer to do since you may have changed your player index. I always make sure it's set to 0 for my SP games, but I think MP requires multiple for each player.
        Last edited by Gooner44; 08-07-2014, 03:08 PM.
        Gooner44
        Cribbage Sample Project on MP

        Comment


          #5
          Click image for larger version

Name:	overlaphurts.jpg
Views:	1
Size:	63.2 KB
ID:	1053286

          Gooner is right about that. You could also plug the Other Actor right into Damaged Actor, so that anything that has health that enters the volume will be hurt. That is good for environmental damages, like fire or spikes.
          Twitch /unrealalexander| Twitter @UnrealAlexander
          How to report a bug? | Installation & Setup issues?
          Call me to a thread by posting this: [MENTION]Alexander Paschall[/MENTION]

          Comment


            #6
            Hmmm that is very strange. I have a health bar but I don't think the actual health is set up for my character. How would I go about doing this?
            https://www.youtube.com/watch?v=s423ydn3t_E
            This tutorial breifly goes over the Health bar but doesn't specify anything to do with the actual pawns health.

            Comment


              #7
              In the defaults of my pawn there is this:
              Click image for larger version

Name:	health.JPG
Views:	1
Size:	39.9 KB
ID:	1053300
              At the bottom there is health. If I set this to 100 still nothing happens.
              I must be missing something

              Comment


                #8
                We have to select a Damage Type (You can select the default damage value). I think that you have to enter the Event investigator (To your self) and/or Damage causer (To your component) too.

                Comment


                  #9
                  Hey, I have just tried that. Here:
                  Click image for larger version

Name:	fire 1.JPG
Views:	1
Size:	35.2 KB
ID:	1053307 Click image for larger version

Name:	Fire 2.JPG
Views:	1
Size:	37.7 KB
ID:	1053308
                  None of them work, though i am pretty convinced its something to do with my player need a health value or something..... maybe?

                  Comment


                    #10
                    Try going back to your first setup, connect the Other Actor pin to the Damaged Actor and set the damage to 10000. Does the player die then? Sounds like your issue is the HUD display of damage taken, not the actual damage node.

                    Also, what type of project are you using? In ShooterGame, no damage type is needed and just the trigger and damage nodes are needed to do what you're going for as I showed in my screen above. Even without the GetPlayerCharacter node. Would be helpful to know the project you are working with since they are all set up slightly different.
                    Gooner44
                    Cribbage Sample Project on MP

                    Comment


                      #11
                      Ok I've set the damage to 1000 and the player doesn't die.
                      I'm using the third person blueprint project template if that's what you're asking.

                      Thanks

                      Comment


                        #12
                        I might be wrong on this, but if I recall correctly, the current Character implementation does not even have health (unlike the one in UDK). So in order to display health or to take damage, you actually have to create variable that stores the health of your pawn in the first place.

                        Comment


                          #13
                          In the pawn defaults there is a Health section, which was set to 0.0 but now I've set it to 100 and still nothing happens.
                          Click image for larger version

Name:	PawnDefaults.JPG
Views:	1
Size:	84.2 KB
ID:	1053310

                          Comment


                            #14
                            In your character bp you should have a health variable (otherwise create one) -> add it to the event graph -> and then set up something like this -> play the game -> on the screen you should see some messages:

                            Click image for larger version

Name:	message.jpg
Views:	1
Size:	299.2 KB
ID:	1053314

                            now we know if it doesn't work because of the hud or a bug/error/other stuff ^^

                            Now do the same with the damage:

                            Click image for larger version

Name:	damage.png
Views:	1
Size:	276.0 KB
ID:	1053315 (the event is fired when a apply damage is activated in my sword bp)


                            When you dont have anything from what I show above you will have to create a health and damage system first before you can create a health bar ^^
                            Last edited by fighter5347; 08-08-2014, 01:00 PM.

                            Comment


                              #15
                              Hi!

                              In the character blueprint when I add the health variable like you showed the repeated message "health:100" appears flowing down the left side of the screen.

                              I think I did the second part correctly (I added it to the character blueprint)

                              I walk though the fire and the message "health-70" prints on the screen and then if I walk through again the message "health100" prints on the screen.
                              Ill add that I've set the fire to deal 30 base damage.

                              Still my players health does not decrease.
                              Last edited by AutoLiMax; 08-08-2014, 01:31 PM.

                              Comment

                              Working...
                              X