Hi guys.
I’m haveing a bit of trouble wrapping my mind around how to access data from a data table in blueprints based off of variables and I hope that the awesome Unreal community can help me out.
My setup is as follows. Every weapon in the game has a Damage Class (DC) ranging from 1 to 10. Every enemy has different hit areas. When a weapon is fired, the line trace returns which body part is hit and from that result I want to get the actual damage dealt from a data table.
The structure of the table looks as below.
,DC1,DC2,DC3
Head,20,40,90
Neck,25,45,100
Hand,5,10,20
Foot,7,20,40
So I have two stored variables, one holding the DC of the weapon and one holding the bodypart hit by the weapon. How to I get the value corresponding to these two values, in blueprint if possible, otherwise in C++?
Example1: The pistol with DC2 hits the neck of the enemy. I want the value of 45 returned from the function.
Example2: A rifle with DC3 hits the hand of the enemy. I want the value of 20 returned from the function.
To I have to get the info by row name based on body part and then do a select based on the DC or can I somehow do a direct lookup based on the two variables and get the return value?
Thanks in advance!