by sapier » Fri Jan 20, 2012 17:30
Yes this can be done. And I've already used it for mod animals. But as staticdata is a string so all serialization and deserialization has to be done by mod code. Having only 1 parameter this isn't any problem at all. When using multiple parameters as animals mod does this is lot of work to do. In animals eg I've accepted not saving some parameters that might improove mob behaviour because of overhead generated by serialization/deserialization. And of course because coding a generic solution in lua is lot of (possibly useless) work.
And of course this feature isn't exactly a feature related to any mod at all it's a generic entity capability so at least some mods would need to implement similar/the same features.
There's obviously another possible but slow option I haven't mentioned in my starting post:
D) implement serialization and deserialization in lua
DON'T mention coding style!
(c) sapier all rights reserved