Page 1 of 1

[solved] Schematic from luatable is somewhat broken

PostPosted: Sun Mar 12, 2017 08:32
by Milan*
Hi there,

first of all, this is not my first schematic i wrote by hand using luatables as to find as minetest-mods/schematic_saver (i guess?).
This time i really have no clue what's wrong, i just wrote the ethereal mushroom to a table to be able to adjust the trunk.
It somewhat always results in a schematic with randomly placed nodes.

Image

Even one slice gets a different result then expected.

This is the table:

mts_save("mushroomone", {
size = {x = 8, y = 12, z = 9},
data = {
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,M,M,M,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,

_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,M,M,_,M,M,_,_,
_,_,M,M,_,M,M,_,_,
_,_,_,M,M,M,_,_,_,
_,_,_,_,_,_,_,_,_,

_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,_,_,_,_,_,_,_,_,
_,M,M,_,_,_,M,M,_,
_,M,M,_,_,_,M,M,_,
_,_,M,P,P,P,M,_,_,
_,_,_,M,M,M,_,_,_,

_,_,_,T,T,T,_,_,_,
_,_,_,T,T,T,_,_,_,
_,_,_,T,T,T,_,_,_,
_,_,_,T,T,T,_,_,_,
_,_,_,T,T,T,_,_,_,
_,_,_,T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,_,_,_,_,_,_,
}


Maybe someone has an idea - i compared it with my other schematics again and again and don't find the difference. :(

Re: Schematic from luatable is somewhat broken

PostPosted: Sun Mar 12, 2017 08:34
by sofar
please reuse the code from `saveschems` - https://github.com/minetest-mods/saveschems to validate and save stuff.

What are _, M and T?

Re: Schematic from luatable is somewhat broken

PostPosted: Sun Mar 12, 2017 08:37
by sofar
Try setting x = 9 and z = 8

but yeah, looking at the (tiny) image, it looks like it's all shuffled, lol

Re: Schematic from luatable is somewhat broken

PostPosted: Sun Mar 12, 2017 08:46
by Milan*
Nhaaargh! I really confused x and z! Thank you! :D
(and yes, it was really random, not just wrong sided as u would expect from confused x and z ;))

Re: [solved] Schematic from luatable is somewhat broken

PostPosted: Sun Mar 12, 2017 09:56
by sorcerykid
Yep, that was the first thing I noticed too. It should be set to 9, since you have 9 nodes per row.