Page 1 of 2

[Mod] Fireplace and Chimney [v1.1.7][firestone]

PostPosted: Mon Dec 31, 2012 03:15
by Bas080
Use big fire for light-decoration. Be careful, fire may jump to nearby flammable nodes.

Crafts
Image

Chimney
ImageImageImage
ImageImageImage
ImageImageImage

Changelog

Download
http://goo.gl/4IpGw
...or see code https://github.com/bas080/firestone

Screenshots
https://dl.dropbox.com/u/419967/Screenshot%20-%2012312012%20-%2003%3A34%3A13%20AM.png
https://dl.dropbox.com/u/419967/Screenshot%20-%2012312012%20-%2003%3A55%3A39%20AM.png

Depends
Default

License
WTFPL textures and LUA

PostPosted: Mon Dec 31, 2012 03:20
by Chinchow
Cool now I can make a medieval fortress
question why is it 0.5?

PostPosted: Mon Dec 31, 2012 03:53
by Bas080
question why is it 0.5?


Because I am not confident enough to call it a full version yet. Still requires craft and maybe a texture update. Anybody ideas for craft?

PostPosted: Mon Dec 31, 2012 04:00
by Chinchow
Well I'm making a mod that adds a blaze gem to the game but if you want a default recipe then how about
[S][F][S]
[S][S][S]
[S][S][S]

S=stone
F=Furnace

PostPosted: Mon Dec 31, 2012 08:17
by Casimir
If you delete the after_place_node and change the abm to
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_abm({
    nodenames = {"firestone:firestone"},
    interval = 2,
    chance = 5,
    action = function(pos)
        local t = {x=pos.x, y=pos.y+1, z=pos.z}
        local n = minetest.env:get_node(t)
        if n.name == "firestone:flame_low" then
            minetest.env:set_node(t, {name="firestone:flame"})
        elseif n.name == "firestone:flame" then
            minetest.env:set_node(t, {name="firestone:flame_low"})
        -- lighting the firestone
        elseif minetest.get_item_group(n.name, "igniter") == 2 then
            minetest.env:set_node(t, {name="firestone:flame"})
        end
       
       
    end,

})

Then you can lighten the firestone by making fire above.

Edit:
Better code. But this won't work with the current fire. I already made a pullrequest to make fire buildable to.
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_alias("firestone", "firestone:firestone")

local makes_fire = false -- When set ture the firestone makes fire itself. When false you need to lighten it.

minetest.register_craft({
    output = '"firestone:firestone" 1',
    recipe = {
        {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
        {'default:coal_lump', 'default:torch', 'default:coal_lump'},
        {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
    }
})

if makes_fire == true then
minetest.register_node("firestone:firestone", {
    description = "Fire node",
    tile_images = {"firestone_firestone_top.png^firestone_embers.png", "firestone_firestone_bottom.png", "firestone_firestone.png"},
    groups = {igniter=2, crumbly=3},
    damage_per_second = 4,
   
    after_place_node = function(pos)
        local t = {x=pos.x, y=pos.y+1, z=pos.z}
        local n = minetest.env:get_node(t)
        if n.name == "air" then
            minetest.env:add_node(t, {name="firestone:flame"})
        end
    end,

    after_dig_node = function(pos)
        local t = {x=pos.x, y=pos.y+1, z=pos.z}
        local n = minetest.env:get_node(t)
        if n.name == "firestone:flame" or n.name == "firestone:flame_low" then
            minetest.env:remove_node(t)
        end
    end,
   
})
else
minetest.register_node("firestone:firestone", {
    description = "Fire node",
    tile_images = {"firestone_firestone_top.png^firestone_embers.png", "firestone_firestone_bottom.png", "firestone_firestone.png"},
    groups = {igniter=2, crumbly=3},
    damage_per_second = 4,

    after_dig_node = function(pos)
        local t = {x=pos.x, y=pos.y+1, z=pos.z}
        local n = minetest.env:get_node(t)
        if n.name == "firestone:flame" or n.name == "firestone:flame_low" then
            minetest.env:remove_node(t)
        end
    end,
   
})
end

minetest.register_node("firestone:flame", {
    description = "Fire",
    drawtype = "plantlike",
    tiles = {{
        name="fire_basic_flame_animated.png",
        animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
    }},
    inventory_image = "fire_basic_flame.png",
    light_source = 14,
    groups = {igniter=2, immortal, not_in_creative_inventory=1},
    drop = '',
    walkable = false,
    damage_per_second = 4,
})

minetest.register_node("firestone:flame_low", {
    description = "Fire",
    drawtype = "plantlike",
    tiles = {{
        name="fire_basic_flame_animated.png",
        animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
    }},
    inventory_image = "fire_basic_flame.png",
    light_source = 12,
    groups = {igniter=2, immortal, not_in_creative_inventory=1},
    drop = '',
    walkable = false,
    damage_per_second = 4,
})

minetest.register_abm({
    nodenames = {"firestone:firestone"},
    interval = 2,
    chance = 5,
    action = function(pos)
        local t = {x=pos.x, y=pos.y+1, z=pos.z}
        local n = minetest.env:get_node(t)
        if n.name == "firestone:flame_low" then
            minetest.env:set_node(t, {name="firestone:flame"})
        elseif n.name == "firestone:flame" then
            minetest.env:set_node(t, {name="firestone:flame_low"})
        -- lighting the firestone
        elseif minetest.get_item_group(n.name, "igniter") ~= 0 and makes_fire == false and minetest.registered_nodes[n.name].buildable_to == true then
                minetest.env:set_node(t, {name="firestone:flame"})
        end
       
       
    end,

})

PostPosted: Wed Jan 02, 2013 18:05
by Bas080
Made sure the functionality you where talking about is implemented. Did it differently though. You can see it on the github. There is however an issue with your and mine code. The fire abm sometimes removes the fire before the firestone abm turns basic_flame into firestone flame.. something to solve.

PostPosted: Wed Jan 02, 2013 19:35
by Casimir
Bas080 wrote:There is however an issue with your and mine code. The fire abm sometimes removes the fire before the firestone abm turns basic_flame into firestone flame.. something to solve.

I don't see that as a problem. Just like in the real world you might need several tries. Especially in combination with my stoneagemod - where making fire is expensive.

PostPosted: Thu Jan 03, 2013 10:46
by fishyWET
I would love a firestone with blue flames, could you please create that thanks

PostPosted: Thu Jan 03, 2013 13:48
by Chinchow
Wouldnt that just be retexturing it?

PostPosted: Thu Jan 03, 2013 15:22
by Mito551
i would suggest havin

coal coal coal
coal coal coal
stone stone stone

craft recipe

PostPosted: Thu Jan 03, 2013 16:52
by jojoa1997
how about this s=stone c=coal
ccc
scs
sss

or

scs
scs
sss

or

scs
sss

PostPosted: Thu Jan 03, 2013 19:14
by Mito551
jojoa1997 wrote:scs
sss


too little coal

jojoa1997 wrote:how about this s=stone c=coal
ccc
scs
sss

i was thinking about that variant as well

PostPosted: Thu Jan 03, 2013 19:22
by Casimir
ccc
c_c
ccc

PostPosted: Thu Jan 03, 2013 19:45
by jojoa1997
s=stick , c-coal , t=torch
ctc
scs
sss

t is to ignite coal

PostPosted: Wed Feb 13, 2013 20:17
by aximx51v
Hey I really like this mod! I just thought of something to make it better:
A working chimney for the fireplace!

Image



It's got animated smoke, and the chimney is hollow. You can even fall down inside it, if you get yourself aligned perfectly.

Image



Here's the code:
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_abm(
    {nodenames = {"firestone:chimney"},
    neighbors = {"group:igniter"},
    interval = 5.0,
    chance = 1,
    action = function(pos, node, active_object_count, active_object_count_wider)
            p_bottom = {x=pos.x, y=pos.y-1, z=pos.z}
            n_bottom = minetest.env:get_node(p_bottom)
            local chimney_top = false
            local j = 1
            local node_param = minetest.registered_nodes[n_bottom.name]
            if node_param.groups.igniter then
                while chimney_top == false do
                    upper_pos = {x=pos.x, y=pos.y+j, z=pos.z}
                    upper_node = minetest.env:get_node(upper_pos)
                    if  upper_node.name == "firestone:chimney" then
                         j = j+1
                    elseif upper_node.name == "air" then
                        minetest.env:place_node(upper_pos,{name="firestone:smoke"})
                        chimney_top = true
                        elseif upper_node.name == "firestone:smoke" then
                        local old = minetest.env:get_meta(upper_pos)
                        old:set_int("age", 0)
                        chimney_top = true
                    elseif upper_node.name ~= "air" or upper_node.name ~= "firestone:chimney" or upper_node.name ~= "firestone:smoke" then
                        chimney_top = true
                    end
                end
        end
    end,
})

minetest.register_abm(
    {nodenames = {"firestone:smoke"},
    interval = 5.0,
    chance = 1,
    action = function(pos, node, active_object_count, active_object_count_wider)
        local old = minetest.env:get_meta(pos)
        if old:get_int("age") == 1 then
            minetest.env:remove_node(pos)
        else
            old:set_int("age", 1)
        end
    end
})

minetest.register_craft({
    output = '"firestone:chimney" 4',
    recipe = {
        {'', 'default:stone', ''},
        {'default:stone', '', 'default:stone'},
        {'', 'default:stone', ''},
    }
})

minetest.register_node("firestone:chimney", {
    description = "WIP",
    drawtype = "nodebox",
        node_box = {type = "fixed",
            fixed = {
                {0.3125, -0.5, -0.5, 0.5, 0.5, 0.5},
                {-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
                {-0.5, -0.5, -0.5, -0.3125, 0.5, 0.5},
                {-0.5, -0.5, -0.5, 0.5, 0.5, -0.3125},
            },
        },
        selection_box = {
            type = "regular",
        },
    tiles ={"chimney.png", "chimney.png", "chimney_side.png"},
    paramtype = 'light',
    sunlight_propagates = true,
    walkable = true,
    groups = {cracky=2},
})

minetest.register_node("firestone:smoke", {
    description = "smoke",
    drawtype = "plantlike",
    tiles ={{
    name="smoke_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0},
    }},
    sunlight_propagates = true,
    groups = {not_in_creative_inventory=1},
    paramtype = "light",
    walkable = false,
    pointable = false,
    diggable = false,
    buildable_to = true,
    light_source = 10,
    on_place_node = function(pos)
        local old = minetest.env:get_meta(pos)
        old:set_int("age", 0)
    end
})



And here's the textures:

Image

Image

Image


The chimney textures are just cobblestone edited.
The smoke animation was made from tiles from Nemo8's old nPartical mod, dunno if you can use those long term because I can't find a license for it.

Anyway, tell me what you think.

PostPosted: Wed Feb 13, 2013 20:22
by BZab
Nice, but will cobble texture change on my texture pack's texture? :D

PostPosted: Wed Feb 13, 2013 20:55
by aximx51v
BZab wrote:Nice, but will cobble texture change on my texture pack's texture? :D


not the way it's set up currently. the chimney uses custom images. it can be changed though :)

PostPosted: Wed Feb 13, 2013 21:31
by BZab
I ask bcoz, eg. non-cubic block use textures of actually used texture pack :D

PostPosted: Thu Feb 14, 2013 14:29
by Casimir
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
    tiles ={"default_cobble.png"},

PostPosted: Fri Feb 15, 2013 04:55
by aximx51v
Casimir wrote:
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
    tiles ={"default_cobble.png"},

He's got it. Replace:
tiles ={"chimney.png", "chimney.png", "chimney_side.png"},
with that, and you're good to go.

PostPosted: Fri Feb 15, 2013 10:43
by deivan
Nice. :)

PostPosted: Fri Feb 15, 2013 14:05
by LazyJ
How far will the fire jump?

Does the distance depend on the flamible item, ie: leaves catch fire closer than wood?

PostPosted: Fri Feb 15, 2013 15:59
by Likwid H-Craft
I made Fire Poof Wood, so no need Fire of wood:D

PostPosted: Fri Feb 15, 2013 16:49
by Bas080
aximx51v wrote:Hey I really like this mod! I just thought of something to make it better:
A working chimney for the fireplace!

Great idea! Your code works well! It has been implemented. I agree that the cobble texture used should be from default and also craft should be with cobble not with stone.

LazyJ wrote:How far will the fire jump?

same as fire, 2 nodes surrounding.

Likwid H-Craft wrote:I made Fire Proof Wood, so no need Fire of wood:D

Good idea!

MOD UPDATED!

PostPosted: Fri Feb 15, 2013 16:51
by Likwid H-Craft
So I should upload my, fire proof wood?

PostPosted: Fri Feb 15, 2013 21:07
by Bas080
Likwid H-Craft wrote:So I should upload my, fire proof wood?


What should be the craft to fireproof wood?

PostPosted: Fri Feb 15, 2013 21:57
by sdzen
Bas080 wrote:
Likwid H-Craft wrote:So I should upload my, fire proof wood?


What should be the craft to fireproof wood?

either do some black magic with mese fragments or coat it in something non flammable in crafting

PostPosted: Fri Feb 15, 2013 22:47
by Likwid H-Craft
What, about for maybe, the beta build we have a bucket of water, and later I make a, ore that is fire proof.

PostPosted: Sat Feb 16, 2013 18:48
by BrandonReese
Oops... I thought I had been careful about having flamable blocks too close to the fireplace... apparently I missed on on the second floor.

Image

Image

Image

PostPosted: Sat Feb 16, 2013 19:23
by Likwid H-Craft
Oh man I think I should add fire proofed wood >.< before it to late.

It be in default for, now.