[floodable nodes] drop items on flood

User avatar
LNJ
Member
 
Posts: 200
Joined: Tue Sep 23, 2014 16:02
GitHub: LNJ2
IRC: LNJ2GO
In-game: LNJ

[floodable nodes] drop items on flood

by LNJ » Mon Sep 05, 2016 10:19

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?
My Minetest Modding Tutorials (German) | Minetest TNG - My survival subgame! (OUTDATED... :() | #ComeToTheDuckSide - we have privacy! | diaspora* - The free and decentralized alternative to facebook and twitter!
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [floodable nodes] drop items on flood

by taikedz » Thu Sep 08, 2016 10:59

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....
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

Re: [floodable nodes] drop items on flood

by BrandonReese » Thu Sep 08, 2016 14:15

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.
 

User avatar
LNJ
Member
 
Posts: 200
Joined: Tue Sep 23, 2014 16:02
GitHub: LNJ2
IRC: LNJ2GO
In-game: LNJ

Re: [floodable nodes] drop items on flood

by LNJ » Fri Sep 09, 2016 16:10

So there is no way without an abm to do that...

Anyway thank you, taikedz and BrandonReese.
My Minetest Modding Tutorials (German) | Minetest TNG - My survival subgame! (OUTDATED... :() | #ComeToTheDuckSide - we have privacy! | diaspora* - The free and decentralized alternative to facebook and twitter!
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [floodable nodes] drop items on flood

by paramat » Sat Sep 10, 2016 07:38

> 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.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 8 guests

cron