Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to allow non-air nodes to be made lightable, add default water #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

FaceDeer
Copy link
Member

I've been doing a lot of swimming around in flooded caverns, where it would be super useful to have a wielded light but of course wielded light only worked in air. So I took a shot at fixing that.

This pull adds an API that wraps the existing approach to making glowing air nodes that appear and disappear, but allows it to be reused to register glowing sets of nodes for other types of node as well. If the "default" mod is installed it will do this to default:water_source and default:river_water_source. For the sake of realism and balance, light sources that are "floodable" (torches, for example) don't work underwater. In the default game I think only mese lights will be useful underwater, unless there's a non-floodable light source that's slipping my mind.

Hope this is useful!

@bell07
Copy link
Collaborator

bell07 commented Mar 17, 2021

Just for reference, the under_water_shine contains my attempt to get shining under water. The shining was flicker so I decided to not merge it into master. The last test was some Minetest versions ago, does it work right in the meantime?

@FaceDeer
Copy link
Member Author

FaceDeer commented Mar 31, 2021

Sadly, it's still got a bit of flicker to it. That's why I held off on sending this pull request for so long. But I've been using it locally for a while and I find that the flicker's not all that bad, not a problem worth not having a light when I'm swimming around in an underground tunnel with five seconds of air left and the need to find a pocket for breathing. :)

Maybe my tolerance threshold is higher, or maybe the flicker's at least improved a bit since last you checked?

The API might still be useful even without water support by default, there are mods out there that add new types of "air" nodes.

@bell07
Copy link
Collaborator

bell07 commented Apr 26, 2021

@FaceDeer, please check the issue at https://forum.minetest.net/viewtopic.php?p=394205#p394205

@sfence
Copy link
Contributor

sfence commented Jun 10, 2021

The problem of flicking underwater is caused by flowing liquids core.

You use:

liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",

This causes that the minetest core replaces your light node with "default:water_source".
The quick solution of this problem is to use:

liquid_alternative_flowing = "wielded_light:water_"..i,
liquid_alternative_source = "wielded_light:water_"..i,

This eliminates flicking. But, cause a problem with flowing water which can be solved by adding liquid_range = 0, to the definition.

@SmallJoker
Copy link
Member

Rebase needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants