Page 1 of 1

[WIP] Furnace in LUA

PostPosted: Sun Apr 22, 2012 04:17
by lkjoel
Ok, this is ridiculous. The furnace was implemented in C++ while it could have been easily made in LUA. So I'm spending a bit of time porting it over, and then it will be very easy to tweak ;)

PostPosted: Sun Apr 22, 2012 15:26
by LolManKuba
Would it be like in Minecraft like when your cooking something it like turns on and gives a bit of light? And will it show you how much power the coal ect. has left?

PostPosted: Sun Apr 22, 2012 16:09
by VanessaE
Hmm. .. lkjoel, feel like expanding that furnace to, say, five states?

  • Empty/out of fuel (the standard furnace texture)
  • Fueled but idle (same thing but with some kind of "generic" fuel loaded into the bottom slot)
  • Fueled and cooking: full, 2/3 and 1/3 fuel remaining, relative to the largest quantity possible of the fuel being used.

I'll make the necessary textures using data from my existing packs.

PostPosted: Sun Apr 22, 2012 16:12
by lkjoel
@LolManKuba, yeah, that's what I was thinking.
@VanessaE, Interesting idea... I'll try to do that too.

PostPosted: Sun Apr 22, 2012 16:35
by VanessaE
I should point out that what I envision for the three "active" states is the fire underneath burning at various intensities, and emitting a corresponding amount of light (which is a gradient drawn on the fireplace's front in my case; I've no opinion one way or another whether it should produce actual light in the game :-) ).

EDIT: expand suggestion to nine states: empty, four fueled-but-idle states (full, 3/4, 1/2, 1/4), and four fueled-and-cooking states (same levels). When the item to be smelted/cooked runs out, the furnace should switch from whatever fueled-and-cooking image is being used at that moment to the corresponding fueled-but-idle image, and vice-versa when new raw items are added. When fuel is added, removed, or burned, the displayed image should change to reflect the new state.

PostPosted: Sun Apr 22, 2012 17:09
by lkjoel
So nine states?

PostPosted: Sun Apr 22, 2012 17:10
by VanessaE
Yep! :-)

PostPosted: Sun Apr 22, 2012 17:11
by LolManKuba
lkjoel you're almost at your 400th post.

PostPosted: Sun Apr 22, 2012 18:47
by lkjoel
almost ;)

PostPosted: Sun Apr 22, 2012 19:08
by Jordach
yep.

PostPosted: Sun Apr 22, 2012 20:49
by Roflo
Some time ago, there was a luafurnace in experimental mod:

https://github.com/celeron55/minetest/commits/master/games/minimal/mods/experimental/init.lua

If you look at the current version, there's still a commented block.
And if you look at old versions, seems like c55 wanted to give it a shot some time ago:

https://github.com/celeron55/minetest/blob/103d4793f00b2dd592739f686e90370c2d8953a3/data/mods/experimental/init.lua

PostPosted: Sun Apr 22, 2012 20:56
by Nemo08
Roflo wrote:Some time ago, there was a luafurnace in experimental mod:

https://github.com/celeron55/minetest/commits/master/games/minimal/mods/experimental/init.lua

luafurnace with getting recipes was removed then itemdef patch was merged. but celeron promises think about, we remember this!! ^^

P.S.
kahrl:
Shortcomings

It's currently not possible to retrieve the result of a crafting operation from Lua. Therefore you can't rewrite the current furnaces in Lua.

from wiki