I am trying to read an XML file at runtime. The file loads perfectly when I use the absolute file address but not when I want to use a relative address.
File is being read in C++, a button press in blueprints kicks off the process.
What relative path should I be using? Am I missing somewhere that the file should be packaged in?
Sorry if this is a duplicate questions. Search for anything with the word relative here brings up irrelevant content.
You will probably have to use the path /Game/XML/TraitsXML.xml. /Game representing your Contents directory.
Edit : It seems a little more complicated in facts… : https://answers.unrealengine.com/questions/78360/adding-flat-file-as-asset.html
Ugh, that’s a little more work than I’m willing to put into a weekend side project. I might just convert it to a CSV and put it in a data table.
Will pay around with it a bit more.
Yea, ended up cutting the Run-time functionality and cooking the content in as DataTable. For the brave and crazy future devs trying to do the same thing and can’t cut the feature see here:
You might be able to do something like
GetLowLevel().GetFilenameOnDisk("file"). Never tried it though.