Hello,
I know this kind of question has come up multiple times on these forums, however, I've tried possible solutions on other posts and yet they haven't seemed to work (using TSerial, Ser, etc..). I'm trying to save specific settings to a file that can be changed ingame.
What is the best way to save a table to a file (possibly without serialization)?
What is the best type of file to save to for the kind of data I'm trying to save?
In what functions should I call the load/save functions? (love.load, love.quit, love.update?)
Here's the table:
Code: Select all
settings = {
SCALE_X = 3,
SCALE_Y = 3,
cursor_SCALE_X = 2,
cursor_SCALE_Y = 2,
version = "v0.1.0"
}
SCALE_X/Y will be used to scale all images (except for the cursor, of course), and the version is printed in the beginning title screen and settings page. I'm thinking of adding another setting, autoskip, which if set to true will skip cutscenes. There are a few different data types here and I'm not exactly sure of which can even be written to a file. So far, the game doesn't consist of much at all. Just the startup states and the cursor are drawn. I figured I'd make the startup sequence last about 8 seconds so the settings and eventually level files could be loaded. Do I even need to make it last that long? Again, I know this sort of thing has been asked before, but I'd really appreciate the help. I'm somewhat new to lua and the LÖVE engine, and I haven't had a lot of practice using libraries and the filesystem functions.
That should be it, any help I can get counts. Thank you!
"I am a tomato. My favorite food is tomatoes. Tomatoes are the best. I eat them everyday. I love to hear them scream."