Page 1 of 1

half door mod!

PostPosted: Wed Dec 28, 2011 06:58
by jordan4ibanez
well this is my first "mod" (its a mod..of the hatches mod)

basically its like a little cubby for chests..or a half door for your house (could have 2 on top eachother for a full door)

the door opened:
Image

the door closed:
Image


download link:
http://goo.gl/yV6cx (0.0.1)

TO DO:
-make the door face outward via the opposite direction the character is facing.
-remove the (closed door) box draw type and replace it with sign.
-make the selection box rotate along with the draw type so it looks like an actual door.

please give your input on what you think!

help would be greatly appreciated.

PostPosted: Wed Dec 28, 2011 07:03
by IPushButton2653
Just implement this into a 1x2 area, and with some work, we may have ourselves a door mod :D

PostPosted: Wed Dec 28, 2011 07:06
by jordan4ibanez
but idk HOW! go onto the minetest irc and we can chat about it

PostPosted: Wed Dec 28, 2011 08:20
by IPushButton2653
1x2 door = make texture twice as high and play around with the init.lua........but first, get that sucker to move!!!

PostPosted: Wed Dec 28, 2011 08:27
by jordan4ibanez
IPushButton2653 wrote:1x2 door = make texture twice as high and play around with the init.lua........but first, get that sucker to move!!!


making the texture twice as high would just distort it..and i honestly dont think its possible to make nodes move right now

PostPosted: Wed Dec 28, 2011 08:34
by IPushButton2653
The hatches mod works pretty good with moving......

PostPosted: Wed Dec 28, 2011 10:58
by ironzorg
The hatches mod uses a special variable (param2), and it shouldn't be (but it still works because I overwrite it with a good value). The thing is: you can't use it for wall mounted blocks such as ladders and doors because that same param2 variable is used to determine the orientation/position of the block.

If you want to make a door mod, the hatches mod code is not the way to go !

PostPosted: Wed Dec 28, 2011 16:40
by randomproof
ironzorg wrote:The hatches mod uses a special variable (param2), and it shouldn't be (but it still works because I overwrite it with a good value). The thing is: you can't use it for wall mounted blocks such as ladders and doors because that same param2 variable is used to determine the orientation/position of the block.

If you want to make a door mod, the hatches mod code is not the way to go !

Why not use meta to store the hatches mod special variable instead of param2?

PostPosted: Wed Dec 28, 2011 19:02
by sfan5
The openened door doesn't look like a fence in Multiplayer:
Image

PostPosted: Thu Dec 29, 2011 00:44
by sapier
@randomproof as far as i know you can't attach metadata to a node only to entrys am I wrong?

PostPosted: Thu Dec 29, 2011 02:03
by randomproof
sapier wrote:@randomproof as far as i know you can't attach metadata to a node only to entrys am I wrong?

Yes, you can. In the node definition set "metadata_name = "generic"" and you can call these functions:
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("doors:doorhandle_wood", {
    tile_images = {"doors_wood_handle.png"},
    inventory_image = minetest.inventorycube("doors_wood_handle.png"),
    is_ground_content = false,
    furnace_burntime = 7,
    material = minetest.digprop_woodlike(0.75),
    metadata_name = "generic"  <---------------------See here!
})

minetest.register_on_placenode(function(pos, newnode, placer)
    if string.match(newnode.name, "doors:doorhandle_") ~= nil then
        local meta = minetest.env:get_meta(pos)  <---------------------See here!
        meta:set_infotext("Punch Here To Open/Close Door")  <---------------------See here!
    end
end)

minetest.register_on_punchnode(function(pos, node, puncher)
    if string.match(node.name, "doors:doorhandle_") ~= nil then
        if puncher:get_wield_digging_properties().dt_crumbliness ~= 0 then
            return
        end

        local meta = minetest.env:get_meta(pos)  <---------------------See here!
        meta:set_infotext(infotext)  <---------------------See here!

        pivot_node = meta:get_string("pivot_node")  <---------------------See here!
       
        meta:set_string("pivot_node", pivot_node)  <---------------------See here!
...

You will be dealing with strings, but they can be easily changed to numbers. Also, make sure you set the infotext when the node is placed, otherwise it will display the default infotext.

PostPosted: Sat Mar 24, 2012 09:15
by bgsmithjr
Hey buddy, I have been developing a fencelike gate, that attaches to your fence and opens and shuts. Take a look and tell me what you think.

gate