How do I use love.filesystem.read to read a .txt file?
Posted: Sun Jun 27, 2021 4:46 am
I tried using this function:
But that doesn't work, it's just nil. I have no idea what I'm doing wrong here, the file's in the game directory.
Also, here's the code that accesses config.txt's data:
Ignore the weird print function, it's a function from another script that does some extra stuff besides just printing.
Edit: Nevermind, I forgot to actually put something in the .txt file. The reason I'm not deleting this is so another person who has my issue might be helped by this post
Code: Select all
function readConfigFile()
local config = love.filesystem.read("config.txt")
return config
end
Also, here's the code that accesses config.txt's data:
Code: Select all
print(tostring(readConfigFile()), 0, 0)
Edit: Nevermind, I forgot to actually put something in the .txt file. The reason I'm not deleting this is so another person who has my issue might be helped by this post