XML - relative file path

I would like to use XML file as database for game text content.

I have found in UE4 documentation class FXmlFile for parsing XML files. It works great. Problem occurs when I want to package my project and can no longer use absolute file paths.

How do I determine the path to packaged XML file for method FXmlFile::LoadFile()? Are XML files even used for UE projects? I was surprised that I could not find an answer with google.

Not sure if this is Epic’s preferred way for you to do this but you can use FPaths::ProjectContentDir() to get the project’s content directory and in your project settings add the folder that contains the XML to "additional non-asset directories to " copy? I forgot which one, try each.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms