Skip to content

bonifarz/NMS-Save-Decoder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

February 2026 Pull Request

This adds two files decode.py and encode.py, which depend only on the functions from nmssavetool.py, and that replicate most of the functionality described below with standard python methods, which could be convenient for further parsing of the save data. For this purpose, the nmssavetool.py is altered marginally to load silently.

NMS-Save-Decoder

I needed something to decode a .hg file, in case save editors aren't updated, or I have some other weirdly specific issue with a save.

So this is the solution 🤷

This is all very hacky and barely works. It uses a Python file by Robert Maupin to compress and decompress the save, and my own Typescript Deno code to apply the mapping and write it to the disc.

The two parts are glued together by a Windows Batch file.

Usage

To properly use this script, install python3, then run pip install lz4.

Decoding a Save

Drag'n'drop your save.hg file on the decode.bat file.

Encoding a Save

Drag'n'drop your save.json file on the encode.bat file.

Build the TS Part from Source

  1. Install Deno
  2. Execute this command:
deno compile --allow-read --allow-write --allow-net applyMapping.ts

About

De- and Encode NMS Save Files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 73.9%
  • TypeScript 23.7%
  • Batchfile 2.4%