FPaths, FFileHelper and IFileManager after packaging
In order to allow the player to add custom simple dialogue chains to the game, I created a new plugin and added the following two blueprint nodes - one for finding all txt files inside a 'Mods' subfolder inside Content folder, and another to read these txt files:
These blueprint nodes work perfectly for me when I play in editor - the txt files are found correctly inside the Mods folder, and their contents are converted to strings as expected.
However, both of these function return false as soon as I package the project (with the Mods folder manually copied into the built game's Content folder).
Is there anything I could do? Or is it hard-coded that the packaged game cannot read external files?
Thank you so much in advance!
I have a same probleme. I'm too in UE4.18. I see https://wiki.unrealengine.com/Packaged_Game_Paths,_Obtain_Directories_Based_on_Executable_Location But not work. How do ?
answered Jun 30 '18 at 08:45 AM
While I know this is an old question, I recently encountered and solved the same issue myself. BTW, this issue has been around since 4.10 at least; and is present all the way through 4.19. My issue was that when I would package my project from within the Editor, any File Management functions for validating things like "FileExists" or "DirectoryExists" always returned false.
This behavior could not be seen when playing in Editor or StandAlone launched from the Editor.
The solution is to Package the project from the UE FrontEnd tool. All of my file management functions continue to work without issue then.
Important Note: The UE FrontEnd is a program (Binary) that you build from the Engine Source Code VS Solution. Once the FrontEnd program has been built from source (in Visual Studio for example), then you will find its EXE under the engine binaries like the UE-Editor. If you're using the public (non-source) engine that you downloaded via the Epic Launcher; the FrontEnd will not be available to you, even if your project is c++ based.
Follow this question
Once you sign in you will be able to subscribe for any updates here