Hi all,
I'm having a little trouble with loading the information from a text file using FileAccess.GetFileAsString - I'm using a res:// path and DirAccess.GetFilesAt to get a list of files in a path, and then process them. The problem I'm having is that whilst GetFilesAt does return a proper list of files in that path, passing a concatenated path to GetFileAsString is throwing "The Filename, directory name or volume name syntax is incorrect".
The path it's returning in the error message is a strange mashup of what I'm actually passing - for example, the search path passed to GetFilesAt is "res://WorldData/Factions", and concatenating one of the results gives "res://WorldData/Factions/Madeupistan.faction". The error message I get back complains about a path that gives the absolute OS path to the project, and strips the file extension: "c:\Users\Spugnut\repos\Project\Madeupistan".
I know that the whole use case is probably better handled using the inbuilt resource system; but the project stakeholders would like to keep the backend code portable, as Godot is only being trialled at present.
I have that grim feeling I've missed something obvious, and am really hoping that's the case - any guidance gratefully recieved.
Many thanks!