Edit Data table rows during gameplay - Blueprints

So I’m just starting to work with Data tables and so far I’ve really liked the flexibility of it for sourcing data.
However, I’ve come to a bit of a wall in regards to setting the data in a defined row.

The way I currently have the data table is one of the fields is an int, and depending on what that int is, it changes the color of some text. It works perfectly when I pre-define what that number is, but I need to be able to change that value during gameplay, and save it too.

Is this currently possible?

Cheers,

I’ve been digging around most of the day, I can’t seem to find anything on this. I’ve added a tag of Feature Request just in case this isn’t currently possible.

I second this, can’t find a way either and would be a very powerful tool.

I am also looking for this.

I want to add new rows when playing.

Have you guys found anything ?

I am also in for this feature.

im in for this as well

how can this not be a feature? I want to save data on the fly and not be restricted by struct errors every time I want to change something(I want to use datatables as a way to create scalable sub-structs that can be changed in run-time without overhead of actors that don’t have that field, let alone data for it. This appears nearly impossible unless I create a layer of code that breaks string data -from datatables- into an array and then foreach-loop a check on in-game values). Wasting loads of my time getting around struct limits in BPs.

I’m in for this as a feature request, as I"m sure, like everyone else, I have tons of uses for this, BUT, I messed around with this for over 4 days, and finally decided that for my immediate needs, I would do something different. Because in truth, one cannot really update the table data. Note when you look at the Set Row, that there is NOTHING allowing you to actually set the row, you can put in the table name (which has to be a literal, because no table name type exists, and there is no input pin, for the actual data to set the row too). Setting via category is not that much better ( a bit but not tons), as it lets you set the data (for all the rows), but, how are you then going to actually tell the compiler I want to save the data?

This should be as high on the development priority list as possible.

Hi everyone,

Thank you for your request. I have entered a feature request, UE-21490, to be considered by the development staff.

,

Thank you very much for doing that. If there is a feature request, then to help flesh it out some, here are some ideas

  1. Able to replace an entire row with new data, and having the ability to pass it in as a structure, if the structure has null values, keep them.

  2. Able to replace 1 specific column, for 1 specific row.

  3. If we are going to go all out, have a simplified SQL style select syntax. By simplified, I mean no inner/outer joins, or sorts, groupings etc, just simple
    Select X from “Structure/DataTable” where Colx = yyyy, and all the data is treated as string data. Of course including != and boolean operators of And and Or,

Have the select statement passed in as a literal or string variable. In truth it would also be nice to be able to Associate a Structure to a Data Table implicitly in some fashion. Such that using that variable from that point forward, one didn’t care so much about the Data Table.

A node to give out information concerning the Data Table would be nice as well.

  1. Last time of update to the data table
  2. how many columns
  3. how many rows
  4. what are the column names

Just some things off the top of my head,

Again thank you!

my two cents, i would like to be able to get a csv file from a sever and update en-mass the data tables at runtime, like at the start of the game… for things like unit/character balancing.

Has something changed? Can we change data in datatable while running a game(BP or C++ way)?

I’m looking for the same thing…

I need this system too

One more asking for that here!
Any news?

if you would like to see this feature added, it might be helpful to go to the issue tracker tyope in the ue-2190 issue listed above(or go directly there using this link https://issues.unrealengine.com/issue/UE-21490 ) login and vote for it; if we get enough requests the Devs should bump it up the priority list.

For 4.16 they plan to make data table variables. Most probably this feature will come with it, but surely not sooner.

I think its possible.
But it would not work (crashes) if you plan package game for publish (PSN, Steam, AppStore, GooglePlay) bcoz of datatable asset no has access to write in final packaged game. its static data as well as any another asset in packaged project. I know some windows-people think like “ok i just write to file” but in theory YES its possible on develop project stage (around Engine pipeline) only. And NO in practice if looks wider on all platforms (os platforms and privileges on end user device/OS).

Just simple example - game started from DVD or another rom and game no has ability to check self for permissions (just no has checking procedure for app, some OS/Consoles strict that calls)? What does engine could be in that case? You lucky if app will continue with just buggy/laggy or glitches but in most of cases it will be CRASHED :smiley: Bcoz your “smart” code want to do something in image/rom or like malware style actions…

Every OS provide user app folder - special shared folder for write/delete files or another DLC stuff of that app (“app cache” or “app data” depend of OS). So developers use that special “user app data” folder for writing some stuff (specially for support gameplay writable stuff like SAVEGAME files etc.) which would be work on every platform. On most of platforms the packaged app can’t change self (write/change, in executable folder of app) for security reasons like on X based systems (iOS/Linux/Android/OSX/PS). And i know windows users doesn’t care and doesn’t understood bocz usually in windows default user is admin’s privilege user and can to do anything with all files in system (maybe in latest windows8/10 security politics changed but the same way)…

So:

  1. easy way - just to use savegame file (slots) functions.

  2. extend engine for self by plugin-module extension (c++ plugin)

  3. or hardest way - direct in source of engine (so crazy for debug)

in 2 and 3 cases you can inherit DataTable class and write your own code for create/save/change data in that asset type and use “app data folder” for that operations, checking how it works in EngineEditor stage or PIE stage or run in realtime packaged game stage.

And be care - PIE (play in editor) and packaged game (cooked) not same runtime and you must to know how it works in complex for debug your own engine module in Editor and Runtime (PIE/package).

There is also the approach of using an Array or Map (Which allows for a custom ID, ie Key type) and place that in a Global variable like the GameInstance or the GameState. This is what I am currently using in one of my games, to store data about certain items, the Key is the Item’s class (which means I can easily retrieve data at runtime using classes) and the Value is a Struct that defines said item. I can easily access the Map, can use it for saving and loading, and for pre-defining data.

Basically a Map where:
Map

EDIT: Oups, sorry for posting on an old question.

I understand the reason that make not work in all platforms the data table, but will be possible to create a kind of asset that or an option for data takes that allow storage a copy of it, that can be changed on the appdata folder one the game is packaged? So if this one is missing it will use the original from the pack, but if there is something on modified is saved for any platform.

Or if not just the function for the editor only. So at least while we are developing we can quickly modify and save that data without been copy posting in a very primitive way.

Thanks