Access data table based off of variables

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!

You will have to get the row based on the body part and break the result, and select the corresponding DC.

There is no way to do both with just one node, but even then this is a very simple function that only needs to be created once. With only 10 DCs you can just use a switch or something similar to select the right value. The entire thing should take like 2 minutes to create.

So, basically, I get the row by bodypart and connect the ten different outputs to a switch based of on an int and feed the weapons DC into the controller for the switch? Thanks, that should do nicely.