Page 1 of 1

Another stupid question. Stupid answers welcome.

PostPosted: Tue Mar 12, 2013 03:39
by Tedypig
Correct me if I'm wrong, but this node registry should work, right?

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
minetest.register_node("default:rail", {
    description = "Rail",
    drawtype = "raillike",
    tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
    inventory_image = "default_rail.png",
    wield_image = "default_rail.png",
    paramtype = "light",
    paramtype2 = "wallmounted",
    is_ground_content = true,
    walkable = false,
    selection_box = {
        type = "fixed",
                -- but how to specify the dimensions for curved and sideways rails?
                fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
    },
    groups = {bendy=2,snappy=1,dig_immediate=2,attached_node=1},
})


It's (obviously) the default:rail registry. With paramtype2 = "wallmounted" added. I know I'm wrong but in all logic that means that sh*t can go on a wall! Lol. Ever since I found the "carts" mod, I have want to stick the rail on the wall to make elevators. It would be PERFECT for mesecons. I'm starting to realize that can't be done.

P.S. I did change it from default:rail to elevator:shaft. In case you thought that would be a problem.

PostPosted: Tue Mar 12, 2013 04:09
by ashenk69
If you look at how ladders are registered you need to use the signlike drawtype instead of the raillike.

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
minetest.register_node("default:ladder", {
    description = "Ladder",
    drawtype = "signlike",
    tiles = {"default_ladder.png"},
    inventory_image = "default_ladder.png",
    wield_image = "default_ladder.png",
    paramtype = "light",
    paramtype2 = "wallmounted",
    is_ground_content = true,
    walkable = false,
    climbable = true,
    selection_box = {
        type = "wallmounted",
        --wall_top = = <default>
        --wall_bottom = = <default>
        --wall_side = = <default>
    },
    groups = {snappy=1,choppy=2,oddly_breakable_by_hand=3,flammable=2},
    legacy_wallmounted = true,
    sounds = default.node_sound_wood_defaults(),
})

PostPosted: Tue Mar 12, 2013 04:27
by Tedypig
I just wish I could figure it out. I want an elevator. The only one I can find is more of a grav-lift, and that's not what I wanted.

PostPosted: Tue Mar 12, 2013 10:53
by Mito551
these rails won't work because they don't have rail group
Tedypig wrote:Correct me if I'm wrong, but this node registry should work, right?

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
minetest.register_node("default:rail", {
    description = "Rail",
    drawtype = "raillike",
    tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
    inventory_image = "default_rail.png",
    wield_image = "default_rail.png",
    paramtype = "light",
    paramtype2 = "wallmounted",
    is_ground_content = true,
    walkable = false,
    selection_box = {
        type = "fixed",
                -- but how to specify the dimensions for curved and sideways rails?
                fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
    },
    groups = {bendy=2,snappy=1,dig_immediate=2,attached_node=1},
})


It's (obviously) the default:rail registry. With paramtype2 = "wallmounted" added. I know I'm wrong but in all logic that means that sh*t can go on a wall! Lol. Ever since I found the "carts" mod, I have want to stick the rail on the wall to make elevators. It would be PERFECT for mesecons. I'm starting to realize that can't be done.

P.S. I did change it from default:rail to elevator:shaft. In case you thought that would be a problem.

PostPosted: Tue Mar 12, 2013 20:54
by Tedypig
Mito551 wrote:these rails won't work because they don't have rail group
Tedypig wrote:Correct me if I'm wrong, but this node registry should work, right?

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
minetest.register_node("default:rail", {
    description = "Rail",
    drawtype = "raillike",
    tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
    inventory_image = "default_rail.png",
    wield_image = "default_rail.png",
    paramtype = "light",
    paramtype2 = "wallmounted",
    is_ground_content = true,
    walkable = false,
    selection_box = {
        type = "fixed",
                -- but how to specify the dimensions for curved and sideways rails?
                fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
    },
    groups = {bendy=2,snappy=1,dig_immediate=2,attached_node=1},
})


It's (obviously) the default:rail registry. With paramtype2 = "wallmounted" added. I know I'm wrong but in all logic that means that sh*t can go on a wall! Lol. Ever since I found the "carts" mod, I have want to stick the rail on the wall to make elevators. It would be PERFECT for mesecons. I'm starting to realize that can't be done.

P.S. I did change it from default:rail to elevator:shaft. In case you thought that would be a problem.




So the bottom line would be "groups = {rail=1,bendy=2.....etc?"

PostPosted: Wed Mar 13, 2013 00:25
by Menche
Tedypig wrote:So the bottom line would be "groups = {rail=1,bendy=2.....etc?"

Yes. However, you would need to also modify carts for them to go vertically.

An idea: it would probably be possible to make a new group called "lift" or similar, and change the carts mod to lift carts when they hit a node in that group.

PostPosted: Wed Mar 13, 2013 01:35
by Tedypig
I will try, but I'm new to modding/coding. It will be a while before I can do something of this scale.