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: 264
Joined: Sun Feb 05, 2012 6:51 pm
Location: Valencia, Spain
Contact:

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

Post by molul »

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: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

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

Post by ivan »

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: 4946
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 »

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: 264
Joined: Sun Feb 05, 2012 6:51 pm
Location: Valencia, Spain
Contact:

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

Post by molul »

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: Bing [Bot], Google [Bot] and 50 guests