mudlet-map-binary-reader

0.5.3 • Public • Published

Mudlet Map Binary Reader

NPM

Reads Mudlet's map binary file (v20 only!). Can output .js/.json files needed for Mudlet Map Reader. Mudlet map JSON format export is also available.

API until version 1.0.0 is subject to change! Use with caution.

I am no Node developer, so any hints and suggestions are more then welcome.

TODOs and plans

  • [ ] Convert to .ts
  • [X] Document map model
  • [ ] Document classes
  • [X] Add Mudlet's JSON exporter
  • [X] Correct QFont read
  • [ ] Add test
  • [ ] Add linting

Usage example

const { MudletMapReader } = require("mudlet-map-binary-reader");

const inputFile = "map.dat"
const outputDirectory = "output";

let mapModel = MudletMapReader.read(inputFile);

// Export to map renderer format and save to .js and .json files https://github.com/Delwing/js-mudlet-map-renderer
let { mudletMap, colors } = MudletMapReader.export(mapModel, outputDirectory);

// Export as Mudlet Json map
const outputFile = 'file.json'
let mudletJsonFormat = MudletMapReader.exportJson(mapModel, outputFile)

//Modify and save binary
mapModel.rooms[1].name = "Funny name!"
MudletMapReader.write(mapModel, inputFile)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.5.3
    19
    • latest

Version History

Package Sidebar

Install

npm i mudlet-map-binary-reader

Weekly Downloads

38

Version

0.5.3

License

MIT

Unpacked Size

75.4 kB

Total Files

15

Last publish

Collaborators

  • delwing