Page 1 of 1
placing torches under water

Posted:
Sat Mar 19, 2016 23:17
by ErrorNull
not sure if this was already reported and already being worked on.. but i noticed i can place torches under water onto blocks and it would create an air pocket... thus allowing player to breath. is this intentional or will be corrected? i admit it's a slick way to "cheat" and explore unlimited depths underwater... but it detracts from the realism. I'd rather not be able to place torches under water at all.
Re: placing torches under water

Posted:
Sun Mar 20, 2016 14:03
by xeranas
There is
discusion about making objects like torches floodable it would fix current behavior but seems need some change on engine side. Probably mods could override current behavior if "fix" needed sooner.
Re: placing torches under water

Posted:
Sun Mar 20, 2016 14:39
by maikerumine
IIRC There is a dissolvable torch in the stampy sub game, works like a charm. Also unternull subgame.
Re: placing torches under water

Posted:
Sun Mar 20, 2016 19:07
by ErrorNull
ah ok. thanks for the info. I'll check out that discussion xeranas as well as those subgames maikerumine. much appreciated.
Re: placing torches under water

Posted:
Sun Mar 20, 2016 19:20
by TheReaperKing
What if you just restricted the ability for torches to be put in/under water at all? if block = water then torchplacement = NOPE :)
Re: placing torches under water

Posted:
Sun Mar 20, 2016 20:46
by Linuxdirk
xeranas wrote:Probably mods could override current behavior if "fix" needed sooner.
But will it really be an engine change if simple mods with the limited API can fix that bug?
Re: placing torches under water

Posted:
Mon Mar 21, 2016 06:52
by xeranas
Linuxdirk wrote:xeranas wrote:Probably mods could override current behavior if "fix" needed sooner.
But will it really be an engine change if simple mods with the limited API can fix that bug?
Engine change needs for global (not only torches) or/and performance wise fix. Mods still can workaround logic by ABM checks, placement restriction and etc.
Re: placing torches under water

Posted:
Mon Mar 21, 2016 08:49
by ErrorNull
TheReaperKing wrote:What if you just restricted the ability for torches to be put in/under water at all? if block = water then torchplacement = NOPE :)
that does seem like a logical straight-forward solution. I'm still a noob at lua and modding minetest. Anyone out there know if it's possible to simply restrict torches from even being placed in water?
Re: placing torches under water

Posted:
Mon Mar 21, 2016 15:17
by blackjack
It's not only the torches thing ...
If you place a door under water, you'll have two blocks of air to breathe!
Restricting the torches placement would be a 5% solution :-/
Re: placing torches under water

Posted:
Tue Mar 22, 2016 06:41
by xeranas
ErrorNull wrote:TheReaperKing wrote:What if you just restricted the ability for torches to be put in/under water at all? if block = water then torchplacement = NOPE :)
that does seem like a logical straight-forward solution. I'm still a noob at lua and modding minetest. Anyone out there know if it's possible to simply restrict torches from even being placed in water?
Just for learning (not very practical). Code below can be added on torch node definition which is located at "default" mod at path mods/default/nodes.lua and starts with
minetest.register_node("default:torch" . If unsure search for on_place usage examples at
mintest_game repo.
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
on_place = function(itemstack, placer, pointed_thing)
local node = minetest.get_node_or_nil(pointed_thing.above)
local unsupported_nodes = {"default:water_source", "default:water_flowing"}
if node ~= nil then
for i=1, #unsupported_nodes do
if node.name == unsupported_nodes[i] then return end
end
end
return minetest.item_place(itemstack, placer, pointed_thing, param2)
end,
blackjack wrote:It's not only the torches thing ...
If you place a door under water, you'll have two blocks of air to breathe!
Restricting the torches placement would be a 5% solution :-/
This should be different topic. I'ts unclear to me how doors (or similar objects) should work underwater regardless of "air to breathe" question (and solution most likely would be completely different from torches). Mentioned pull request/discusion does not address this question.
Re: placing torches under water

Posted:
Thu Mar 24, 2016 03:23
by ErrorNull
Ah so the plot thickens. So am I connecting the dots correctly here (since I haven't actually tested it) to presume that any item that is not a full cubical node will have air fill out the rest of the node when placed in water? Like torches, doors, fences, etc? If that's the case then definitely agree how there should be an engine update to restrict the placement of non-cubical nodes in water from the beginning. That would be a much more efficient solution than shirking the fix to a mod. But as a temp solution I'd take it. Thanks for the code example. I'll experiment with it..
Re: placing torches under water

Posted:
Fri Mar 25, 2016 14:44
by kaadmy
@ErrorNull then what happens to underwater plants, etc?
Re: placing torches under water

Posted:
Wed Apr 06, 2016 14:20
by jan6
I think there should be an option for max realism, but I personally really like the ability to build underwater without drowning.
Maybe there should be a group that defines if a node creates air pocket or not.
Re: placing torches under water

Posted:
Wed Apr 06, 2016 15:26
by burli
xeranas wrote:Code below can be added on torch node definition which is located at "default" mod at path mods/default/nodes.lua and starts with
minetest.register_node("default:torch" .
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
local unsupported_nodes = {"default:water_source", "default:water_flowing"}
You can also add lava. Same behavior as water
Re: placing torches under water

Posted:
Thu Apr 14, 2016 01:25
by ErrorNull
thanks xeranas - i tried the code and worked as expected. i also included lava as well to the code (@burli). for now it's a workable temporary way. I'll keep my hopes up for a more elegant solution.