This is driving me a little mad. I post this here because due to the very basic nature of my test code it is likely to be a formatting issue than a misuse of Binser. To top it off no one seemed to have that issue. Based on my humble experience it must be something very stupid that I'm missing but yet it escapes me. thanks for taking the time to review this.
Love is returning this error when i try to load a save file
binser = require "includes/binser"
local player = {}
function love.load()
if love.filesystem.exists( 'Save.lua' ) then
player = binser.d(love.filesystem.load('Save.lua'))
else
player[1] = "foo"
player[2] = "bar"
end
end
-- etc. etc.
function love.quit()
love.filesystem.write( 'Save.lua', binser.s(player) )
end
And this is the content of the save file
What am i doing wrong? It should be a straightforward process. Thanks folks.
Love.filesystem.load will try to load the file as code. You may want love.filesystem.read to load the contents of the file, so that binser can then deserialize it.
By the way, welcome to the forum!
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics