Module ...
Savefile code Creates a savefile pipe, savefiles requests can be pushed into it, it will execute them in order and, as much as possible, as a background process, thus not preventing the game from running.
There can only be one pipe! DO NOT TRY TO MAKE MORE
Functions
_M:doLoad (savename, type, class, ...) | Load a savefile |
_M:doThread () | Actually do the saves This should run in a coroutine. Do not call this, this is automatic! |
_M:forceWait () | Force to wait for the saves |
_M:ignoreSaveToken (v) | Allow to ignore saveversion token |
_M:init (class, max_before_wait) | Init a savefile pipe |
_M:push (savename, type, object, class, on_end) | Push a savefile request |
_M:pushGeneric (name, fct) | Push a generic action to be done once saves complete |
Functions
- _M:doLoad (savename, type, class, ...)
-
Load a savefile
Parameters
- savename: the name of the savefile to handle
- type: the Savefile method to use. I.e: "game", "level", "zone". This will cann the Savefile:saveGame, Savefile:saveLevel, Savefile:saveZone methods
- class: a class name, if different from the default one
- ...:
- _M:doThread ()
-
Actually do the saves This should run in a coroutine.
Do not call this, this is automatic! - _M:forceWait ()
- Force to wait for the saves
- _M:ignoreSaveToken (v)
-
Allow to ignore saveversion token
Parameters
- v:
- _M:init (class, max_before_wait)
-
Init a savefile pipe
Parameters
- class: the name of the Savefile class to use. Defaults to engine.Savefile
- max_before_wait: Number of saves allowed in the pipe before the game pauses to do the saves (this is to prevent pushing too many saves and making it very very long)
- _M:push (savename, type, object, class, on_end)
-
Push a savefile request
Parameters
- savename: the name of the savefile to handle
- type: the Savefile method to use. I.e: "game", "level", "zone". This will cann the Savefile:saveGame, Savefile:saveLevel, Savefile:saveZone methods
- object: the object to save
- class: a class name, if different from the default one
- on_end: a function to call when this object is saved; this can be nil
- _M:pushGeneric (name, fct)
-
Push a generic action to be done once saves complete
Parameters
- name:
- fct: