lovel.filesystem.load and Lua files in working directory
Posted: Sat Jan 05, 2013 12:46 pm
I'm using TileD to create lua files that export tables full of level data. So a file level.lua looks like "return { verybigtable }".
Now I know you could do func = love.filesystem.load("level.lua") and then do func() to return the table. The problem is, I want to have the level lua files within the source directory, so within the .love file. How can I make LOVE reach those files? I tried love.filesystem.load("level.lua"), love.filesystem.load(love.filesystem.getWorkingDirectory().."/level.lua"), etc.
EDIT: oh it seems I can just do require("level.lua") and it'll return the table. Was overthinking the problem.
Now I know you could do func = love.filesystem.load("level.lua") and then do func() to return the table. The problem is, I want to have the level lua files within the source directory, so within the .love file. How can I make LOVE reach those files? I tried love.filesystem.load("level.lua"), love.filesystem.load(love.filesystem.getWorkingDirectory().."/level.lua"), etc.
EDIT: oh it seems I can just do require("level.lua") and it'll return the table. Was overthinking the problem.