placing torches under water

Post Reply
User avatar
ErrorNull
Member
Posts: 270
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

placing torches under water

by ErrorNull » Post

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.

User avatar
xeranas
Member
Posts: 162
Joined: Fri Feb 05, 2016 11:06

Re: placing torches under water

by xeranas » Post

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.

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: placing torches under water

by maikerumine » Post

IIRC There is a dissolvable torch in the stampy sub game, works like a charm. Also unternull subgame.
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
ErrorNull
Member
Posts: 270
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: placing torches under water

by ErrorNull » Post

ah ok. thanks for the info. I'll check out that discussion xeranas as well as those subgames maikerumine. much appreciated.

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: placing torches under water

by TheReaperKing » Post

What if you just restricted the ability for torches to be put in/under water at all? if block = water then torchplacement = NOPE :)
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: placing torches under water

by Linuxdirk » Post

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?

User avatar
xeranas
Member
Posts: 162
Joined: Fri Feb 05, 2016 11:06

Re: placing torches under water

by xeranas » Post

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.

User avatar
ErrorNull
Member
Posts: 270
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: placing torches under water

by ErrorNull » Post

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?

blackjack
Member
Posts: 25
Joined: Thu Jan 07, 2016 09:54
Location: Germany

Re: placing torches under water

by blackjack » Post

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 :-/
Best regards
blackjack

User avatar
xeranas
Member
Posts: 162
Joined: Fri Feb 05, 2016 11:06

Re: placing torches under water

by xeranas » Post

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.

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.

User avatar
ErrorNull
Member
Posts: 270
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: placing torches under water

by ErrorNull » Post

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

User avatar
kaadmy
Member
Posts: 706
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: placing torches under water

by kaadmy » Post

@ErrorNull then what happens to underwater plants, etc?
Never paint white stripes on roads near Zebra crossings.

Pixture

User avatar
jan6
Member
Posts: 64
Joined: Wed Dec 02, 2015 17:58
GitHub: jan69
IRC: jan6
In-game: jan6
Location: Estonia

Re: placing torches under water

by jan6 » Post

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.
I know everything, exept what I know...
I have a secret..it's so secret even I don't know what it is

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: placing torches under water

by burli » Post

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

Code: Select all

		local unsupported_nodes = {"default:water_source", "default:water_flowing"}
You can also add lava. Same behavior as water

User avatar
ErrorNull
Member
Posts: 270
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: placing torches under water

by ErrorNull » Post

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.

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: placing torches under water

by TenPlus1 » Post


Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests