Can I change LÖVE's default save directory?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
molul
Party member
Posts: 247
Joined: Sun Feb 05, 2012 6:51 pm
Location: Valencia, Spain

Can I change LÖVE's default save directory?

Post by molul » Fri Jun 22, 2018 6:24 pm

I finally managed to make LÖVE run on a Rockchip RK3066 with Linux, but I'm having problems with love.filesystem.setIdentity().

I have this:
love.filesystem.setIdentity("/tmp/myproject")

But LÖVE tries to write on "/home/root/.local/share/love/tmp/myproject" instead.

That directory doesn't exist on the Rockchip board, and I can't create it because /home/root is read only.

Is there any way to set the save directory to "/tmp/whatever" on LÖVE's latest versions? I read this topic and apparently is not possible, but it's from 2014, so I thought I could ask.

User avatar
ivan
Party member
Posts: 1315
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Can I change LÖVE's default save directory?

Post by ivan » Fri Jun 22, 2018 6:42 pm

Yes, you can but you must be running in fused mode.
Furthermore, dont use tmp/whatever, the identity you set acts as the folder name where data is saved. Treat the identity as a label, it's not a filepath.
Last edited by ivan on Fri Jun 22, 2018 6:45 pm, edited 2 times in total.

User avatar
bartbes
Sex machine
Posts: 4942
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Can I change LÖVE's default save directory?

Post by bartbes » Fri Jun 22, 2018 6:43 pm

The easiest way is probably to set either the XDG_DATA_HOME or HOME environment variables. If you set XDG_DATA_HOME to /tmp/whatever, you'll find your game's save dir in /tmp/whatever/love/<identity> or /tmp/whatever/<identity> when fused. If you set HOME to /tmp/whatever, those paths will be /tmp/whatever/.local/share/love/<identity> or /tmp/whatever/.local/share/<identity> respectively.

User avatar
molul
Party member
Posts: 247
Joined: Sun Feb 05, 2012 6:51 pm
Location: Valencia, Spain

Re: Can I change LÖVE's default save directory?

Post by molul » Fri Jun 22, 2018 7:22 pm

EDIT: it DOES work

Not sure what I did, but it works now. Thanks a lot :)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests