Modifying and using schematics

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Modifying and using schematics

by Wuzzy » Thu Mar 09, 2017 00:46

I feel really dumb now but I can't get started with Minetest schematics (.mts files).
There does not seem much information on the file format.

I want to modify a schematic file but I don't know how. WorldEdit can only load .we files. So how can I modify an existing schematic file or somehow load it into WorldEdit so that I can actually use it?

And finally, can I find any more documentation on schematics other than the 2 Lua API functions?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Modifying and using schematics

by burli » Thu Mar 09, 2017 06:37

There is no mts "editor". You have to convert mts to lua. Look at my code for an example

https://github.com/MarkuBu/minetest_mod ... e/init.lua

I would recommend to use the lua schematics cause they are more flexible to use. Take a look at this code how I use them
 

sofar
Member
 
Posts: 781
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Modifying and using schematics

by sofar » Thu Mar 09, 2017 06:56

saveschems is how we do this for minetest_game's tree schematics. We use a simple lua table to describe, and "easily " edit tree shapes, and then write them as .mts. We never go from .mts to lua, although it is possible. You lose too much annotation to make it easy to work with.

https://github.com/minetest-mods/saveschems/
 

bell07
Member
 
Posts: 140
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Modifying and using schematics

by bell07 » Thu Mar 09, 2017 16:18

handle_schematics does have working mts parser written in lua. https://github.com/Sokomine/handle_schematics/blob/master/analyze_mts_file.lua. In the file you find a store_mts_file function to save mts files too, I did not tried it.

A slightly modified version (parser only) you can find in my schemlib mod https://github.com/bell07/minetest-schemlib/blob/master/schematics.lua I'll check if I change it to minetest.serialize_schematic if I find time again for this project. Currently I did not tried the minetest.serialize_schematic() at the time.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Modifying and using schematics

by Wuzzy » Thu Mar 09, 2017 18:50

Meh, editing trees and other schematics by text files seems awfully tedious.
I look what WorldEdit can do for me.

What do you mean with “annotation”? MTS files just look like binary gibberish to me.

Is there maybe a way to go from the WorldEdit format (.we) to schematics and vice-versa?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

sofar
Member
 
Posts: 781
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Modifying and using schematics

by sofar » Thu Mar 09, 2017 19:14

Wuzzy wrote:Meh, editing trees and other schematics by text files seems awfully tedious.
I look what WorldEdit can do for me.

What do you mean with “annotation”? MTS files just look like binary gibberish to me.

Is there maybe a way to go from the WorldEdit format (.we) to schematics and vice-versa?


MTS files can have probabilities for slices and individual nodes, as well as a force-place flag (bool). This annotation is easily lost if you don't retain it somehow.

I don't think WE schematics handle probabilities. The way we handle this in saveschems is to make easily understandable slice maps, where you can see the probabilities for nodes more easily.

That's how we can place a random amount of side branches in the apple tree schematic, and make the tree height vary:

https://github.com/minetest-mods/savesc ... t.lua#L286
https://github.com/minetest-mods/savesc ... t.lua#L319

yes, it's not the easiest format to work with, but it works well in the end and visualizes the result really well.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Modifying and using schematics

by Wuzzy » Fri Mar 10, 2017 00:07

OK, thanks for the help so far.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 11 guests

cron