View Single Post
Old 06-24-2013, 06:33 AM   #2
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
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.
__________________
#FF.Pickup Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington
squeek. is offline   Reply With Quote