Page 1 of 1

[floodable nodes] drop items on flood

PostPosted: Mon Sep 05, 2016 10:19
by LNJ
You can make a node floodable by liquids, then the node will be removed when a liquid floods the area, but (and here is my problem:) no items will be dropped.
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_node("foo:bar", {
        description = "Foobar",
        floodable = true
})


Is there a way that the items will be dropped?

Re: [floodable nodes] drop items on flood

PostPosted: Thu Sep 08, 2016 10:59
by taikedz
If I understand you well,

IF (node is floodable AND water starts surrounding node) THEN (node is removed AND item is dropped to be picked up)

I know ethereal mod does this to torches so it certainly seems possible.... I never was able to track down where it happened though....

It's entirely possible it's an ABM though - add a "floodable" group to your node, then have an ABM search for nodes belonging to that group; if found, remove node and add an item to the world at that position....

Re: [floodable nodes] drop items on flood

PostPosted: Thu Sep 08, 2016 14:15
by BrandonReese
As far as I can tell when you register a node as floodable it is considered the same as air by the engine when liquid spreads. If you want it to drop nodes you'll have to change the engine (which would be a bit of work) or do like taikedz said and write your own flooding system using an abm which wouldn't be hard.

Re: [floodable nodes] drop items on flood

PostPosted: Fri Sep 09, 2016 16:10
by LNJ
So there is no way without an abm to do that...

Anyway thank you, taikedz and BrandonReese.

Re: [floodable nodes] drop items on flood

PostPosted: Sat Sep 10, 2016 07:38
by paramat
> As far as I can tell when you register a node as floodable it is considered the same as air by the engine when liquid spreads. If you want it to drop nodes you'll have to change the engine

Correct.
'floodable' was added primarily for alien atmosphere / vacuum / fog / gas / fake air nodes.