Do you need to be concerned about what gets stored in "glob"

Place to get help with not working mods / modding interface.
Plorntus
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Nov 24, 2014 10:43 am
Contact:

Do you need to be concerned about what gets stored in "glob"

Post by Plorntus »

Essentially as far as I am away everything that gets stored in "glob" is saved and reloaded when the map gets loaded. Does whatever get stored in there get serialized/encoded as to not break the save?

So basically if I stored a binary file with lets say every byte inside there for whatever reason, could it corrupt the save file?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14345
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Do you need to be concerned about what gets stored in "g

Post by Rseding91 »

Everything in glob gets serialized. You can store what ever you like in it (provided LUA can store it) and it will save/load without any issues.

I'm not sure how you would store a binary file since there are no functions exposed to read data from the script state and all input is in the format of strings or doubles.
If you want to get ahold of me I'm almost always on Discord.
Plorntus
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Nov 24, 2014 10:43 am
Contact:

Re: Do you need to be concerned about what gets stored in "g

Post by Plorntus »

Rseding91 wrote:Everything in glob gets serialized. You can store what ever you like in it (provided LUA can store it) and it will save/load without any issues.

I'm not sure how you would store a binary file since there are no functions exposed to read data from the script state and all input is in the format of strings or doubles.
Ah thats good!

Second part about "binary file" was an accidental mishap (I had an earlier part in the post that I removed to keep the question shorter which gave context), meant more like storing a string representation of raw bytes which I realise now is probably not possible since it would be encoded as utf8 (or whatever lua uses for its strings). All in all just a complete misunderstanding on my part haha. Thanks for the reply!
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

Re: Do you need to be concerned about what gets stored in "g

Post by Xecutor »

From my experience you can have entities as values of a table, but not as keys.
After load lookup won't find these keys.
Post Reply

Return to “Modding help”