Page 1 of 1

How do I make LOVE's filesystem prioritize searching the game directory?

Posted: Fri Dec 01, 2023 7:24 pm
by DTmg
I noticed some odd behavior when messing around with loading resources like images: LOVE 11.4's filesystem seems to prioritize searching for resources in the save directory over the actual loaded game's directory. What I mean by this, is when I go to read a file using any of the functions that follow LOVE's filesystem, if there is a file by the same name present in both directories the game chooses the one in the save directory. This wouldn't be so much of a problem for me if the require function didn't follow this same behavior, but when loading files using it the game also chooses the save directory over the game directory. This is the case regardless of if the game is packaged in a .love or not. Is there a way to change this to make LOVE prioritize searching the game directory over the save directory? I have searched through the wiki and looked for similar forum posts and didn't find anything.

Re: How do I make LOVE's filesystem prioritize searching the game directory?

Posted: Fri Dec 01, 2023 7:40 pm
by slime
This is a feature to enable easier modding and saved-settings-with-defaults support. You can change that behaviour with t.appendidentity = true in love.conf, or with love.filesystem.setIdentity.

That said, if you don't want game directory and save directory files to overlap at all you can just use different subfolder or file names for things in the game directory versus the save directory.

Re: How do I make LOVE's filesystem prioritize searching the game directory?

Posted: Fri Dec 01, 2023 7:43 pm
by DTmg
Ah ok, I completely missed that. Thank you, that solved the issue and I'm still able to access saved data when I need to!