Copy/paste a portion of a map

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

Copy/paste a portion of a map

by jp » Fri Feb 28, 2014 09:33

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: 253
Joined: Mon Aug 05, 2013 17:09
Location: Czech republic, Bohumin
GitHub: Pitriss
IRC: pitriss
In-game: pitriss

by Pitriss » Fri Feb 28, 2014 09:51

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 » Fri Feb 28, 2014 10:31

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: 3974
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Fri Feb 28, 2014 16:04

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
Member
 
Posts: 780
Joined: Wed Dec 18, 2013 09:03
Location: France
GitHub: kilbith

by jp » Fri Feb 28, 2014 16:41

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: 4478
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

by Krock » Fri Feb 28, 2014 16:46

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
Member
 
Posts: 780
Joined: Wed Dec 18, 2013 09:03
Location: France
GitHub: kilbith

by jp » Fri Feb 28, 2014 17:08

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: 3974
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Fri Feb 28, 2014 17:27

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 » Fri Feb 28, 2014 17:33

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

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

by jp » Sat Mar 08, 2014 17:24

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.
 

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

by sfan5 » Sat Mar 08, 2014 18:59

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 » Mon Jun 27, 2016 07:37

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 » Thu May 03, 2018 19:10

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: 3974
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Copy/paste a portion of a map

by Sokomine » Sat Jun 23, 2018 01:32

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.
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 1 guest