Editing VSAV files as text

I did a bit of development using the pywargame API, and I’ve made a script - vsavwrite.py - that generates a save file (.vsav) from a module and a human-readable JSON file. You can find more at GitLab.

An example can be seen here. I have the module BattleForMoscow.vmod (generated by the pywargame API), and the JSON file setup.json

{
  "Map": {
    "Board": {
      "Hexes": {
        "0301": ["Soviet 10 Infantry Army"  ],
        "0302": [ "Soviet 13 Infantry Army" ],
        "0303": [ "Soviet 16 Infantry Army" ],
        "0304": [ "Soviet 19 Infantry Army" ],
        "0405": [ "Soviet 20 Infantry Army" ],
        "0504": [ "Soviet 24 Infantry Army" ],
        "0505": [ "Soviet 29 Infantry Army" ],
        "0506": [ "Soviet 3 Infantry Army" ],
        "0507": [ "Soviet 30 Infantry Army" ],
        "0508": [ "Soviet 32 Infantry Army" ],
        "0509": [ "Soviet 33 Infantry Army" ],
        "0510": [ "Soviet 40 Infantry Army" ],
        "0803": [ "Soviet 43 Infantry Army" ],
        "German LVII Armoured Corps": "0406",
        "German LVI Armoured Corps": "0203",
        "German XLI Armoured Corps": "0202",
        "German XL Armoured Corps": "0305",
        "German XLVIII Armoured Corps": "0409",
        "German XLVII Armoured Corps": "0408",
        "German XLVI Armoured Corps": "0306",
        "German XXIV Armoured Corps": "0407",
        "German IX Infantry Corps": "0206",
        "German LIII Infantry Corps": "0309",
        "German VIII Infantry Corps": "0204",
        "German VII Infantry Corps": "0106",
        "German VI Infantry Corps": "0205",
        "German V Infantry Corps": "0103",
        "German XIII Infantry Corps": "0310",
        "German XII Infantry Corps": "0307",
        "German XLII Infantry Corps": "0209",
        "German XXIII Infantry Corps": "0104",
        "German XX Infantry Corps": "0107",
        "German XXVII Infantry Corps": "0201",
        "German XXXIV Infantry Corps": "0210",
        "German XXXV Infantry Corps": "0410"
      },
      "German": {},
      "Soviet": {
        "Soviet": [
          "Soviet 49 Infantry Army",
          "Soviet 5 Infantry Army",
          "Soviet 50 Infantry Army",
          "Soviet 1S Infantry Army"
        ]
      },
      "Turns": { "1T1": [ "GameTurn" ] }
    }
  }
}

which I then feed to the script

vsavwrite.py BattleForMoscow.py setup.json -n "Example setup" -o Example.vsav

Note, the script is not omnipotent, and in some cases one is better off developing a custom script using the pywargame API. However, in many cases, the script should get you at least part of the way.

Yours,
Christian