Setting Actor Properties via Datatable

I am now working on Items in my game and will be using DataTables to set the actor information. The idea is to not have to set each Actor each time I create an Item. I can Create the Item, call the DataTAble RowName and use that to set the properties.

I know how to set the struct FItem : FtableRowBase, to make the Datatable and add it to the Actor to be referenced.

I am wondering if I can use the Datatable to set the Actor Properties automatically. What I am thinking is to have the Actor properties set by Function using the Datatable to set everything and call that through a DataTable Row Variable.

For instance

ItemData = ItemDataTable
static const FString ItemNameString =(“ItemName”)

Variable = RowName
Function ItemName:
{
ItemDataTable->FindRow(ItemName, ItemNameString, true);
}

could something like this work?

I would imagine so. Have you attempted this yet?

I have been working on it yes. I have am having middling success. Have never tried something liuke this before and am a but fuzzy on the Syntax’s and if I need to do it as a Function per property or if I can do it all at once through a single function.

I have tried it through a tutorial I found where the creator does it for the WeaponName, but he only uses it for that. I am trying to get it for all of the Item Properties.

I will be trying a Single function now and can give results when completed.

So, I have yet to find a solution to this.

I get get the DataTable in C++ but to get the Row to set the Actor properties, I cant figure that out.

I know to do
WeaponDataTable->FindRow(), but where I cant figure out the answer is how to get the RowName without adding it to C++ every-time I create a new Row.

I have found out that I can AddRow, and I am wondering if I can use this to create the Row in .csv, import and have it set the properties.

I have seen MANY BP projects where you can create the DT Row, set the properties, create the BP_Actor and add the DT to the Actor.

That is what I am trying to accomplish.

I found the FDataTableRowHandle through research.

This asks for a DAtatable and the Row. I am testing to see if I can use this to set the weapon Properties via the Datatable.

Privacy & Terms