Monday, 22 January 2018

Week 17

Week 17:


HND Project

This I am going to continue working on the “Health System”. This time I will be focusing on the Player’s Health. I shall also be creating a “Score System” of sorts to keep track of how many points the Zombie AI are worth. To start with, I proceeded to create a new “Float” variable named “HP” with a value of “100” in the Event Graph for the FirstPersonCharacter.



I then created the above the code with the “HP” variable. In effect, this piece of scripting tells the UE4 when the Player is taking damage and how much damage they are taking, and finally when the health meter reaches zero the Player will then have died and the whole level shall restart. 


I also had to edit and reconfigure the “Enemy Chases Player” coding in the Zombie AI’s “Event Graph” to allow the above coding to have any effect, like so. After this, I then when back into the “FirstPersonCharacter” and went to create the “Score System”. I did this by creating a new “Float” variable I named “Score” and then built a code around it, and added onto the “Gun” code to show the score.


After this, I then tested it out and then reconfigured the code after I realized I wasn’t getting the results that I wanted. For example, the “points” I received for destroying the Zombie AI. However, though, I noticed the score were simply multiplying everytime I hit the Zombie AI and thus, I realized I had to edit the code onto the Zombie AI’s health code after I had done this. You can see the improved code I wrote below.




No comments:

Post a Comment