Game cannot find files when packaged as a .love file

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
DPS2004
Prole
Posts: 10
Joined: Thu Jan 23, 2020 8:05 pm

Game cannot find files when packaged as a .love file

Post by DPS2004 »

Hello.

It seems when I package my game as a .love file, love2d has trouble finding files within it. If I run the game directly from main.lua or from the folder, it runs just fine. But when I try to run it from the .love file: I get the following error.

Code: Select all

Error

cannot open obj/bootscreen/sweep.lua: No such file or directory


Traceback

[C]: in function 'dofile'
states/bootscreen.lua:15: in function '__NULL__'
lib/gamestate.lua:43: in function 'switch'
main.lua:103: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
This does not make much sense, since if I unzip the .love file or look in it using 7zip, I see that the file does exist. Image

Any help is appreciated.
Attachments
obnmdx.love
the .love file in question
(17.75 MiB) Downloaded 79 times
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Game cannot find files when packaged as a .love file

Post by grump »

dofile doesn't know how to load from .love files. Use love.filesystem.load or loadstring, or require.
DPS2004
Prole
Posts: 10
Joined: Thu Jan 23, 2020 8:05 pm

Re: Game cannot find files when packaged as a .love file

Post by DPS2004 »

Thank you so much for the answer!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest