[HELP] External File Problem

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
RaptrStudios
Prole
Posts: 39
Joined: Thu Jan 22, 2015 5:46 am

[HELP] External File Problem

Post 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 3706 times
Adventure.love
(5.11 MiB) Downloaded 169 times
Adventure.zip
(5.11 MiB) Downloaded 126 times
Thanx :3
Web: http://raptrstudios.weebly.com/
Raptr Studios
http://raptrstudios.weebly.com/

Please consider donating to us!

New Game I'm Working On - Cerradon
rexjericho
Prole
Posts: 44
Joined: Sat Dec 15, 2012 7:55 am

Re: [HELP] External File Problem

Post 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
RaptrStudios
Prole
Posts: 39
Joined: Thu Jan 22, 2015 5:46 am

Re: [HELP] External File Problem

Post by RaptrStudios »

Ill try it, thanks!
Raptr Studios
http://raptrstudios.weebly.com/

Please consider donating to us!

New Game I'm Working On - Cerradon
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: [HELP] External File Problem

Post 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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
RaptrStudios
Prole
Posts: 39
Joined: Thu Jan 22, 2015 5:46 am

Re: [HELP] External File Problem

Post 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??
Raptr Studios
http://raptrstudios.weebly.com/

Please consider donating to us!

New Game I'm Working On - Cerradon
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests