Page 1 of 1

Default roaming folder not created

Posted: Mon Mar 21, 2016 2:34 am
by totalvamp
Hi, I'm trying to make a save file system, but I can't access the default folder.

It isn't created when calling the script so there is no save folder to go to.

Code: Select all

C:\Users\<username>\AppData\Roaming\LOVE
This folder does not exist and does not get created when running the game (starting in console).

I created it by hand now, but even then I can't make a new folder inside with mkdir

Is there any way to let the game make this folder?

This is the current code:

Code: Select all

function loadGame:enter()
    local files = ''
    love.filesystem.mkdir("SpaceSim")
end
It will give the "attempt to call field mkdir (a nil value)

Re: Default roaming folder not created

Posted: Mon Mar 21, 2016 4:37 am
by slime
The save directory won't be created until a file or folder is created by LÖVE.

love.filesystem.mkdir was renamed to [wiki]love.filesystem.createDirectory[/wiki] a couple years ago, in version 0.9.0. If you're using a tutorial and it's telling you to use the old function, it's probably a good idea t look for a newer tutorial.

Re: Default roaming folder not created

Posted: Mon Mar 21, 2016 11:25 am
by totalvamp
slime wrote:The save directory won't be created until a file or folder is created by LÖVE.

love.filesystem.mkdir was renamed to [wiki]love.filesystem.createDirectory[/wiki] a couple years ago, in version 0.9.0. If you're using a tutorial and it's telling you to use the old function, it's probably a good idea t look for a newer tutorial.
That was the problem, I was trying to read files inside the save file folder to check for save files (I will use separate files for every save), but since the directories did not exist yet, it would throw out an error.