Copy/paste a portion of a map

Post Reply
User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

Copy/paste a portion of a map

by jp » Post

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

User avatar
Pitriss
Member
Posts: 254
Joined: Mon Aug 05, 2013 17:09
GitHub: Pitriss
IRC: pitriss
In-game: pitriss
Location: Czech republic, Bohumin

by Pitriss » Post

AFAIK Worldedit can import/export pieces of map.
I reject your reality and substitute my own. (A. Savage, Mythbusters)
I'm not modding and/or playing minetest anymore. All my mods were released under WTFPL. You can fix/modify them yourself. Don't ask me for support. Thanks.

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

by Morn76 » Post

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.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

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.
A list of my mods can be found here.

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

by jp » Post

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...
Last edited by jp on Fri Feb 28, 2014 16:44, edited 1 time in total.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

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.
Last edited by Krock on Fri Feb 28, 2014 16:47, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

by jp » Post

Thank you for your precise explication, Krock.

I loaded the file with only pos1 in the new world...
Last edited by jp on Fri Feb 28, 2014 17:09, edited 1 time in total.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

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.
A list of my mods can be found here.

User avatar
Novacain
Member
Posts: 285
Joined: Sat Aug 31, 2013 01:03
Location: Skaaro

by Novacain » Post

i think I need to bookmark this page so I can move buildings :P
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

by jp » Post

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 ;)
Last edited by jp on Sat Mar 08, 2014 18:01, edited 1 time in total.

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

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.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

Murkle
Member
Posts: 10
Joined: Wed Mar 30, 2016 02:56

Re: Copy/paste a portion of a map

by Murkle » Post

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?
-Murkle

Tallmantsu
New member
Posts: 2
Joined: Fri Apr 27, 2018 17:47
GitHub: Tallmantsu
IRC: Tallmantsu
In-game: Tallmantsu

Re: Copy/paste a portion of a map

by Tallmantsu » Post

Murkle wrote: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?
I have just found this mod very simple to copy past whatever you want on single map :
https://github.com/minetest-mods/edit

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Copy/paste a portion of a map

by Sokomine » Post

Take a look at my handle_schematics mod. Obtain two of the build chests, place one in front and one at the backside of your building, save it to a file, and then later on spawn it at the target position. You can even replace the materials with other ones.
A list of my mods can be found here.

Post Reply

Who is online

Users browsing this forum: Trog and 5 guests