Save file system - HerissonMignion/FactorioOrganizer GitHub Wiki

Here’s an exemple of a save file. Explications under the exemple

//WITHOUT the [ ]

v[save > file version] // in the first release, it’s “v1”
[object type]
[

all properties. one for each line

]
[object type]
[

all properties. one for each line

]

[object type]
[

all properties. one for each line

]
exit //finish with exit

it’s very simple to program the encoding and decoding. the save “encoding” is made so it’s easy to program.
when saving, for each object, it proceed like it’s making a serie of writeline but in fact it’s adding lines to a list. it begins by writing its “object type” which is belt or machine.
then, it writes on the next lines each property’s values, one property by line. when the save is read, we know in which order we programmed ~“the writing” of the properties.
after we wrote every objects, the file ends by “exit”.

in the exemple above, “object type” is either “belt” or “machine” (or “exit”)

if it’s a belt :

belt
the FOType but.tostring()
posx
posy

if it’s a machine :

machine
the FOType of the recipe but .tostring()
NeedCoal
posx
posy

⚠️ **GitHub.com Fallback** ⚠️