I think I may have stumbled upon the answer:
/c game.write_file("map-settings.json", serpent.block(game.parse_map_exchange_string(game.get_map_exchange_string())))
This basically gets the exchange string, runs it through the internal parser, runs it through the Serpent pretty printer, then ...
Search found 2 matches
- Tue Feb 18, 2020 3:22 am
- Forum: Technical Help
- Topic: convert map exchange string to map generator settings
- Replies: 9
- Views: 8090
- Tue Feb 18, 2020 2:06 am
- Forum: Technical Help
- Topic: convert map exchange string to map generator settings
- Replies: 9
- Views: 8090
Re: convert map exchange string to map generator settings
I would also like to have this ability to output the map config files in JSON format from within Factorio. It would be helpful to be able to pass the config files to a server admin, instead of having to mess with save game files. Perhaps the server admin would like to tweak a few settings before ...