Module ...

Savefile code T-Engine4 savefiles are direct serialization of in game objects
Basically the engine is told to save your Game instance and then it will recursively save all that it contains: level, map, entities, your own objects, ...
The savefile structure is a zip file that contains one file per object to be saved. Unzip one, it is quite obvious
A simple object (that does not do anything too fancy in its constructor) will save/load without anything to code, it's magic!
For more complex objects, look at the methods save() and loaded() in objects that have them

Functions

_M:check () Checks for existence
_M:close () Finishes up a savefile Always call it once done
_M:delete () Delete the savefile, if needed
_M:init (savefile) Init a savefile
_M:loadGame () Loads a game
_M:loadLevel (zone, level) Loads a level
_M:loadWorld () Loads a world
_M:loadZone (zone) Loads a zone
_M:saveGame (game) Save the given game
_M:saveLevel (level) Save a level
_M:saveWorld (world) Save the given world
_M:saveZone (zone) Save a zone


Functions

_M:check ()
Checks for existence
_M:close ()
Finishes up a savefile Always call it once done
_M:delete ()
Delete the savefile, if needed
_M:init (savefile)
Init a savefile

Parameters

  • savefile: the name of the savefile, usually the player's name. It will be sanitized so dont bother doing it
_M:loadGame ()
Loads a game
_M:loadLevel (zone, level)
Loads a level

Parameters

  • zone:
  • level:
_M:loadWorld ()
Loads a world
_M:loadZone (zone)
Loads a zone

Parameters

  • zone:
_M:saveGame (game)
Save the given game

Parameters

  • game:
_M:saveLevel (level)
Save a level

Parameters

  • level:
_M:saveWorld (world)
Save the given world

Parameters

  • world:
_M:saveZone (zone)
Save a zone

Parameters

  • zone:

Valid XHTML 1.0!