Variable block sizes

theblob
Member
 
Posts: 11
Joined: Sat Jan 25, 2014 17:31

Variable block sizes

by theblob » Sun Jan 26, 2014 20:29

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!
Dogecoin: DM33mpJVPMNiaTxBoBpiJChBrnLBQFyaw9
 

User avatar
Calinou
Moderator
 
Posts: 3156
Joined: Mon Aug 01, 2011 14:26
Location: Troyes, France
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sun Jan 26, 2014 20:39

Nodeboxes can be used to make nodes larger than 1×1×1 but it could cause some collision/rendering issues.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam
 

theblob
Member
 
Posts: 11
Joined: Sat Jan 25, 2014 17:31

by theblob » Mon Jan 27, 2014 20:59

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?
Last edited by theblob on Mon Jan 27, 2014 20:59, edited 1 time in total.
Dogecoin: DM33mpJVPMNiaTxBoBpiJChBrnLBQFyaw9
 

User avatar
Topywo
Member
 
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Mon Jan 27, 2014 21:05

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.
 

theblob
Member
 
Posts: 11
Joined: Sat Jan 25, 2014 17:31

by theblob » Mon Jan 27, 2014 22:49

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.
Dogecoin: DM33mpJVPMNiaTxBoBpiJChBrnLBQFyaw9
 

User avatar
Topywo
Member
 
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Tue Jan 28, 2014 22:27

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.
Last edited by Topywo on Tue Jan 28, 2014 22:28, edited 1 time in total.
 


Return to WIP Mods



Who is online

Users browsing this forum: Google [Bot] and 4 guests