• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compare map files

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
544
Solutions
6
Reaction score
121
Location
player:getTown()
Is there any simple way to compare every sqm in two otbm files an show differences as list of positions? Something like diff for txt files.

Few years ago I asked about same thing.
I hope after five/six years there is an easy way to do this.

Previous thread:
 
Solution
For the record (and future me).
Use this library for nodejs to change OTBM to JSON.

Script looks similar to:
JavaScript:
const fs = require('fs');
const otbm2json = require("./otbm2json.js");

// read map as JSON
data = otbm2json.read("./my_map.otbm");

// save map as JSON file
//fs.writeFile("./my_map.json", JSON.stringify(data));
fs.writeFile("./my_map.json", data);

Then print it using linux command jq and compare two jq formated maps by diff.
For the record (and future me).
Use this library for nodejs to change OTBM to JSON.

Script looks similar to:
JavaScript:
const fs = require('fs');
const otbm2json = require("./otbm2json.js");

// read map as JSON
data = otbm2json.read("./my_map.otbm");

// save map as JSON file
//fs.writeFile("./my_map.json", JSON.stringify(data));
fs.writeFile("./my_map.json", data);

Then print it using linux command jq and compare two jq formated maps by diff.
 
Solution
Back
Top