Armor system

So i want to make armor system. How will it work?

Make armor types, like steel, gold etc. Every **type **and part of equipment will have armor rating which will reduce incomeing damage.

For example, i have steel gloves = armor rating is 5 and incomeing damage is reduce by 5.

How can i make this system?

Help will be much appreciated.

Possible way:

  1. Create two enumerations E_ArmorType and E_EquipmentType (naming is up to you) and add the desired amount of elements to each of them.
  2. Create structure S_Armor (again naming is up to you), add 3 elements to it - 2 enums you have just created and integer/float to store armor rating.
  3. Create data table DT_Armors, open it and create as many rows as you need and set up their data (you can add more rows or edit existing later).

You can access data table row using GetDataTableRow node. Additionally, you can assign data from data table structure to actor variables.

The way I’ve described is quite vague and if you need some more help or details just let me know.

So i made armor type(steel), and for easch equipment slot i made armor rating for example: Steel helmet, armor rating 5.
Now i need to reduce incomeing dmg from AI.

Is there a way to calculate incomeing dmg from AI than minus the overall armor rating of the dmg reciver then resolve the loss of HP.

Like: AI dmg 20 - Armor 10 = -10 from HP

It is definitely possible.

Do you have some kind of equipment system?
If not, how do you know which equipment piece you should use for calculation?

It all depends on how do you store the “equipment” data.

I basically followed Titanicgames

I was going to screen shot all of the things i have but it would be like 20 screen shots.

Here is the download link of the original project: GitHub - TitanicGames/RPGProject: An example RPG project demonstrating some of the basic parts of RPG

Mby you can look it up?

The system you are using has got Armor structure(FItemInfo) already, you can expand it by adding ArmorType and other needed variables to it.
It also provides equipment system, so you may access equipped parts in CH_MyCharacter blueprint (variable Equipment). Then you can create a short function which will loop through all “Equipment” array elements and sum up its armor rating.

You can use it with the event ApplyAnyDamage. So whenever your character receives damage, you can subtract from it total armor rating and then reduce CurrentHealth by this amount.

Health&Damage system can be a pretty vast topic and there are various ways to implement it. Check some yt tutorials and then from the damage character is receiving subtract armor rating.

Well thats is the thing. I am Noob at this. I have so little knowlage about this but as i am trying new things on my own i start to understand a bit better all of unreal engine.

About the loop that will sum up all the armor rating, mby you can make example?
Same for damage?