Im trying to write my own game data so that the user can continue his or her own game. But this seems to work but it crashes love with no error or warning. What am i doing wrong.
Wait a second.. you don't happen to be running linux, and executing it via the command "love ."?
In that case go up a dir and start love with the name of the dir.
It's a safety feature as it prevents to write to a the following dir /home/user/.love/., as it uses the invoked name as name for the save dir.
(might be vague, just do as I said, problem solved)
ye, i dont know what it is. Well im thinking of making saved games server side. So then im just going to write the server in C++ and save everything serverside. But it would be nice if the file system would work for me.
When I try to save running the code I posted before, I don't get an stderr.txt (and I don't have an stdout.txt at all). However, if I change it to something like this:
[string "libs/player.lua"]:48: assertion failed!
stack traceback:
[C]: in function 'assert'
[string "libs/player.lua"]:48: in function 'savegame'
[string "libs/player.lua"]:149: in function 'keypressed'
[string "libs/environment.lua"]:55: in function 'keypressed'
[string "main.lua"]:44: in function <[string "main.lua"]:40>
So I guess it has a problem with the print() function, though I don't see how that could help figure out our original problem. I might be mistaken, but I thought print was supposed to be written to stdout.txt, which I don't have. I tried creating a dummy stdout.txt with proper permissions to make sure there wasn't a problem there, but to no avail.
No, it actually says love.filesystem.open failed, and you might need to take a look at the reference manual, correct use of assert is:
assert(function, "OMG CRASED"), it will in turn give you a LÖVE error message with the text "OMG CRASHED" and thereby stop the game.
assert(love.filesystem.open(SaveGame),love.system.exit()) --will never work, as it tries to 'evaluate' love.system.exit() before actually checking the return values of love.filesystem.open
So, Chris016, if you can post your stdout.txt and stderr.txt that'd be great.