Packaging game - custom files

Hi :slight_smile:

In my game I am reading some data from text file. I store it in “Content/Data/” directory and access it through path: FPaths::GameDir() + FString(“Content/Data/unlocks.dat”)

Loading code:

FFileHelper::LoadANSITextFileToStrings(*(FPaths::GameDir() + FString("Content/Data/unlocks.dat")), NULL, lines);

Everything is working fine when I’m playing inside editor, but when I package the project, my game is unable to load the this file. Is it even added to the .pak file beign created? If it is, how do I access it? I want to have it in .pak file because I don’t want users to modify it(At least not easily :D).

How should I deal with this situation?

Answering here even if it’s very old because this is something I stumbled on google looking for the answer myself.
I found the solution via this post:…kage-txt-files

It’s a bit tricky to find. But all you have to do is go to the project’s packaging setting’s:


Then you have to expand the first section to find the “Additional Non-Asset Directories to Package” option.
There you just add the directory with the custom/non-asset files you want to include in the package.
It’s really easy. You just have to know about it (and find it). :wink: