Page 1 of 1
Copy/paste a portion of a map

Posted:
Fri Feb 28, 2014 09:33
by jp
Hello.
I want to import a big building in a new map. So, is it technically possible to cut an portion of a map and paste on other ?
Regards,
JP

Posted:
Fri Feb 28, 2014 09:51
by Pitriss
AFAIK Worldedit can import/export pieces of map.

Posted:
Fri Feb 28, 2014 10:31
by Morn76
Just select a region in your source world and "//save mymodel". Then copy the "schems/" directory into the destination world directory, load it up, mark the correct node, and "//load mymodel".
WorldEdit always loads models so that pos1 is at the lowermost x/y/z coordinate, so the node you need to mark for pasting might be different than the pos1 you marked in your source world.

Posted:
Fri Feb 28, 2014 16:04
by Sokomine
jp wrote:I want to import a big building in a new map. So, is it technically possible to cut an portion of a map and paste on other ?
Yes it is. If you want to transfer individual buildings, WorldEdit is indeed a good choice. If you really want to cut out a huge portion of a map and put it into another map, go to the database level. Each entry in the database the map consists of contains 16x16x16 nodes. The map format is documented in doc/mapformat.txt, and transfering data on that level is extremly fast.
If your area is just too large for the standard WorldEdit save/load commands but still not so big that you'd want to calculate the ID of the map chunks involved (as the database level would require), try the schematic-related commands from WorldEdit: //mtschemcreate etc.

Posted:
Fri Feb 28, 2014 16:41
by jp
Well, I did the test with Sky City (which you know, Sokomine). Exported about 300,000 blocks in a .we file of 53 Mo.
I thought that my computer would explode during the process...
Then I imported the file in a new world, and several parts of Sky City didn't appear, sometimes some parts of brick walls was replaced by dirt. I think it was too big for one file...

Posted:
Fri Feb 28, 2014 16:46
by Krock
Use WorldEdit:
In the 1st world:
Go into one edge of the building (ex. down, left, in front)
say: //pos1
Go into the other edge of the building (ex. up, right, in the back)
say: //pos2
say: //save FILENAME
Go into your world folder, copy the "schems" folder into the 2nd world.
In the 2st world: (where you copied the "schems" folder to)
Go into an edge on the bottom, (~ where the lowest part of your building should be)
say: //pos1
say: //pos2 (yes, at the same position!)
See if you made it right: The worldedit will draw x++, z++, that means, when you're at the coordinates (4, 5, 7), then your house might end at (12, 10, 23), that would be a size of 8x5x16 nodes.
say: //load FILENAME
have fun.
For maps with same mods, this shouldn't give any problems.

Posted:
Fri Feb 28, 2014 17:08
by jp
Thank you for your precise explication, Krock.
I loaded the file with only pos1 in the new world...

Posted:
Fri Feb 28, 2014 17:27
by Sokomine
Krock wrote:say: //save FILENAME
For larger structures, use //mtschemcreate filename instead of //save filename, and //mtschemplace filename instead of //load filename. The schematics force areas to be loaded and are resistant against mapgen griefing. It ought to work fine with Sky City.

Posted:
Fri Feb 28, 2014 17:33
by Novacain
i think I need to bookmark this page so I can move buildings :P

Posted:
Sat Mar 08, 2014 17:24
by jp
Hello.
I tried
//mtschemcreate and
//mtschemplace commands to export / import
Sky City.
It was very
much faster,
better made and
much lighter for the schem file than //save and //load.
Thanks alot, Sokomine ;)

Posted:
Sat Mar 08, 2014 18:59
by sfan5
jp wrote:Hello.
I tried
//mtschemcreate and
//mtschemplace commands to export / import
Sky City.
It was very
much faster,
better made and
much lighter for the schem file than //save and //load.
Thanks alot, Sokomine ;)
That is much faster because serializing MTSchematics is done in C++.
But note that mtschematics cannot any metadata of soft, that means contents of chests/furnaces will not be saved.
Re: Copy/paste a portion of a map

Posted:
Mon Jun 27, 2016 07:37
by Murkle
Can I use this to copy within a single map? So I can build something and move it, e.g. make towns faster?
Also, is WorldEdit built into Minetest, or is it a mod type thing?
Ps. The post above me has a WorldEdit mod, is this the official thing? Or it's it just an awesome mod?
Re: Copy/paste a portion of a map

Posted:
Mon Jun 27, 2016 09:09
by Naj
It's a mod, you can find it
here.
With Worldedit, you can perform various operations on map, load, save, rotate, flip...