Generating a world from existing XML

hughbar
New member
 
Posts: 2
Joined: Sun May 31, 2015 15:57
GitHub: hbarnard
IRC: hughbar
In-game: hughbar

Generating a world from existing XML

by hughbar » Sun May 31, 2015 16:18

Hi folks,

I'm a computer person but new to Minetest, looks great. I'd like to take an existing load of XML that 'could' define nodes and build a rough world with it.

From my limited understanding, I think I probably need to build a schem.mts file from my XML to get my starter world. I could also add API access to WorldEdit and drive that using the XML. One problem is that I can't see a specification for the schem file, if that is what I need?

Does all this sound ridiculous, is there a simpler way, has anyone else tried something like this with an external format (json would be OK too!)?

Thanks in advance Hugh
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: Generating a world from existing XML

by Sokomine » Sun May 31, 2015 18:48

The .mts format is documented in the source code of Minetest, specificly mg_schematics.h. My handle_schematics mod reads and writes .mts files, specificly in analyze_mts_file.lua. Using voxelmanip directly might also be a solution for you. The mapgen version requires that you can reproduce your landscape exactly for a given mapchunk. The non-mapgen version depends a bit on available memory. Voxelmanip basicly allows you to manipulate a more or less 3d array of mapdata directly.
A list of my mods can be found here.
 

hughbar
New member
 
Posts: 2
Joined: Sun May 31, 2015 15:57
GitHub: hbarnard
IRC: hughbar
In-game: hughbar

Re: Generating a world from existing XML

by hughbar » Mon Jun 01, 2015 07:47

Thanks very much for this. I'll take all the advice! If I make any progress with this, I'll make the code/process available.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Generating a world from existing XML

by kaeza » Mon Jun 01, 2015 09:51

Not sure if this will be of much help, but my imageloader mod (repo link) loads 2D maps from image files. The algorithms are not particularly... *ahem* efficient, but can give you another example of how to create a schematic "table" (i.e. no need for intermediate files).
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron