Module m.savetable
Wrapper module for sys.load() and sys.save() Files will be saved in a path created from a call to sys.get_save_file() with application id equal to the game.project config project.title with spaces replaced with underscores.
Usage:
local savetable = require "ludobits.m.savetable" local file = savetable.open("foobar") local data = file.load() file.save({ foo = "bar" })
Functions
open (filename) | Open a file for reading and writing using sys.save and sys.load |
instance.load () | Load the table stored in the file |
instance.save (t) | Save table to the file |
Functions
- open (filename)
-
Open a file for reading and writing using sys.save and sys.load
Parameters:
- filename
Returns:
-
file instance
- instance.load ()
-
Load the table stored in the file
Returns:
-
File contents
- instance.save (t)
-
Save table to the file
Parameters:
- t The table to save
Returns:
- success
- error_message