Game works in editor, but crashes when packaged. Potential DataTable issue?

Hey, so I have a game that loads data from 2 DataTables that are tied to csv’s. This works fine when "Play"ing in the editor, but when I “Launch” it, I get a fatal error and a log full of “Couldn’t find file” errors. Here are the errors for one of my DataTables, but its happening to both.

LogPlayLevel: ForestOfTerror: [2017.03.30-15.48.34:856]  0]LogInit:Display: Starting Game.LogStreaming:Error: Couldn't find file for package /Game/DataTables/Level1ScreenData requested by async loading code. NameToLoad: /Game/DataTables/Level1ScreenData
LogPlayLevel: ForestOfTerror: [2017.03.30-15.48.34:887]  0]LogStreaming:Error: Couldn't find file for package /Game/DataTables/Level1ScreenData requested by async loading code. NameToLoad: /Game/DataTables/Level1ScreenDataLogUObjectGlobals:Warning: Failed to find object 'DataTable /Game/DataTables/Level1ScreenData.Level1ScreenData'

Here’s the code where I’m loading the table.

FString ScreenPath = TEXT("/Game/DataTables/Level1ScreenData.Level1ScreenData");
ScreenData = Cast<UDataTable>(StaticLoadObject(UDataTable::StaticClass(), NULL, *ScreenPath, NULL, LOAD_None, NULL));

Any ideas why it might be having issues?

what platform are u using to launch game? And are you using BP datatables?

Windows, and I’m not sure. I have a csv tied to my datatable, which uses a C++ UStruct for the field structure. I can open the datatables themselves from my content browser, though.

Your data variable u made is in class default, so i think u should put those loading code in Construction of that class to make it work :smiley:
Edit: nvm, tested it outside Construction and it still work.

Having a bit of trouble understanding, do you mean that the loading code needs to be in any classes constructor, or are you talking about some class related to the data tables that I don’t know about? My loading code is currently in a class that doesn’t have any tie to the data tables (outside of using their data).

Also, what do you mean by class default? The default constructor? If the data tables make a class, I don’t know anything about it. I only created the UStruct.

Class default is the property of that class, let say u make a variable type float and name A in that class, so A will be a property of that class, but if u get class default, it only return the value u give to it in Construction, or in Header file :D. At 1st, i though when building the world, game have to load all asset, but after testing, it can be load in runtime so, i dont know about your problem. But onething i want to sugget, is that u should use Blueprint to refer to Anything in your game, dont use C++ to load asset because i have done it and sometimes, when u package your game, some asset will not be load, and u will not find the answer anywhere.

Might be obvious, but did you add your datatable .csv files in your packaged game?

I hadn’t added the .csv’s since I figured the info was saved in the DataTable itself, but I just added the directory to my “Additional Non-Asset Directories to Package”. Same error still. I’ve also tried turning “Level1ScreenData.Level1ScreenData” into just “Level1ScreenData” and it still works in the editor, but no luck on launch.

Some more potentially relevant parts of the errors.

Fatal error!
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000030
ForestOfTerror.exe!UDataTable::FindRow<FObjectLookupTable>() [d:\epic games\ue_4.15\engine\source\runtime\engine\classes\engine\datatable.h:120]

That address seems really low, is that normal? I verified that FindRow is only looking for strings that exist in the table.

You have messed up redirectors or invalid asset references in your project.

Welp, I was messing around with project settings and switched data build to “By the book” and now everything is fine. I think the errors were misreporting some other issue.