[Mod] Iron Age [ironage]

Post Reply
User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

[Mod] Iron Age [ironage]

by joe7575 » Post

Melting Pot for ingot/alloy smelting with coal burner and charcoal production

GitHub: https://github.com/joe7575/ironage
Download: https://github.com/joe7575/ironage/archive/master.zip

With this mod new blocks, ingots and alloys can be made.
The mod includes a Melting Pot (to complement the furnace). The pot must be heated with a coal burner.
The charcoal must first be produced with the help of a charcoal burner (charcoal pile).

Image

The Melting Pot inventory has a smelting guide and two construction tabs.

Image

The mod includes per default only a few example recipes but can be extended by means of a recipe registration API.

Obsidian example:

Code: Select all

ironage.register_recipe({
	output = "default:obsidian", 
	recipe = {"default:cobble"}, 
	heat = 5,
	time = 4,
})

'output' and 'recipe' are similar to the standard crafting recipes. All ironage recipes are 'shapeless'.
'recipe' is a list with up to four items.
'heat' is the needed burner heat, which corresponds to the burner height/number of charcoal nodes (2..32)
'time' is the smelting time in seconds (2..n)


If the mod 'wielded_light' is installed, recipes for Meridium and Meridium tools are added.
Meridium is a glowing metal alloy to produce glowing tools.

If the mod 'unified_inventory' is installed, the recipes are also available via the unified_inventory crafting guide.


Dependencies
default, fire, farming
Optional: intllib, wielded_light, unified_inventory

License
Copyright (C) 2018 Joachim Stolberg
Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt
Textures: CC0
Attachments
meltingpod.png
meltingpod.png (172.66 KiB) Viewed 1835 times
screenshot.png
screenshot.png (503.39 KiB) Viewed 1835 times
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Mod] Iron Age [ironage]

by TumeniNodes » Post

Another impressive work joe7575.
I am definitely trying this one out. (beautiful screenshot too)
A Wonderful World

User avatar
cx384
Member
Posts: 653
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [Mod] Iron Age [ironage]

by cx384 » Post

Wow I really like the multiblock mechanisms and the way how you can get charcoal. Its a little bit like in my outdated another charcoal mod. But charcoal should be group crumbly or choppy instead of cracky and the lighter snappy instead of cracky this would make more sense. Moreover, in my opinion the textures don't match with the default textures, for example different resolutions like in other mods you have made.
Last edited by cx384 on Wed May 30, 2018 20:19, edited 2 times in total.
Can your read this?

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

cx384 wrote:Wow I really like the multiblock mechanisms and way how you can get charcoal.
Nice to hear.
cx384 wrote:But charcoal should be group crumbly or choppy instead of cracky and the lighter snappy instead of cracky this would make more scene.
Thanks for your hints. I will change that.
cx384 wrote:Moreover, in my opinion the textures don't match with the default textures, for example different resolutions like in other mods you have made.
Yes, I can't decide between 16 and 32 bit textures :-)
But do you see any problems with that mixture?
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

User avatar
cx384
Member
Posts: 653
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [Mod] Iron Age [ironage]

by cx384 » Post

joe7575 wrote:Yes, I can't decide between 16 and 32 bit textures :-)
But do you see any problems with that mixture?
:-/
I like consistence, but thats only my opinion and I don't think this is that important. So do whatever you think is right.
Can your read this?

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Iron Age [ironage]

by TechNolaByte » Post

looks great!
always good to see another multi-block structure mod
does the recipe api support several ingredients?
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

RSLRedstonier wrote:does the recipe api support several ingredients?
Yes, up to 4, like the probably more realistic recipe for steel:

Code: Select all

ironage.register_recipe({
	output = "default:steel_ingot 4", 
	recipe = {
		"default:coal_lump", 
		"default:iron_lump", 
		"default:iron_lump", 
		"default:iron_lump"}, 
	heat = 4,
	time = 8,
})
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

Recipe for Lava added.
With enough heat you can melt Cobblestone to Lava:

Code: Select all

ironage.register_recipe({
	output = "default:lava_source", 
	recipe = {"default:cobble"}, 
	heat = 8,
	time = 8,
})
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

Vindelle_Pounze
Member
Posts: 26
Joined: Thu Jan 05, 2017 22:06

Re: [Mod] Iron Age [ironage]

by Vindelle_Pounze » Post

Great stuff, very much like what you are doing!
I do have one question, though. Maybe it's just because I have LOTS of mods installed but I believe my problem does result from this mod...how am I supposed to ignite the lighter in the first place? My [still :(] very limited knowledge of programming and modding minetest tells me that this part from recipes.lua:

Code: Select all

ironage.register_recipe({
	output = "default:steel_ingot 4", 
	recipe = {"default:coal_lump", "default:iron_lump", "default:iron_lump", "default:iron_lump"}, 
	heat = 4,
	time = 8,
})

minetest.clear_craft({output = "default:steel_ingot"})
prevents me from smelting steel ingots in a standard furnace. So I'm not able to craft 'flint and steel', so I can't ignite the lighter to, erm, well, produce steel ingots. Can't ignite with lava either, because for lava I'd need buckets, ergo steel ingots.
For now I just changed the original recipe for 'flint and steel' to use copper instead of steel.
What am I missing?

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

Vindelle_Pounze wrote: This....prevents me from smelting steel ingots in a standard furnace. So I'm not able to craft 'flint and steel', so I can't ignite the lighter to, erm, well, produce steel ingots.
For now I just changed the original recipe for 'flint and steel' to use copper instead of steel.
What am I missing?
Yes, you are right. This happens when you always play in creative mode :D
As you wrote, you have to add something like that:

Code: Select all

minetest.clear_craft({output = "fire:flint_and_steel"})

minetest.register_craft({
	output = "fire:flint_and_steel",
	recipe = {
		{"default:flint", "default:copper_ingot"}
	}
})
I use other recipes on my server, thus I didn't realize the fault.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

Vindelle_Pounze
Member
Posts: 26
Joined: Thu Jan 05, 2017 22:06

Re: [Mod] Iron Age [ironage]

by Vindelle_Pounze » Post

Thanks for responding. Also, after updating, I saw that you implemented that recipe change in your code. Still having problems, though. Tried in singleplayer (survival) in minetest 0.5-dev (to be precise it's been 5.0.0-dev-4cd267a-dirty) last time and getting the same error in minetest 0.4.17.1 now.
Spoiler
2018-06-30 14:41:05: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'ironage' in callback LuaLBM::trigger(): ...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:63: bad argument #2 to 'set_int' (number expected, got nil)
2018-06-30 14:41:05: ERROR[Main]: stack traceback:
2018-06-30 14:41:05: ERROR[Main]: [C]: in function 'set_int'
2018-06-30 14:41:05: ERROR[Main]: ...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:63: in function 'start_smoke'
2018-06-30 14:41:05: ERROR[Main]: ...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:207: in function <...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:204>
It seems to break the game when I reload a world while the charcoalpile is active. Didn't test letting it finish while being in game, though.

Edit: Just tried in a new world with just ironage mod installed, gave myself the needed stuff and built the charcoalpile. It started to burn (smoke), I shut the game down and after reloading the world it crashed after a very short time (one or two seconds, maybe)

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

Changed line 63 from:

Code: Select all

meta:set_int("smoke", nil)
to:

Code: Select all

meta:set_int("smoke", 0)
Should work now.
Minetest 0.5.0 behaves different here.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

Vindelle_Pounze
Member
Posts: 26
Joined: Thu Jan 05, 2017 22:06

Re: [Mod] Iron Age [ironage]

by Vindelle_Pounze » Post

Thanks again.
Just for letting you know ;), same error when burning is done.
Spoiler
2018-06-30 23:16:00: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'ironage' in callback node_on_timer(): ...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:87: bad argument #2 to 'set_int' (number expected, got nil)
2018-06-30 23:16:00: ERROR[Main]: stack traceback:
2018-06-30 23:16:00: ERROR[Main]: [C]: in function 'set_int'
2018-06-30 23:16:00: ERROR[Main]: ...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:87: in function 'stop_smoke'
2018-06-30 23:16:00: ERROR[Main]: ...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:107: in function 'convert_to_coal'
2018-06-30 23:16:00: ERROR[Main]: ...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:137: in function <...t_backport/minetest/bin/../mods/ironage/charcoalpile.lua:120>
Guess the change will also need to be made to coalburner.lua:161 then.

Some further questions:
Is the following supposed to happen?
a) from the total of 26 wooden blocks I only got 8 charcoal
b) the lighter inside stayed lit
c) I was able to "refill" the pile and the smoke started again, even while there was one block of dirt missing

From how I understand your charcoalpile.lua I'd expect it to only start producing charcoal when the pile is built correctly, then after some time convert all the wood to coal and leave dirt_with_ash at the bottom dirt level.

Another thing, if I understand this
Spoiler
local function start_smoke(pos)
local meta = minetest.get_meta(pos)
pos = {x=pos.x, y=pos.y+3.6, z=pos.z}
local id = meta:get_int("smoke")
local above = minetest.get_node(pos).name

if id ~= 0 then
minetest.delete_particlespawner(id)
meta:set_int("smoke", 0)
end

if above == "air" then
id = minetest.add_particlespawner({
amount = 4, time = 0, collisiondetection = true,
minpos = {x=pos.x-0.25, y=pos.y+0.1, z=pos.z-0.25},
maxpos = {x=pos.x+0.25, y=pos.y+5, z=pos.z+0.25},
minvel = {x=-0.2, y=0.3, z=-0.2}, maxvel = {x=0.2, y=1, z=0.2},
minacc = {x=0,y=0,z=0}, maxacc = {x=0,y=0.5,z=0},
minexptime = 1, maxexptime = 3,
minsize = 6, maxsize = 12,
texture = "ironage_smoke.png",
})
meta:set_int("smoke", id)
end
end
correctly, there will only be smoke when I leave some air above the pile. If so, how am I supposed to know when it is done producing coal?

And another (another) thing...
I started to smelt steel and the game crashed with this error message:
Spoiler
2018-07-01 00:09:23: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'nodeinfo' in callback environment_Step(): .../minetest_backport/minetest/bin/../builtin/game/item.lua:22: attempt to call method 'gsub' (a nil value)
2018-07-01 00:09:23: ERROR[Main]: stack traceback:
2018-07-01 00:09:23: ERROR[Main]: .../minetest_backport/minetest/bin/../builtin/game/item.lua:22: in function 'fillImage'
2018-07-01 00:09:23: ERROR[Main]: ...minetest_backport/minetest/bin/../mods/nodeinfo/init.lua:444: in function <...minetest_backport/minetest/bin/../mods/nodeinfo/init.lua:277>
2018-07-01 00:09:23: ERROR[Main]: ...etest_backport/minetest/bin/../builtin/game/register.lua:420: in function <...etest_backport/minetest/bin/../builtin/game/register.lua:400>
Crash apparently resulted from having both ironage and nodeinfo (viewtopic.php?f=9&t=18016&hilit=nodeinfo) installed. Will post the error message in the respective thread, too.

LouisCyfer
Member
Posts: 46
Joined: Sun Jun 25, 2017 02:24
GitHub: LouisCyfer

Re: [Mod] Iron Age [ironage]

by LouisCyfer » Post

@Vindelle_Pounze @joe7575
check out this Issue at Github: #1

rudimentary fix and ironage mod support for nodeinfo is out aswell!
regards!
Last edited by LouisCyfer on Sun Jul 01, 2018 09:14, edited 2 times in total.

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

Vindelle_Pounze wrote:Thanks again.
Just for letting you know ;), same error when burning is done.
[...] Guess the change will also need to be made to coalburner.lua:161 then.
Yes, I fixed it. Thanks.
Vindelle_Pounze wrote: Some further questions:
Is the following supposed to happen?
a) from the total of 26 wooden blocks I only got 8 charcoal
b) the lighter inside stayed lit
c) I was able to "refill" the pile and the smoke started again, even while there was one block of dirt missing
to a) It should be 9
to b) No, the lighter should disappear
to c) hm.... unclear. If you open the charcoalpile to early, all charcoal should burn up
Vindelle_Pounze wrote: From how I understand your charcoalpile.lua I'd expect it to only start producing charcoal when the pile is built correctly, then after some time convert all the wood to coal and leave dirt_with_ash at the bottom dirt level.
correct.
Vindelle_Pounze wrote: [...] If so, how am I supposed to know when it is done producing coal?
When smoke appears, the charcoalpile is running.
When the smoke disappears after 20 minutes (normally one day in the game), the charcoal is ready and you can open the charcoalpile.
Vindelle_Pounze wrote: And another (another) thing...
I started to smelt steel and the game crashed with this error message:
[...] Crash apparently resulted from having both ironage and nodeinfo (viewtopic.php?f=9&t=18016&hilit=nodeinfo) installed. Will post the error message in the respective thread, too.
Ok, please do so.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

LouisCyfer
Member
Posts: 46
Joined: Sun Jun 25, 2017 02:24
GitHub: LouisCyfer

Re: [Mod] Iron Age [ironage]

by LouisCyfer » Post

joe7575 wrote:Ok, please do so.
He did and the nodeinfo part is fixed.

.. to answer your question in the issue in github:
In your special case your function "ironage.keep_running_burner(pos)" seeks for a stop hook for abortion of the animation burning function or reset where you might not need nil but zero. because if you want to count +1 (to measure burning start time or reset said or else) you need a number not nothing or nil :D

I am not a pro skilled programmer, just someone who is glad beeing any helpful :)

I also believe any meta file is bound to the item block, if the block is gone then the meta is too, otherwise it sticks with it unless overwritten. If I'm wrong I'm glad to see things I can learn too.

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

"meta:get_int(name)" returns zero, if the entry is not available. This is the reason why in this case "meta:set_int(name, 0)" works as replacement for "meta:set_int(name, nil)".
But it seems that you can't delete the entry any more by means of calling "meta:set_int(name, nil)".
Of course, when the node is removed the meta data is deleted in addition.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

Vindelle_Pounze
Member
Posts: 26
Joined: Thu Jan 05, 2017 22:06

Re: [Mod] Iron Age [ironage]

by Vindelle_Pounze » Post

Error exists again in charcoalpile.lua:87 ;)

User avatar
joe7575
Member
Posts: 851
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto wuffi
Location: Germany, in the deep south

Re: [Mod] Iron Age [ironage]

by joe7575 » Post

Vindelle_Pounze wrote:Error exists again in charcoalpile.lua:87 ;)
Thanks, fixed it.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, vm16, Minecart, Signs Bot.

Germain
Member
Posts: 42
Joined: Thu Aug 13, 2015 10:16

Re: [Mod] Iron Age [ironage]

by Germain » Post

If you have the mod "natural slopes", you can add the group "group:natural_slope" in the function (see bellow), so, this mod won't disturb your charcoal pile.

charcoalpile.lua

Code: Select all

-- determine the number of nodes nodes (around wood)
local function num_dirt(pos)
	local pos1 = {x=pos.x-2, y=pos.y-1, z=pos.z-2}
	local pos2 = {x=pos.x+2, y=pos.y+3, z=pos.z+2}
	local nodes = minetest.find_nodes_in_area(pos1, pos2, {"default:dirt", "default:dirt_with_grass", 
			"default:dirt_with_dry_grass", "default:dirt_with_snow", "ironage:dirt_with_ash","group:natural_slope"})
	return #nodes
end

Germain
Member
Posts: 42
Joined: Thu Aug 13, 2015 10:16

Re: [Mod] Iron Age [ironage]

by Germain » Post

I think that the meltingpot should be at the bottom place (just under the lighter).
I'm working about this, but this need more modifications.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests