Another stupid question. Stupid answers welcome.

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

Another stupid question. Stupid answers welcome.

by Tedypig » Tue Mar 12, 2013 03:39

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.
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Tue Mar 12, 2013 04:09

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(),
})
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Tue Mar 12, 2013 04:27

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.
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Tue Mar 12, 2013 10:53

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.
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Tue Mar 12, 2013 20:54

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?"
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

by Menche » Wed Mar 13, 2013 00:25

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.
An innocent kitten dies every time you top-post.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Wed Mar 13, 2013 01:35

I will try, but I'm new to modding/coding. It will be a while before I can do something of this scale.
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 


Return to WIP Mods

Who is online

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

cron