half door mod!

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

half door mod!

by jordan4ibanez » Wed Dec 28, 2011 06:58

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.
Last edited by jordan4ibanez on Wed Dec 28, 2011 08:37, edited 1 time in total.
If you can think it, you can make it.
 

User avatar
IPushButton2653
Member
 
Posts: 666
Joined: Wed Nov 16, 2011 22:47

by IPushButton2653 » Wed Dec 28, 2011 07:03

Just implement this into a 1x2 area, and with some work, we may have ourselves a door mod :D
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Wed Dec 28, 2011 07:06

but idk HOW! go onto the minetest irc and we can chat about it
If you can think it, you can make it.
 

User avatar
IPushButton2653
Member
 
Posts: 666
Joined: Wed Nov 16, 2011 22:47

by IPushButton2653 » Wed Dec 28, 2011 08:20

1x2 door = make texture twice as high and play around with the init.lua........but first, get that sucker to move!!!
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Wed Dec 28, 2011 08:27

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
If you can think it, you can make it.
 

User avatar
IPushButton2653
Member
 
Posts: 666
Joined: Wed Nov 16, 2011 22:47

by IPushButton2653 » Wed Dec 28, 2011 08:34

The hatches mod works pretty good with moving......
 

ironzorg
Member
 
Posts: 46
Joined: Tue Aug 23, 2011 06:34

by ironzorg » Wed Dec 28, 2011 10:58

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 !
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Wed Dec 28, 2011 16:40

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?
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed Dec 28, 2011 19:02

The openened door doesn't look like a fence in Multiplayer:
Image
Last edited by sfan5 on Wed Dec 28, 2011 19:02, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Thu Dec 29, 2011 00:44

@randomproof as far as i know you can't attach metadata to a node only to entrys am I wrong?
DON'T mention coding style!
(c) sapier all rights reserved
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Thu Dec 29, 2011 02:03

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.
Last edited by randomproof on Thu Dec 29, 2011 15:42, edited 1 time in total.
 

User avatar
bgsmithjr
Member
 
Posts: 436
Joined: Thu Mar 08, 2012 23:21

by bgsmithjr » Sat Mar 24, 2012 09:15

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
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 38 guests

cron