I actually added this in 2.44 but no one's used it yet afaik.
Quote:
Originally Posted by 2.44 changelog
- Added a way to persist Lua data across level changes
- Functions added:
- SaveMapData( luaobject ) // saves to maps/data/<mapname>.luadat
- SaveMapData( luaobject, suffix ) // saves to maps/data/<mapname>_<suffix>.luadat
- LoadMapData() // returns the loaded lua object from maps/data/<mapname>.luadat
- LoadMapData( suffix ) // returns the loaded lua object from maps/data/<mapname>_<suffix>.luadat
- SaveGlobalData( luaobject ) // saves to maps/data/global/global.luadat
- SaveGlobalData( luaobject, suffix ) // saves to maps/data/global/global_<suffix>.luadat
- LoadGlobalData() // returns the loaded lua object from maps/data/global/global.luadat
- LoadGlobalData( suffix ) // returns the loaded lua object from maps/data/global/global_<suffix>.luadat
- The suffix param gets stripped of all non-alphanumeric and non-underscore characters. The lua object is serialized into binary.
- Only strings, numbers, booleans, and tables are able to be saved. All other object types are ignored for now (player objects/lua functions for example).
|
It serializes the table and saves it as binary, so you can't really edit the .luadat file with a text editor, though.