Page 1 of 1

Variable block sizes

Posted: Sun Jan 26, 2014 20:29
by theblob
I am working on a mod (just to mess around, I'm not sure if I'll finish it or not), and I was wondering how to make a block not be the normal size. For example, having a block be 3 high, 2 long, and 2 wide. Does anyone know if this would be possible? Thanks for your help in advance!

Posted: Sun Jan 26, 2014 20:39
by Calinou
Nodeboxes can be used to make nodes larger than 1×1×1 but it could cause some collision/rendering issues.

Posted: Sun Jan 26, 2014 20:40
by PilzAdam
See the big pumpkin of farming_plus.

Posted: Mon Jan 27, 2014 20:59
by theblob
The nodeboxes are working great, but now I have another issue; the player falls through the node when walking on top of it. I set walkable to true, but that didn't fix it. The player only goes through the node from the top, not the sides. Any ideas on what could be wrong?

Posted: Mon Jan 27, 2014 21:05
by Topywo
theblob wrote:The nodeboxes are working great, but now I have another issue; the player falls through the node when walking on top of it. I set walkable to true, but that didn't fix it. The player only goes through the node from the top, not the sides. Any ideas on what could be wrong?
I don't know if it's the best solution, but you could try:
climbable = true,

Although one probably still can climb into it then.

Posted: Mon Jan 27, 2014 22:49
by theblob
Topywo wrote:
theblob wrote:The nodeboxes are working great, but now I have another issue; the player falls through the node when walking on top of it. I set walkable to true, but that didn't fix it. The player only goes through the node from the top, not the sides. Any ideas on what could be wrong?
I don't know if it's the best solution, but you could try:
climbable = true,

Although one probably still can climb into it then.
That's not working either, but thanks for the suggestion. Something else that's odd is that the node looks like it's covered in a shadow, no matter where it is placed.

Posted: Tue Jan 28, 2014 22:27
by Topywo
I don't directly know what is causing that. However I found some old code from my sea modpack that I've tried out. I don't see strange shadows and I don't go through the node (tested it also with one of the later minetest versions). Just look for the differences with your code. I hope it helps!

Code:

Code: Select all

minetest.register_node("seaplants:stemsgreen", {
    description = 'Stems green',
    tiles = {
        "default_sand.png", -- up
        "default_sand.png", -- down
        "seaplants_yellowgreenlight.png", -- right
        "seaplants_greenyellowdark.png", -- left
        "seaplants_greenyellowlight.png", -- front
        "seaplants_yellowgreendark.png", -- back
    },
    drawtype = "nodebox",
    sunlight_propagates = true,
--    light_source = 1,
    paramtype = 'light',
    paramtype2 = "facedir",
    node_box = {
        type = "fixed",
        fixed = {
            -- stem_bottom
            {-0.02, 0.500, -0.01, 0.02, 1, 0.01},
            {-0.0175, 0.500, -0.0125, 0.0175, 1, 0.0125},
            {-0.015, 0.500, -0.015, 0.015, 1, 0.015},

   {a lot more like this]

            {-0.0075+d, 1.5+h, -0.0125+d, 0.0075+d, 2+h, 0.0125+d},
            {-0.005+d, 1.5+h, -0.015+d, 0.005+d, 2+h, 0.0150+d},


            -- block
            {-0.502, 0.50, -0.502, 0.502, 0.502, 0.502},
            {-0.502, -0.502, -0.502, 0.50, 0.502, 0.502},
            {-0.502, -0.502, -0.502, 0.502, 0.50, 0.502},
            {-0.502, -0.502, -0.502, 0.502, 0.502, 0.50},
            {-0.50, -0.502, -0.502, 0.502, 0.502, 0.502},
            {-0.502, -0.502, -0.50, 0.502, 0.502, 0.502}
        },
    },
    selection_box = {
        type = "fixed",
        fixed = {
            -- block
            {-0.502, 0.50, -0.502, 0.502, 0.502, 0.502},
            {-0.502, -0.502, -0.502, 0.50, 0.502, 0.502},
            {-0.502, -0.502, -0.502, 0.502, 0.50, 0.502},
            {-0.502, -0.502, -0.502, 0.502, 0.502, 0.50},
            {-0.50, -0.502, -0.502, 0.502, 0.502, 0.502},
            {-0.502, -0.502, -0.50, 0.502, 0.502, 0.502}
        },
    },

    drop = "seaplants:chewstickgreen",
    groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
    sounds = default.node_sound_leaves_defaults()
}) 

If you want to see it working, you can download the nodebox version 0.2.1 of the sea modpack (under the spoiler older versions)


Edit: Typo's.