MTS file converter

Posts: 30
Joined: Tue Sep 24, 2019 14:26

MTS file converter

by bzt » Sun Nov 24, 2019 20:59


I've created an MTS file converter, maybe you'll find it useful. It's Public Domain, use as you like.

It is capable of dumping MTS data layer-by-layer to stdout, it can generate PNG previews (provided you have all the block's images. I've downloaded some from the Minetest wiki page into the blockimgs/ directory). It can also remap blocks, that is replace block type names for example MCL2 <-> MTG out of the game, in batch mode using a plain simple CSV file as a dictionary. It can also parse certain wikipedia pages for schematic blueprints and convert those into MTS files.

Known bugs: I was unable to figure out from the engine's source how param2 exactly works, so most of the time it's just zero :-( meaning one would need to fix some blocks' rotation. It is also zero for liquids and light sources, that might need proper param2 too.
I couldn't find a way to store the ground level, so I've used an invalid rotation for air blocks on the ground layer, by param2 being 32. As the engine uses getParam2() & 0x1F, this does not interfere with anything. I've tested this with //mtschemplace, and it worked, there were no warnings nor errors. However this is a workaround, so if there's a better, official way to mark the ground level in MTS files, let me know.


Posts: 3911
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: MTS file converter

by Sokomine » Sun Nov 24, 2019 21:11

bzt wrote:It is also zero for liquids and light sources, that might need proper param2 too.

No need to worry there. If it's a flowing liquid, it' by itself somewhere eventually :-) And light sources use param1 afaik. In general, schematics do not care about that. If you dig a cellar below ground level by placing a schematic at mapgen time, updating of the lighting may sometimes be required.
A list of my mods can be found here.

Return to Minetest-related projects

Who is online

Users browsing this forum: No registered users and 4 guests