[Mod] Hatches [hatches] (missing license)

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

[Mod] Hatches [hatches] (missing license)

by ironzorg » Post

Hello everyone.

Not much to be said, the title is pretty much self explanatory: I implemented hatches as a LUA mod.

Image

Image

Image

When it's open, a trapdoor is climbable, and you can't go through it when it's closed (the upcoming version of minetest will allow me not to use the whole node as boundary box).

Sorry for the poor textures, feel free to make your own (I'm a terrible artist, although I felt like I had to release that mod with at least one texture).

Download
Last edited by ironzorg on Thu Dec 22, 2011 10:47, edited 1 time in total.

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

by sapier » Post

Great mod! Thanks!

There's a small bug in it, when digging a placed hatch there seem to be two different types of hatch.
At least I've gotten two stacks that havent been combinable.
DON'T mention coding style!
(c) sapier all rights reserved

User avatar
MrThebuilder3
Member
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Post

amazing!

maddogg
Member
Posts: 27
Joined: Wed Dec 21, 2011 23:55

by maddogg » Post

yes Fair play it will be good

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

by ironzorg » Post

sapier wrote:Great mod! Thanks!

There's a small bug in it, when digging a placed hatch there seem to be two different types of hatch.
At least I've gotten two stacks that havent been combinable.
Indeed, I'll look into it.

EDIT: It's fixed, I uploaded the new version of the mod.
What's changed:
  • Fixed the boundary detection bug when placed an open hatch
  • Fixed the compatibilty issue when harvesting an open/closed hatch
  • Enhanced the boundary box of the closed hatch
Last edited by ironzorg on Thu Dec 22, 2011 10:46, edited 1 time in total.

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

by jordan4ibanez » Post

hello, am program. do language in rust. make computer do. okay i go now.

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

by ironzorg » Post

jordan4ibanez wrote:I improved hatches!

http://www.megaupload.com/?d=AYUZGV9G
I don't want to sound harsh, but all you did was disabling the climbable attribute of open hatches, which was there on purpose..

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

Nice mod! May I use it for my mesecon mod, so that hatches can be controlled by mesecons?
Redstone for minetest: Mesecons (mesecons.net)

hurufu
Member
Posts: 21
Joined: Sat Dec 24, 2011 18:52

by hurufu » Post

Great!
Could you put the texture to the upper side of block? So when you are walking on it, there were no empty space between you and visible texture.

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

by ironzorg » Post

Jeija wrote:Nice mod! May I use it for my mesecon mod, so that hatches can be controlled by mesecons?
Absolutely.
hurufu wrote:Great!
Could you put the texture to the upper side of block? So when you are walking on it, there were no empty space between you and visible texture.
In fact this is due to a limitation of minetest's engine, actually I can't set the boundary box to be exactly the outline of the hatch.
We have to wait for the next release (with the stairs code if I'm not mistaken) so that I can be able to fix that. Also hence the climbable attribute.

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

by Calinou » Post

Small request: When hatch is open, it has no collision (not walkable). When closed, it is climbable. It feels much better IMO :)

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

by ironzorg » Post

Calinou wrote:Small request: When hatch is open, it has no collision (not walkable). When closed, it is climbable. It feels much better IMO :)
If it was climbable when open, you would be able to go through it. Moreover, it's climbable when it's open because of that boundary box problem (it makes much more sense).

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

I've changed it to work with the newest version of MineTest:

Code: Select all

-- Local constants
-- This _has_ to be set to 2
local HATCH_OPENED = 2
-- This has to be != from HATCH_OPENED and is coded on 4 bits
local HATCH_CLOSED = 1

-- Local Functions
local on_hatch_punched = function(pos, node, puncher)
    if (node.name ~= 'hatches:hatch_closed')
        and (node.name ~= 'hatches:hatch_opened') then
        return
    end
    local state = node.param2

    -- Switch the hatch state when hit
    if state == HATCH_OPENED then
        node.name = 'hatches:hatch_closed'
        node.param2 = HATCH_CLOSED
    elseif state == HATCH_CLOSED then
        node.name = 'hatches:hatch_opened'
        node.param2 = HATCH_OPENED
    else
        print('Uninitialized node: ' .. state)
    end

    minetest.env:add_node(pos, {
        name = node.name,
        param2 = node.param2,
    })
end

local on_hatch_placed = function(pos, node, placer)
    if node.name ~= 'hatches:hatch_opened' then
        return
    end

    minetest.env:add_node(pos, {
        name = node.name,
        param2 = HATCH_OPENED,
    })
end

-- Nodes
-- As long as param2 is set to 1 for open hatches, it doesn't matter to
-- use drawtype = 'signlike'
minetest.register_node('hatches:hatch_opened', {
    drawtype = 'signlike',
    tile_images = {'hatch.png'},
    inventory_image = 'hatch.png',
    sunlight_propagates = true,
    paramtype = 'light',
    paramtype2 = "wallmounted",
    legacy_wallmounted = true,
    walkable = false,
    climbable = true,
    selection_box = {
        type = "wallmounted",
    },
    material = minetest.digprop_constanttime(1.0),
    drop = 'hatches:hatch_closed',
})

minetest.register_node('hatches:hatch_closed', {
    description = "Hatch",
    drawtype = 'raillike',
    tile_images = {'hatch.png'},
    inventory_image = 'hatch.png',
    wield_image = "hatch.png",
    paramtype = 'light',
    walkable = true,
    selection_box = {
        type = "fixed",
        fixed = {-1/2, -1/2, -1/2, 1/2, -2/5, 1/2},
    },
    material = minetest.digprop_constanttime(1.0),
})

-- Crafts
minetest.register_craft({
    output = '"hatches:hatch_closed" 2',
    recipe = {
        {'"default:wood" 1', '"default:wood" 1', '"default:wood" 1'},
        {'"default:wood" 1', '"default:wood" 1', '"default:wood" 1'},
    },
})

-- Change the hatch state
minetest.register_on_punchnode(on_hatch_punched)
-- Reset param2 for open hatches
minetest.register_on_placenode(on_hatch_placed)

-- Mesecon Stuff:
mesecon:register_on_signal_on(on_hatch_punched)
mesecon:register_on_signal_off(on_hatch_punched)
This is based off of Jeija's modification allowing mesecons to control hatches.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

cisoun wrote:Just a question: how can I remove then?
They can be dug in exactly 1 second, with any tool.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
cisoun
Member
Posts: 232
Joined: Tue Apr 19, 2011 18:56
GitHub: cisoun
IRC: cisoun
In-game: cisoun
Location: Switzerland
Contact:

by cisoun » Post

I just noticed that. \o/
Another bug: the hatch doesn't rotate like in the first picture. It just goes up and down. Is that normal?
Not here for a while due to some troubles between my graphic card and Minetest.
Cisoun's Texture Pack | The Conifers Mod (deprecated) | Faenza icons for Minetest |
Website

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

Well with the way it is now hatches always open to the positive X axis, I'm not sure how to store the orientation properly in the node after the hatch is closed.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

cisoun wrote:I just noticed that. \o/
Another bug: the hatch doesn't rotate like in the first picture. It just goes up and down. Is that normal?
++
And if I try to dig it (and it's really hard), I can get opened hatch instead of normal (they don't stack together).
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

neko259 wrote:
cisoun wrote:I just noticed that. \o/
Another bug: the hatch doesn't rotate like in the first picture. It just goes up and down. Is that normal?
++
And if I try to dig it (and it's really hard), I can get opened hatch instead of normal (they don't stack together).
@cisoun: I may have misunderstood you at first... I had the same issue, but fixed it in my version, which you can find posted above. It requires MineTest 20120122 at minimum. I've tested my version, it fixes the issue.

@neko259: The opened hatch issue is also fixed in my version, but as I mentioned, it requires the latest version.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

@Temperest: Can you pack the whole mod to .tar.gz or .zip and post it to omploader? I'd be grateful :)
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

@neko259: Certainly.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

evildrummer
Member
Posts: 15
Joined: Sat Feb 11, 2012 13:32

by evildrummer » Post

Can you make a Zip version?

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

evildrummer wrote:Can you make a Zip version?
Temperest wrote:@neko259: Certainly.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

sfan5
Moderator
Posts: 4095
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

License is missing
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

MilanFIN
Member
Posts: 20
Joined: Wed Jan 25, 2012 17:23

by MilanFIN » Post

Will this work on the 0.4.dev-20120122-1 version?

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Should do.

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests