Page 1 of 1

[HELP] External File Problem

Posted: Fri Jan 23, 2015 4:11 am
by RaptrStudios
So i have a .love file that has code that requires a external file named 'money.lua' and it says it does not exist. Oddly enough this doesn't happen when its not in a .love file. I am running the newest version of love.
Heres the stuffs
Capture.PNG
Capture.PNG (17.18 KiB) Viewed 3711 times
Adventure.love
(5.11 MiB) Downloaded 170 times
Adventure.zip
(5.11 MiB) Downloaded 127 times
Thanx :3
Web: http://raptrstudios.weebly.com/

Re: [HELP] External File Problem

Posted: Fri Jan 23, 2015 5:01 am
by rexjericho
The problem may be because the file "money.lua" is not being created on line 85.

I don't think love.filesystem.newFile() actually writes a physical file to the hard drive. love.filesystem.write() will create a file if it does not exist. You can try changing that line to:

Code: Select all

if not love.filesystem.exists("money.lua") then
    coins = love.filesystem.write("money.lua", "File contents")
end
https://love2d.org/wiki/love.filesystem.write

Re: [HELP] External File Problem

Posted: Fri Jan 23, 2015 5:30 am
by RaptrStudios
Ill try it, thanks!

Re: [HELP] External File Problem

Posted: Fri Jan 23, 2015 7:11 am
by zorg
RaptrStudios wrote:So i have a .love file that has code that requires a external file...
If you mean a file that's not in the .love file, then you can use the game's save folder to load in files, and to save them there.

Re: [HELP] External File Problem

Posted: Fri Jan 23, 2015 6:28 pm
by RaptrStudios
I dont know how.
Could you show me?
Also, i have encountered an error, i fixed the problem with a .love file but when i export it to a .exe it says that the file could not be found!
How could i fix this??