Download

Data files and paths

In the game I’m working on, there will be a LOT of data - textual and otherwise - that needs to be stored in asset files, in XML. I’ve made a “Data” subfolder, and I can hardwire a path in the


FXmlFile( FString path )

API, such as “C:/dev/game/data/foo.xml”, but how do I specify a relative path? Is there a function which gets the game directory and I can concatenate “/data/foo.xml” onto it? Or is “data/foo.xml” sufficient to identify the file in both the editor and packaged versions of the game?

I think you can use something like this :


FPaths::GameDir() + "/data/foo.xml"

More informations about FPaths here : https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Misc/FPaths/index.html

I hope this help you ! :slight_smile:

Thanks Jackblue, that’s just what I was after!