Download

Using DataTables with Text?

Hello,
being somewhat new to working with the Unreal Engine 4, but not computer science in general, I am carefully investigating how to do stuff in the UE4. Doing so, I encountered DataTables which are a neat way to organize data. However, when I tried to create a dummy setup, I suddenly run into a problem that I am unsure how to solve and I would appreciate if you could help me, please.

My goal is to create a book object, which has a title, an author and content. Therefore, I have a user-defined struct called BookStruct, which has three members, Title, Author and Content. All three members are of type Text, since these strings should be localized. Then, I have a DataTable called BookDataTable which is based on my user-defined struct BookStruct, thus containig entries for all my books.

However, here the problems start concerning creating entries for my BookDataTable. Since I use Text and not String, I cannot simply enter a value, but have to reference another table, appearently, as it does not allow my to directly enter values as when I use Text elsewhere. Thus, I have to create a StringTable, respectively for Title, Author and Content, resulting into BookTitleStringTable, BookAuthorStringTable and BookContentStringTable. Now I can create entries in my BookDataTable by referencing to these String tables. As it should be quite obvious, this is very tedious, as it requires you to edit three different tables seperatly, then linking them together in the data table.

Is this really an appropriate solution for my issue, is this how you do it when you organize localized text in data tables, creating seperate StringTables and then referencing to them from the original DataTable?

One different solution that I would like to investigate is using String for my user-defined struct and therefore for my DataTable, but then localizing the DataTable as asset? Then I would only have one asset per culture (?) which contains appropriate entries for all my books. Would this be a better solution, being preferable abut my current approach?

I ended up localizing the data table and I am going to do that for every data table and string table in the future when they need to be localized unless someone tells me otherwise, hoping that this is an appropriate approach.