function love.conf(a)
a.console = true
checkConfig() -- checkConfig is defined elsewhere
config = table.load("Files/config.lua") -- table.load() is defined elsewhere
print(config) -- This prints "table: 0x3dd9da18" when I ctrl+b. But drag drop, it does nothing.
-- Even when I print("Hello") nothing happens when dragging it, but works exactly as expected with ctrl+b
a.window.width = config.window.width -- This is the line it crashes on. error says config is returning nil.
end -- it doesn't actually end here. I took out a lot for simplicity sake.
I have double and triple checked paths. The directory in the title of the document I'm editing in sublime is precisely the one I'm dragging.
settings.lua uses io.open among other io functions. They won't work properly with LÖVE, in this example it's probably not finding relative paths due to the working directory not being correct. Use love.filesystem instead. I'd replace settings.lua entirely with a better serialization solution.
grump wrote: ↑Fri Nov 09, 2018 8:05 am
settings.lua uses io.open among other io functions. They won't work properly with LÖVE, in this example it's probably not finding relative paths due to the working directory not being correct. Use love.filesystem instead. I'd replace settings.lua entirely with a better serialization solution.
oh. Dang, that is the one I found that does what I need it to. Any recommendations on how I can save a table to a file to be easily recalled as the same table. something similar to what I'm doing here.
also thanks for that information. I didn't realize that lua function doesn't work with love2d.
JJSax wrote: ↑Fri Nov 09, 2018 8:08 am
also thanks for that information. I didn't realize that lua function doesn't work with love2d.
Technically it does work, you just need to be aware of the limitations and caveats; bottom line, it's easier and simpler in most cases to just use love.filesystem stuff.
Me and my stuff True 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.