Why you might be intrested:
- Want to move a house from one place/world to another?
- Without having to worry about rotation?
- Don't know which mods might be required and if you've got them installed?
- Hate it if your cellar suddenly starts at street level, while the entrance is somewhere way up?
- No idea how big it will be?
- Want to be able to remove the spawned building if the place choosen didn't really fit, or the house does not please?
- Want to be able to choose diffrent materials easily?
..the house may end up rotated in the wrong way. handle_schematics adds a suffix to the filename so that it knows how the building was oriented when you saved it. Whenever you place a building using this mod's build chest, the building's rotation will be adjusted to the rotation of the build chest you used. Just place the chest so that it faces into the right direction, select the building, and get it rotated the right way automaticly. Sounds more complex than it is.
In order to use the build chest, type
Code: Select all
/giveme handle_schematics:build 99
Example: The same .mts file placed three times, but with three diffrent build chests and diffrent replacements selected:

Here you can see a sample replacement list (used to get the brick house in the screenshot above):

..and, once you click on Proceed, the house is placed. You can see it shimmering through in the background of the formspec:

And the best thing: If you click on restore original landscape, the house will be removed again and everything will look like before!
If you want to save a new schematic, first walk to the backside of your house. Place a build chest so that your house extends to the right and down from the build chest. Click on save a building and then set this position as new end position:

Now that the end is marked, walk to the front. Place a second build chest in front of your house - so that your house extends to the right and upwards from your build chest (Note: The build chest will not be part of the area that is to be saved). Click on save a building and proceed with saving. The Total height of your building value will be calculated automaticly. We entered -3 as a value for height offset because the building streches three more nodes into the ground as seen from the build chest - the entrance is on the same level where the build chest is, but there's that cellar as well. If you just want to include the floor, use -1. If you don't want the floor to be saved, use 0. Finally, enter a file name (like house_with_cellar) and click on Save building.

The chest will show you some information about file name and area saved. The _3_180 attached to the filename is additional information that will tell the mod that the house needs to be burried 3 nodes and that it is rotated by 180 degrees.

And this is how it looks like once it's spawned:

Schematics can be imported from the following formats:
- Minetest schematic files (.mts) are of course supported. This is how the chest saves backups and whatever you choose to save.
- WorldEdit (.we, .wem). The mod uses code from WorldEdit to deserialize the files. I'm not yet sure which liscence that will require.
- MC (.schematic) files. You have to manually decompress the .schematic files (i.e. mv -i bla.schematic bla.schematic.zip ; unzip bla.schematic.zip) and might want to use mccompat in order to get a more complete list of replacements.
For some common nodes like wood, roof types and farming, diffrent replacements are offered so that you can change the type of wood and tree used with one click. Translations for RealTest nodenames are included. You can of course also select your own individual replacements for each node type. And if you don't like it, just restore the original landscape and try with another type of block. The choices offered depend on the mods you've got installed.



Here is a more complex examplge of a schematic where the nodes required do not exist in this world:

Or here, with even more unknown nodes:

The build chest also offers a preview image. That is of little use for now as you can just spawn the building and take a look at it. Later on, the build chest will not only be an admin tool but also be capable of spawning houses not out of thin air but by requesting the materials one-by-one from the player - similar to what I already did some time ago in random_buildings and similar to the build npc in towntest and npcf, although this mod will not get a mob. It will just ask for the materials and place them.

Known bugs/missing features:
- Handling of metadata is not done well yet. It is only partially implemented and has not been tested under realistic circumstances.
- The whole code needs a cleanup. Parts of it may have to be moved into other mods.
- The file browser part doesn't work too well yet. The new api function minetest.get_dir_list needs to be extended for that purpose.
- Schematics from a world file ought to be updated whenever the folder is accessed in the chest's menu. Right now, it requires a restart of the game to show up.
- There ought to be an option to "build" a house with the build-chest by inserting the materials (as is done in towntest, npcf and random_buildings to various degrees). This will be a way for players to bring pre-generated structures into the world without any special privs or creating items out of nowhere.
- The landscape backups may sum up. Some way of cleaning them up would be helpful.
- The chest can only be removed using WorldEdit once a building is spawned.
Browse code: https://github.com/Sokomine/handle_schematics
Version: 0.1 (alpha)
Licence: GPLv3 for my part; but WorldEdit may override that
Depends on: nothing
Optionally depends on: default, doors, farming, wool, stairs, cottages, moretrees, RealTest: trees, deco, metals, grounds, forest, dryplants, cavestuff, snow, moresnow, darkage, ethereal, moreblocks, bell, mobf_trader, docfarming (including farming plusplus), mccompat
And, of course: supports mg_villages
Regarding the optional dependencies: You'd want handle_schematics to optionally depend on any mod that provides blocks for houses you want to spawn with mg_villages.
Update 27.12.2016:
- Added texture for handle_schematics:support. It acts as scaffolding - i.e. can be walked through, climbed, easily mounted and dismounted.
- The scaffolding nodes can be crafted from "stick - nothing - stick". That gives you four of them. It's a cheap receipe, but then...better have some scaffolding standing around than nerdpoles.
- Fixed several bugs.
- Works now with security enabled. To a degree. Schematics can only be imported from your <WORLDNAME>/schems/ folder. You have to move them there yourshelf.
- Added a few sample buildings. Amongst them is a very simple house for new players (those that join servers and either beg others for a house or just build a horrible cobble box). The other two buildings will probably be added to mg_villages soon.