Description
Basically it allows you to output a whole table as a single string; for example, to write it to a file and load later.
Features
Saves any datatype except functions, threads and userdata (it's impossible)
Multidimensional array support
Tabulated human-friendly output
Caution! To serialize such tables as /_G/ you will need to manipulate the function yourself else you will run into an infinite loop! (happened to me, 2GB text file FTW!)
Installation
Basic installation:Extract the archive into CS2D folder.
Execute the lua file with dofile() which will return the function
1
somevariablenamehere = dofile("/sys/lua/vademon/serialize/serialize.lua")
How to use
Function: funcName(name, object [, tabs])
name: type the name of the original table (in most cases same as /object/ but it's a string)
object: the table you want to serialize
[Optional] tabs: used internally to pass tabulators as a string (e.g.: "\t\t" will increase the tabulators by 2)
Also check out MikuAuahDark's work: table.uneval (6)
Bugs?
Yea, there's one, try to find it Yet I hope nobody will run into it.
MIT License
edited 9×, last 25.06.14 12:01:52 am
Approved by Sparty
Download
2 kb, 455 Downloads