Announcement

Collapse
No announcement yet.

Health/Damage systems

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

    Health/Damage systems

    So i hear that Unreal Engine 4 does not support scaleform so my quest is. How can i use blueprints to make a health bar?

    I have textures and i have been able to figure out how to get them to show with Draw texture. But how would i go about getting blueprint to remove part of the texture when taking damage.

    if anyone has any ideas i would love to hear them. :P

    #2
    There's a great example included in the hud level, under the content examples. It's basically a material tied to a float. I also suggest watching the networking blueprint tutorials, as they give a great foundational understanding of how a lot of things work in UE4.

    Comment


      #3
      Originally posted by Havoc View Post
      There's a great example included in the hud level, under the content examples. It's basically a material tied to a float. I also suggest watching the networking blueprint tutorials, as they give a great foundational understanding of how a lot of things work in UE4.
      I have looked at the example several times now and i just cannot understand it do you know of any tutorials that could help me understand it better.?

      Comment


        #4
        Hi Firezown - I too am distressed with the absence of Scaleform and even went as far as to try an implement CoherentUI but I am just not much of a coder and it is a bit pricey for me right now anyway.

        I have found fractured tutorials here and there with bits and pieces but ultimately nothing to be overly excited about.

        In a project I have been discussing on the forums one user seems to have done something similar to what you are referring to. have a look here:

        https://forums.unrealengine.com/show...ling-Up-A-Stat

        AND HERE:

        https://answers.unrealengine.com/que...ement-and.html

        In the second link there is even a video. Hope this sets you in the proper direction.
        Mike "Z"
        UI / Game Designer
        LinkedIn

        Comment


          #5
          The ContentExample project might seem difficult, but its actually fairly straight forward once you realise how things are connected. All you need to look at is the HUD blueprint and the health bar material.

          The material does most of the hard work; it basically draws your health bar from the maximum health with one texture, then colours in a percentage of it with the second texture, based on your current health. All you need to do then is let the health bar know your current health. I don't have Unreal to hand, but I found this shot that basically shows you how to do that.

          Click image for larger version

Name:	Health.jpg
Views:	1
Size:	70.7 KB
ID:	1050353

          In here, its calling a function from your character blueprint to get the player's current health (for testing purposes, you could just get a float/integer variable and set it to a random value below your max health). The important bit is the scale parameter and making sure that the parameter name matches the name in your material. This will tell your health bar how much health you currently have and thus give you your working health bar.

          Taking damage is something else that you would set up to impact your health value in the character blueprint.

          Comment


            #6
            I have created a working experience bar which is the opposite of what you want but I just tested it by setting my experience to full and subtracting from it for the result you want. When I get home today I will write up a tutorial for both if someone else doesn't help you by then.

            -Haka
            Movable Widgets

            Comment


              #7
              Thanks guys, ill try these things later tonight when i have a chance to. And Hakabane i would love a xp bar tutorial and im sure alot of other people would too.

              Comment


                #8
                Originally posted by Hakabane View Post
                I have created a working experience bar which is the opposite of what you want but I just tested it by setting my experience to full and subtracting from it for the result you want. When I get home today I will write up a tutorial for both if someone else doesn't help you by then.

                -Haka
                Seconded! Would be cool to see that tutorial...

                Cheers,
                Michael
                VFX & AI
                http://www.team-imx.com

                Comment


                  #9
                  I poured concrete today with my dad so I'm beat, it will still be a couple hours yet but hopefully I can make something worthwhile that people can use and adapt. But I will write up a tutorial and post it as its own thread, similar to my item system.

                  just to show some basic screen shots:

                  Click image for larger version

Name:	EXP1.PNG
Views:	1
Size:	618.1 KB
ID:	1050387
                  Click image for larger version

Name:	EXP2.PNG
Views:	1
Size:	681.9 KB
ID:	1050388

                  edited for screens as an after thought
                  Last edited by Hakabane; 05-01-2014, 07:22 PM.
                  Movable Widgets

                  Comment


                    #10
                    Originally posted by Hakabane View Post
                    I poured concrete today with my dad so I'm beat, it will still be a couple hours yet but hopefully I can make something worthwhile that people can use and adapt. But I will write up a tutorial and post it as its own thread, similar to my item system.

                    just to show some basic screen shots:

                    [ATTACH=CONFIG]1583[/ATTACH]
                    [ATTACH=CONFIG]1584[/ATTACH]

                    edited for screens as an after thought
                    That looks really good, does the xp scale with levels?

                    Comment


                      #11
                      Yes, there is a function dedicated to making the EXP needed scale with your level. With some really basic math you change it. For my base need though I just set it to increase by 500 exp per level.

                      Anyhow, I'm finally sitting down to write this up for you and everyone else who needs it.

                      Cheers,
                      Haka
                      Movable Widgets

                      Comment


                        #12
                        Originally posted by Hakabane View Post
                        Yes, there is a function dedicated to making the EXP needed scale with your level. With some really basic math you change it. For my base need though I just set it to increase by 500 exp per level.

                        Anyhow, I'm finally sitting down to write this up for you and everyone else who needs it.

                        Cheers,
                        Haka
                        Ok, Thanks looking forward to it

                        Comment


                          #13
                          Here is my new post if you don't see it first.

                          https://forums.unrealengine.com/show...6324#post26324
                          Movable Widgets

                          Comment

                          Working...
                          X