Download

How do you package non-asset files (.txt, .bin) properly?

Hi all,

I have a couple .bin files that store my level data.
I just have a few questions, as my attempts to read them are not working when packaging. (everything runs perfectly if I manually set the directory in code, so the reading itself is fine)

  1. Where is the proper place to put the files in my project folder?
  2. How do I reference their path in my c++ code if the project is being packaged?
  3. Are there extra settings I need to apply for the files to be packaged to the .pak file?

Thanks so much,
Will

I am not able to drag-and-drop .txt files into the Content Browser either, unless said text file is actually a CSV that gets imported as a table. I would like to know the answer to your question. I have a text file with some item properties that I’m reading and parsing. That’s fine during development but I’d really like to NOT have that easily available for the player to pick through later.

@wnbaum, the easiest way to package non asset files with your game is to use the ‘DirectoriesToAlwaysStageAsNonUFS’ item in the DefaultGame.ini file…

Then just put all your .txt or .bin files in a folder that will get packaged. For example…

[/Script/UnrealEd.ProjectPackagingSettings]
+DirectoriesToAlwaysStageAsNonUFS=(Path=“TextFiles”)

@GBX_botman okay, I am able to copy files to my packaged project just fine, but is there any way I can put these files into the .pak file? Or will UE4 only pack .uasset files? Also I have discovered you can do this without the .ini file, by changing a setting under the advanced packaging settings under project settings.

Also, @playerbionika, if you are unable to pack non-asset files, then I guess I would recommend encrypting and decrypting your .txt or .bin files in the source files that get packaged themselves.

Thanks!

Text asset plugin