[Mod] Fireplace and Chimney [v1.1.7][firestone]
- 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]
Use big fire for light-decoration. Be careful, fire may jump to nearby flammable nodes.
Crafts
Chimney
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
Crafts
Chimney
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.
Cool now I can make a medieval fortress
question why is it 0.5?
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
Mods: Orichalcum Stonebricks Extra Chests
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
[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
Mods: Orichalcum Stonebricks Extra Chests
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
If you delete the after_place_node and change the abm to
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_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,
})
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.
- Bas080
- Member
- Posts: 398
- Joined: Mon May 21, 2012 15:54
- GitHub: bas080
- IRC: bas080
- In-game: bas080
- Location: Netherlands
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.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
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.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.
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
Mods: Orichalcum Stonebricks Extra Chests
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Hey I really like this mod! I just thought of something to make it better:
A working chimney for the fireplace!
It's got animated smoke, and the chimney is hollow. You can even fall down inside it, if you get yourself aligned perfectly.
Here's the code:
And here's the textures:
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.
A working chimney for the fireplace!
It's got animated smoke, and the chimney is hollow. You can even fall down inside it, if you get yourself aligned perfectly.
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
})
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.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
He's got it. Replace:Casimir wrote:Code: Select all
tiles ={"default_cobble.png"},
tiles ={"chimney.png", "chimney.png", "chimney_side.png"},
with that, and you're good to go.
How far will the fire jump?
Does the distance depend on the flamible item, ie: leaves catch fire closer than wood?
Does the distance depend on the flamible item, ie: leaves catch fire closer than wood?
My blog: LazyJ's Minetest World
- Likwid H-Craft
- Member
- Posts: 1113
- Joined: Sun Jan 06, 2013 14:20
- Location: Lost in Crypt
I made Fire Poof Wood, so no need Fire of wood:D
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
http://likwidtest.hj.cx/ (Not Done)
- Bas080
- Member
- Posts: 398
- Joined: Mon May 21, 2012 15:54
- GitHub: bas080
- IRC: bas080
- In-game: bas080
- Location: Netherlands
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.aximx51v wrote: Hey I really like this mod! I just thought of something to make it better:
A working chimney for the fireplace!
same as fire, 2 nodes surrounding.LazyJ wrote:How far will the fire jump?
Good idea!Likwid H-Craft wrote:I made Fire Proof Wood, so no need Fire of wood:D
MOD UPDATED!
- Likwid H-Craft
- Member
- Posts: 1113
- Joined: Sun Jan 06, 2013 14:20
- Location: Lost in Crypt
Who is online
Users browsing this forum: No registered users and 21 guests