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:

  1. success
  2. error_message
generated by LDoc 1.4.6 Last updated 2017-11-27 06:48:33