placing torches under water

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

placing torches under water

by ErrorNull » Sat Mar 19, 2016 23:17

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: 99
Joined: Fri Feb 05, 2016 11:06
GitHub: xeranas

Re: placing torches under water

by xeranas » Sun Mar 20, 2016 14:03

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: 946
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: placing torches under water

by maikerumine » Sun Mar 20, 2016 14:39

IIRC There is a dissolvable torch in the stampy sub game, works like a charm. Also unternull subgame.
 

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

Re: placing torches under water

by ErrorNull » Sun Mar 20, 2016 19:07

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: 493
Joined: Sun Nov 22, 2015 21:36

Re: placing torches under water

by TheReaperKing » Sun Mar 20, 2016 19:20

What if you just restricted the ability for torches to be put in/under water at all? if block = water then torchplacement = NOPE :)
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: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: placing torches under water

by Linuxdirk » Sun Mar 20, 2016 20:46

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: 99
Joined: Fri Feb 05, 2016 11:06
GitHub: xeranas

Re: placing torches under water

by xeranas » Mon Mar 21, 2016 06:52

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: 94
Joined: Thu Mar 03, 2016 00:43

Re: placing torches under water

by ErrorNull » Mon Mar 21, 2016 08:49

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: 23
Joined: Thu Jan 07, 2016 09:54

Re: placing torches under water

by blackjack » Mon Mar 21, 2016 15:17

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: 99
Joined: Fri Feb 05, 2016 11:06
GitHub: xeranas

Re: placing torches under water

by xeranas » Tue Mar 22, 2016 06:41

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.
 

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

Re: placing torches under water

by ErrorNull » Thu Mar 24, 2016 03:23

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: 627
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: placing torches under water

by kaadmy » Fri Mar 25, 2016 14:44

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

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

Re: placing torches under water

by jan6 » Wed Apr 06, 2016 14:20

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.
Pixel art & music 4daWin!
I'm usually late for *great* things...
Growing up on Linux...
I know ,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: 1313
Joined: Fri Apr 10, 2015 13:18

Re: placing torches under water

by burli » Wed Apr 06, 2016 15:26

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
 

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

Re: placing torches under water

by ErrorNull » Thu Apr 14, 2016 01:25

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.
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 6 guests

cron