Thanks for the reply, Ferk.
Ferk wrote:Maybe you could try changing your chunksize setting and see if it has any repercusions. I think chunks start at -32,-32,-32 (correct me if I'm wrong) and are set by default to be 80 nodes wide (5 blocks of 16 nodes) in all directions. This means the chunk ends at y=45, I guess your tower is taller than that, specially if you are placing it already in y=20
That seems like a plausible reason. I'll try again with a much smaller mts file this weekend. Maybe split the tower up in separate mts files per floor or something. I'll see what that does. My tower is 3 floors and a roof, but that could easily be too much according to your explanation.
What is weird though: I have a draw_box function (see below) which draws a 3-D outline (for debugging purposes) around the area where the tower is supposed to be, and that works perfectly, even if the mts file itself isn't shown !
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
treasuretowers_draw_box = function(start_pos, end_pos, drawblock)
local inc_x = 1
local inc_y = 1
local inc_z = 1
local blockpos = start_pos
if (start_pos.x > end_pos.x) then
inc_x = -1
end
if (start_pos.y > end_pos.y) then
inc_y = -1
end
if (start_pos.z > end_pos.z) then
inc_z = -1
end
for i= start_pos.x, end_pos.x, inc_x do
blockpos = {x=i, y=start_pos.y, z=start_pos.z}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=i, y=start_pos.y, z=end_pos.z}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=i, y=end_pos.y, z=start_pos.z}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=i, y=end_pos.y, z=end_pos.z}
minetest.add_node(blockpos, { name=drawblock})
end
for i= start_pos.y, end_pos.y, inc_y do
blockpos = {x=start_pos.x, y=i, z=start_pos.z}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=start_pos.x, y=i, z=end_pos.z}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=end_pos.x, y=i, z=start_pos.z}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=end_pos.x, y=i, z=end_pos.z}
minetest.add_node(blockpos, { name=drawblock})
end
for i= start_pos.z, end_pos.z, inc_z do
blockpos = {x=start_pos.x, y=start_pos.y, z=i}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=start_pos.x, y=end_pos.y, z=i}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=end_pos.x, y=start_pos.y, z=i}
minetest.add_node(blockpos, { name=drawblock})
blockpos = {x=end_pos.x, y=end_pos.y, z=i}
minetest.add_node(blockpos, { name=drawblock})
end
end
Ferk wrote:Perhaps your safest bet is to use a placer node with an abm to place the schematic. Even though this would make the building "pop up" to existence when the player walks in.
Yep, that was my previous approach and it worked perfectly. I had defined a rare ore which spawns in dirt_with_grass blocks and then an abm to replace that block with my tower.
The "pop up" effect was really annoying, even after I added some particles to simulate a 'magic' effect.
Ferk wrote:How big is your tower? I've also had problems when trying to get the Tutorial world from Wuzzy generated using mts.. it works fine if I use worledit files but mts don't seem to get saved properly at times, specially if it's big. My tutorial world mts was like only 1 KB in size when saved even though it was a big area, and crashed when I tried to place it. But it seems it's not the same problem you had.
I started with a rather small tower, the file is 736 bytes. dimensions are 13x13 and 20 high.
Maybe I'll write a function which processes the .we fileformat and uses set_node to build my tower.
Edit:
I've tried it with a small 3x3x2 mts file and have the same problem. I'm dumping mts files, and going to write a .we drawing function. I'll have a look at WorldEdit and see how they do it.