I’m refactoring my save system in order for it to work in the bundle.
I’m using sys.resource, and managed to get a output, similar to a File:open() call, however, It cannot be read with File:Read() or any other File Component
This would break every part of my saving system
Is there a way to convert sys.resource() into a readable file? or some alternative which would preserve the File property?
SaveAPI.RoomFilePaths = {
UNIVERSAL = "RoomFiles/UniversalRoomFile",
TEST = "RoomFiles/TestStageRoomFile"
}
function SaveAPI.OpenFile(Path,Type)
local ReadType = "r"
if Type ~= nil then
ReadType = Type
end
local Filepath = sys.get_application_path() .. "/".. Path .. ".json"
print(Filepath)
local File = io.open(Filepath, ReadType)
return File
end
But the File always equals nil, I’ve tried it as a part of a custom resource and without, why is this code incorrect. Either the Url is wrong, which shouldn’t be because
You need to put your files in either common or a platform specific sub folder.
Also, the field is called Bundle Resources which means that the files under that folder will only be included when you do a Project->Bundle, not when you do Project->Build.
In general the recommended approach for working with save files is to use sys.get_save_file() and sys.save() and sys.load().
Based on the filenames in your screenshot it seems more like some kind of game or level config files and not save files?