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

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

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

by Bas080 » Post

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/Screens ... 3%20AM.png
https://dl.dropbox.com/u/419967/Screens ... 9%20AM.png

Depends
Default

License
WTFPL textures and LUA
Last edited by Bas080 on Thu Apr 11, 2013 09:47, edited 1 time in total.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

Cool now I can make a medieval fortress
question why is it 0.5?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

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?

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

Well I'm making a mod that adds a blaze gem to the game but if you want a default recipe then how about
[F]



S=stone
F=Furnace
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

User avatar
Casimir
Member
Posts: 1207
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

If you delete the after_place_node and change the abm to

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.

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,

})
Last edited by Casimir on Mon Dec 31, 2012 09:29, edited 1 time in total.

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

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.

User avatar
Casimir
Member
Posts: 1207
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

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.

User avatar
fishyWET
Member
Posts: 162
Joined: Tue Jan 01, 2013 07:43
GitHub: neinwhal
IRC: neinwhal
In-game: neinwhal
Location: Nowhere

by fishyWET » Post

-
Last edited by fishyWET on Tue Apr 04, 2017 06:05, edited 1 time in total.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

Wouldnt that just be retexturing it?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

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

by Mito551 » Post

i would suggest havin

coal coal coal
coal coal coal
stone stone stone

craft recipe

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

how about this s=stone c=coal
ccc
scs
sss

or

scs
scs
sss

or

scs
sss
Coding;
1X coding
3X debugging
12X tweaking to be just right

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

by Mito551 » Post

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

User avatar
Casimir
Member
Posts: 1207
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

ccc
c_c
ccc

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

s=stick , c-coal , t=torch
ctc
scs
sss

t is to ignite coal
Coding;
1X coding
3X debugging
12X tweaking to be just right

aximx51v
Member
Posts: 60
Joined: Fri Dec 07, 2012 03:47

by aximx51v » Post

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:

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.

BZab
Member
Posts: 126
Joined: Mon Jan 28, 2013 10:04
Location: Poland

by BZab » Post

Nice, but will cobble texture change on my texture pack's texture? :D

aximx51v
Member
Posts: 60
Joined: Fri Dec 07, 2012 03:47

by aximx51v » Post

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 :)

BZab
Member
Posts: 126
Joined: Mon Jan 28, 2013 10:04
Location: Poland

by BZab » Post

I ask bcoz, eg. non-cubic block use textures of actually used texture pack :D

User avatar
Casimir
Member
Posts: 1207
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

Code: Select all

    tiles ={"default_cobble.png"},

aximx51v
Member
Posts: 60
Joined: Fri Dec 07, 2012 03:47

by aximx51v » Post

Casimir wrote:

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.

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

Nice. :)

User avatar
LazyJ
Member
Posts: 687
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

How far will the fire jump?

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

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

I made Fire Poof Wood, so no need Fire of wood:D
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

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!

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

So I should upload my, fire proof wood?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests