Page 1 of 1
[Mod] Schematic Saver [schematic_save]

Posted:
Thu Apr 07, 2016 19:05
by duane
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.

The source is available
on github.
License: AGPL 3
Mod dependencies: none
Download:
https://github.com/duane-r/schematic_sa ... master.zip
Issues

Posted:
Thu Apr 07, 2016 19:05
by duane
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.
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Thu Apr 07, 2016 19:12
by duane
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.
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Fri Apr 08, 2016 01:08
by TumeniNodes
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?
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Fri Apr 08, 2016 02:20
by duane
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.
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sat Apr 09, 2016 12:41
by TumeniNodes
Ok, thank you
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sat Apr 09, 2016 22:37
by paramat
Useful, the WE version seems to have problems.
Adding the ability to set probability and per-node force-place would be useful.
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Fri Apr 22, 2016 16:14
by Sokomine
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.
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Fri Apr 22, 2016 16:51
by TumeniNodes
Thank you Sokomine, I will definitely check that out.
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sat Aug 13, 2016 05:16
by burli
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
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sat Aug 13, 2016 23:29
by D00Med
ooh nice idea! I'll definitely be using this.
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sat Aug 13, 2016 23:36
by duane
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
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Tue Nov 01, 2016 14:35
by azekill_DIABLO
+1
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Tue Feb 14, 2017 08:34
by burli
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,
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sun Feb 26, 2017 19:38
by Milan*
Oh wonderful, so i don't have to write them by hand anymore - thanks. :)
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sun Feb 26, 2017 19:54
by burli
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
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Sun Feb 26, 2017 19:55
by Milan*
Sure, but the most horrible work is done by your mod. :)
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Mon Feb 27, 2017 00:40
by duane
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?
Re: [Mod] Schematic Saver [schematic_save]

Posted:
Mon Feb 27, 2017 08:20
by burli
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,