[Mod] Schematic Saver [schematic_save]

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

[Mod] Schematic Saver [schematic_save]

by duane » Thu Apr 07, 2016 19:05

This mod lets you mark two positions and save everything inside as a lua schematic file. Node names and rotation data are included, and air is automatically set to prob = 0, so that it won't overwrite anything else. The format is reasonably compact:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local n1 = { name = "default:sand" }
local n2 = { name = "default:river_water_source" }
local n3 = { name = "default:river_water_flowing", param2 = 7 }
...

local schem = {
   yslice_prob = {

   },
   size = {
      y = 14,
      x = 15,
      z = 11
   }
   ,
   data = {
      n1, n1, n1, n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n2, n2, n3, n3,
      n4, n4, n4, n4, n4, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5,
      n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5, n5,
      ...
   }
}


The code is almost entirely lifted from WorldEdit, and marking positions works the same way. Go to a spot and type "//pos1", then another and type "//pos2". Then type in "//save <file>". The schematic will be saved in your world directory, with a ".txt" suffix. You can then copy it to an appropriate file and add register_decoration code.

Image

The source is available on github.

License: AGPL 3

Mod dependencies: none

Download: https://github.com/duane-r/schematic_sa ... master.zip
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Issues

by duane » Thu Apr 07, 2016 19:05

There are no issues that I know of. However, there are no permissions required to use this mod, so it's not something you'll want to keep running all the time.
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod] Schematic Saver [schematic_save]

by duane » Thu Apr 07, 2016 19:12

If anyone wants a really big example, here's a building from Cityscape. Don't set your fill_ratio too high with this. It gets ugly.
Attachments
cityscape-schem-example.zip
(10.18 KiB) Downloaded 124 times
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: [Mod] Schematic Saver [schematic_save]

by TumeniNodes » Fri Apr 08, 2016 01:08

Don't mean to sound dumb..., it just comes natural to me :D
So this means I could take a building from one world I built, and transfer it to another world I'd like it to be in?
Flick?... Flick who?
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod] Schematic Saver [schematic_save]

by duane » Fri Apr 08, 2016 02:20

thegreatone wrote:Don't mean to sound dumb..., it just comes natural to me :D
So this means I could take a building from one world I built, and transfer it to another world I'd like it to be in?


That's more in line with WorldEdit. This is for developers who want to make schematics easily from something they built and want to put everywhere in a mod. You have to use lua to place the schematic.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: [Mod] Schematic Saver [schematic_save]

by TumeniNodes » Sat Apr 09, 2016 12:41

Ok, thank you
Flick?... Flick who?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [Mod] Schematic Saver [schematic_save]

by paramat » Sat Apr 09, 2016 22:37

Useful, the WE version seems to have problems.
Adding the ability to set probability and per-node force-place would be useful.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] Schematic Saver [schematic_save]

by Sokomine » Fri Apr 22, 2016 16:14

TumeniNodes wrote:So this means I could take a building from one world I built, and transfer it to another world I'd like it to be in?

For that, you might also want to take a look at the build chest from my handle_schematics mod. It makes loading buildings a lot more convenient than with plain WorldEdit.
A list of my mods can be found here.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: [Mod] Schematic Saver [schematic_save]

by TumeniNodes » Fri Apr 22, 2016 16:51

Thank you Sokomine, I will definitely check that out.
Flick?... Flick who?
 

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

Re: [Mod] Schematic Saver [schematic_save]

by burli » Sat Aug 13, 2016 05:16

and air is automatically set to prob = 0, so that it won't overwrite anything else.


What if air should overwrite? I saw last time grass in wooden planks because it was mat removed
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: [Mod] Schematic Saver [schematic_save]

by D00Med » Sat Aug 13, 2016 23:29

ooh nice idea! I'll definitely be using this.
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod] Schematic Saver [schematic_save]

by duane » Sat Aug 13, 2016 23:36

burli wrote:
and air is automatically set to prob = 0, so that it won't overwrite anything else.


What if air should overwrite? I saw last time grass in wooden planks because it was mat removed


Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
sed -i -e 's/prob = 0/prob = 255/g' filename
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Schematic Saver [schematic_save]

by azekill_DIABLO » Tue Nov 01, 2016 14:35

+1
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

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

Re: [Mod] Schematic Saver [schematic_save]

by burli » Tue Feb 14, 2017 08:34

I use this mod to save trees I build. Works fine so far. But is it possible to format the output of data like this? This makes it easier to edit the data. Currently I format this by hand

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   size = {
      y = 10,
      x = 9,
      z = 11
   }
,
   data = {
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, lf, lf, lf, ai, lf, lf, lf, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, lf, ai, ai, ai, ai, ai, ai,
         lf, lf, lf, lf, lf, lf, lf, lf, lf,
         ai, lf, lf, lf, ai, lf, lf, lf, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, lf, lf, lf, ai, ai, lf, ai, ai,
         lf, lf, n3, lf, lf, lf, n4, lf, lf,
         ai, lf, lf, lf, lf, lf, lf, lf, lf,
         ai, ai, lf, lf, lf, lf, lf, lf, ai,
         
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

Re: [Mod] Schematic Saver [schematic_save]

by Milan* » Sun Feb 26, 2017 19:38

Oh wonderful, so i don't have to write them by hand anymore - thanks. :)
 

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

Re: [Mod] Schematic Saver [schematic_save]

by burli » Sun Feb 26, 2017 19:54

Milan* wrote:Oh wonderful, so i don't have to write them by hand anymore - thanks. :)


You still have some work to do, but it is a lot easier
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

Re: [Mod] Schematic Saver [schematic_save]

by Milan* » Sun Feb 26, 2017 19:55

Sure, but the most horrible work is done by your mod. :)
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: [Mod] Schematic Saver [schematic_save]

by duane » Mon Feb 27, 2017 00:40

burli wrote:I use this mod to save trees I build. Works fine so far. But is it possible to format the output of data like this? This makes it easier to edit the data. Currently I format this by hand

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   size = {
      y = 10,
      x = 9,
      z = 11
   }
,
   data = {
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, lf, lf, lf, ai, lf, lf, lf, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, lf, ai, ai, ai, ai, ai, ai,
         lf, lf, lf, lf, lf, lf, lf, lf, lf,
         ai, lf, lf, lf, ai, lf, lf, lf, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, ai, ai, ai, ai, ai, ai, ai, ai,
         ai, lf, lf, lf, ai, ai, lf, ai, ai,
         lf, lf, n3, lf, lf, lf, n4, lf, lf,
         ai, lf, lf, lf, lf, lf, lf, lf, lf,
         ai, ai, lf, lf, lf, lf, lf, lf, ai,
         


It's certainly possible. It's not a high priority for me. You're just talking about replacing elements with variables, I take it?
 

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

Re: [Mod] Schematic Saver [schematic_save]

by burli » Mon Feb 27, 2017 08:20

I don't talk about the variable names. I talk about the structure. Let's assume the schematic has a size of 3x3x3 and only air. Currently the output looks something like this

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
ai, ai, ai, ai, ai, ai, ai, ai,
ai, ai, ai, ai, ai, ai, ai, ai,
ai, ai, ai, ai, ai, ai, ai, ai,
ai, ai, ai,


This would be easier to edit

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
ai, ai, ai,
ai, ai, ai,
ai, ai, ai,

ai, ai, ai,
ai, ai, ai,
ai, ai, ai,

ai, ai, ai,
ai, ai, ai,
ai, ai, ai,
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 41 guests

cron