[mod] There shall be light ! lagfree in air and water [lightup]

Post Reply
Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

[mod] There shall be light ! lagfree in air and water [lightup]

by Gundul » Post

Image

There used to be mods like walking light or even a torchlight.

Now this one is a bit like them but works with raycasting. Point to a node or an object
and there will be light :) Works in air and underwater, too.

There is no craft yet, only a new priv "lightup"
Server priv owner can use it, too.

Credits: Termos for his mobkit.pos_shift() function I took from mobkit api.
License: WTFPL
Depends: default

Download: https://github.com/berengma/lightup/archive/master.zip
Source: https://github.com/berengma/lightup
Last edited by Gundul on Thu Dec 24, 2020 12:49, edited 2 times in total.
My servers: Jungle, Lilly in the valley click for my mods

User avatar
apercy
Member
Posts: 146
Joined: Wed Mar 25, 2020 16:31
GitHub: APercy
In-game: APercy
Location: Pinheiral - RJ - Brazil

Re: [mod] There shall be light ! [lightup]

by apercy » Post

Nice mod!!!!!!

Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [mod] There shall be light ! [lightup]

by Gundul » Post

Update:

fix error when placing a node on a lightnode (water or air)
My servers: Jungle, Lilly in the valley click for my mods

User avatar
firefox
Member
Posts: 1598
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [mod] There shall be light ! [lightup]

by firefox » Post

rather than a torchlight tool, this would be nice if implemented as armor.
doesn't necessarily need to be a helmet, nipple lights would work, too. :P
βœ¨πŸ³οΈβ€πŸŒˆβ™£οΈβœ¨

Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [mod] There shall be light ! [lightup]

by Gundul » Post

lol, this can be implemented as anything. It just needs a start pos for the ray to calculate.

Originally I started to play around with this because we searched for a light for the nautilus.
viewtopic.php?f=9&t=25001
My servers: Jungle, Lilly in the valley click for my mods

User avatar
FreeLikeGNU
Member
Posts: 230
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [mod] There shall be light ! [lightup]

by FreeLikeGNU » Post

Cool!

Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by Gundul » Post

Update:

no more dependent on mobkit
uses raycasts, no expansive node calculations
now uses nodetimers instead of minetest.after() which works
reliantly and leaves no traces. This way I could get rid of all the
LBMs which checked for remains of the bright nodes.

You can easily add other nodes, just see the table in init.lua.
It still works with privs but it has WTFPL so apply it to WTF you want to XD
My servers: Jungle, Lilly in the valley click for my mods

User avatar
runs
Member
Posts: 2153
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by runs » Post

Cool concept.
πŸ€‘ Patreon | β˜• Minetest Chat | πŸ‘§ Samantha | ⛏️ Juanchi Game | 🐱 Petz

Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by Gundul » Post

Update


fixed blinking light bug in water
removed light nodes from inventory
now smooth by default
My servers: Jungle, Lilly in the valley click for my mods

cuthbertdoublebarrel
Member
Posts: 278
Joined: Tue Apr 14, 2020 16:03
GitHub: cuthbert

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by cuthbertdoublebarrel » Post

missed this one
yeah a water proof torch is a very useful tool to have .
nice one gundul
Project BrutalTest...hide your Petz

cuthbertdoublebarrel
Member
Posts: 278
Joined: Tue Apr 14, 2020 16:03
GitHub: cuthbert

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by cuthbertdoublebarrel » Post

conflicting with the witt mod ,now everything registers as light air or flickers rapidly between that and the item label .
any chance you could add a setting that the light only activates when its pointed at a dark area instead of active all the time ?
Project BrutalTest...hide your Petz

Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by Gundul » Post

Sorry but this mod is only a proof of concept. It is not meant to be used standalone.
The priv solution I made only to demonstrate how it works and that it works at all.
Code is WTFPL so you can use it in any mod you made from it. Maybe just consider
writing some credit where it came from.
My servers: Jungle, Lilly in the valley click for my mods

Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by Gundul » Post

Update

fixed bug with brightwater nodes and self renewable.
My servers: Jungle, Lilly in the valley click for my mods

User avatar
hex
Member
Posts: 51
Joined: Sun Dec 06, 2020 04:22
IRC: hecks
In-game: hex hhhehehe

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by hex » Post

I did something like this before using a Bresenham walk, not a raycast, but I forgot the reason. Could entities possibly interfere with the raycast?

Gundul
Member
Posts: 1223
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [mod] There shall be light ! lagfree in air and water [lightup]

by Gundul » Post

Interfering with objects could be turned on/off. Like it is now, when thy ray hits an object it will stop and return the position of the object. So the light will be at the objects position.
My servers: Jungle, Lilly in the valley click for my mods

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests