[Mod] Light Tool [0.4] [light_tool]

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

[Mod] Light Tool [0.4] [light_tool]

by Extex » Thu Aug 08, 2019 22:40

My First MOD!!!

Image

Light Tool adds a point-able beam of light like a Torch/Flashlight

Currently untested on high traffic servers (If you could test it for me that'd be great)

This mod also adds an API to make your own

e.g
Code: Select all
light_tool.add_tool("my_mod:light_tool", 25)--First param: The name of your item, Second param: The range of the light beam

light_tool.light_beam(pos, dir, range)--First param: The start position of the beam, Second Param: The direction the beam is pointed, Third param: The max distance the beam can travel

light_tool.register_glow_node(nodename)--Registers a duplicate of the specified node that glows and behaves identically to the light beam (Used for light beams within water)


Animated gif.

Image

+ technic flashlight


+ Todo:


License: Code (MIT), Texture (CC BY-SA 3.0)

Optional dependencies: default (for the crafting, and underwater lights)

Browse code: https://github.com/Extex101/light_tool

Download: https://github.com/Extex101/light_tool/ ... master.zip
Attachments
ugh.gif
(747.55 KiB) Not downloaded yet
screenshot_20190808_145020.png
(52.58 KiB) Not downloaded yet
Last edited by Extex on Mon Sep 30, 2019 23:46, edited 6 times in total.
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

CalebJ
Member
 
Posts: 159
Joined: Sat Dec 29, 2018 19:21
Location: Tunnelers' Abyss
GitHub: KaylebJay
IRC: KaylebJay
In-game: CalebJ

Re: [Mod] Light Tool [light_tool]

by CalebJ » Thu Aug 08, 2019 23:22

This is interesting, might be of use on servers if it isn't too laggy. Good first mod! :D
If you want realism, you're in the wrong place. Get off your mobile.
 

User avatar
migdyn
Member
 
Posts: 285
Joined: Mon Aug 20, 2018 00:44
Location: A non-existing flat forest on flat earth
GitHub: migdyn
In-game: migdyn

Re: [Mod] Light Tool [light_tool]

by migdyn » Fri Aug 09, 2019 09:00

As I can see, it works by placing invisible nodes that emit light and then destroying them after 100 ms. Nice mod.
"How can I get my Winmodem to work?"
 

Red_King_Cyclops
Member
 
Posts: 245
Joined: Sun Jun 16, 2019 20:17
Location: Earth

Re: [Mod] Light Tool [light_tool]

by Red_King_Cyclops » Fri Aug 09, 2019 13:55

Cool and useful mod. If you are interested in expanding this mod, I suggest adding in another light tool that works underwater.

Edit: I just realized that making the light tool work in fluids is already on your todo list.
My mod space_travel is similar to Galacticraft, but for Minetest.
 

User avatar
TumeniNodes
Member
 
Posts: 2825
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Light Tool [light_tool]

by TumeniNodes » Fri Aug 09, 2019 18:27

Hey, this is pretty neat and useful. Nice job.
Should be using mod.conf though and eliminate the depends.txt and description.txt
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [light_tool]

by Extex » Fri Aug 09, 2019 22:47

runs thanks

CalebJ thanks if you could do a server test that'd be great!

Red_King_Cyclops Yeah XD I'm working on it right now

TumeniNodes: What doyou mean? Could you give an example
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

User avatar
TumeniNodes
Member
 
Posts: 2825
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Light Tool [light_tool]

by TumeniNodes » Fri Aug 09, 2019 23:54

Instead of a 'depends.txt' , you will use a file called 'mod.conf'

In the mod.conf file add:

name = light_tool
depends = only add this line if the mod has a hard dep
optional_depends = default
description = brief desc here

remove the 'description.txt' file, and add the more detailed description of the mod to your README.md file

The depends and description files are deprecated, and being phased out.
Everything they did can be handled within a mod.conf and README.md files.
(I need to go through and make those changes in my mods, too, but I procrastinate.)
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

User avatar
Codesound
Member
 
Posts: 221
Joined: Thu Jun 09, 2016 14:56
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.3] [light_tool]

by Extex » Mon Aug 12, 2019 01:46

Added underwater compatibility and technic flashlight redo
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.3] [light_tool]

by Extex » Mon Aug 12, 2019 02:23

Fixed falling block replacement bug
Currently experimental may be unstable
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

User avatar
benrob0329
Member
 
Posts: 1308
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: [Mod] Light Tool [0.3] [light_tool]

by benrob0329 » Mon Aug 12, 2019 02:41

Couldn't you also use VoxelManip to set the light levels for the nodes in front of the player?
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.3] [light_tool]

by Extex » Mon Aug 12, 2019 05:19

You can do that?
I'll look into it
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

neoh4x0r
Member
 
Posts: 63
Joined: Wed Aug 29, 2018 20:16
GitHub: neoh4x0r

Re: [Mod] Light Tool [0.3] [light_tool]

by neoh4x0r » Mon Aug 12, 2019 07:41

Extex wrote:Added underwater compatibility and technic flashlight redo


I just opended a issue on the github page: https://github.com/Extex101/light_tool/issues/1

You should probably add the technic mod as a dependency in mod.conf (since flashlight.lua uses items and methods from it for recipes and RE batteries).
 

neoh4x0r
Member
 
Posts: 63
Joined: Wed Aug 29, 2018 20:16
GitHub: neoh4x0r

Re: [Mod] Light Tool [0.3] [light_tool]

by neoh4x0r » Mon Aug 12, 2019 07:52

[removed -- seems the edited version got posted instead of updating this comment]
Last edited by neoh4x0r on Mon Aug 12, 2019 07:57, edited 1 time in total.
 

neoh4x0r
Member
 
Posts: 63
Joined: Wed Aug 29, 2018 20:16
GitHub: neoh4x0r

Re: [Mod] Light Tool [0.3] [light_tool]

by neoh4x0r » Mon Aug 12, 2019 07:56

benrob0329 wrote:Couldn't you also use VoxelManip to set the light levels for the nodes in front of the player?

Extex wrote:You can do that?
I'll look into it


Yes you could use VoxelManip https://dev.minetest.net/VoxelManip

Code: Select all
get_light_data()
set_light_data(light_data)


The Voxel Manipulator can be used to set many nodes in a specified area at once, which is useful to avoid unnecessary calculations.


It will want to load an entire mapblock or region within a given area, and as such, it probably is not practical for setting the lighting of a few nodes in-front of the player.
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.3] [light_tool]

by Extex » Mon Aug 12, 2019 17:35

Read the spoiler labeled technic flashlight
It's mostly for a friend of mine who wanted support for the technic flashlight
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.4] [light_tool]

by Extex » Tue Aug 13, 2019 23:04

Fixed bug accidentally implement when adding register_glow_node
All downloaders please get the latest update since previous release was broken
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Red_King_Cyclops
Member
 
Posts: 245
Joined: Sun Jun 16, 2019 20:17
Location: Earth

Re: [Mod] Light Tool [0.4] [light_tool]

by Red_King_Cyclops » Wed Aug 14, 2019 21:00

Thanks for adding fluid support. An underwater light tool is very useful for deep sea exploration.
My mod space_travel is similar to Galacticraft, but for Minetest.
 

ShadMOrdre
Member
 
Posts: 523
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: [Mod] Light Tool [0.4] [light_tool]

by ShadMOrdre » Thu Aug 15, 2019 20:04

Extex,

This is a really great mod. Makes exploring caves and duanes geomoria far more creepy.

One issue, one feature. Maybe.

When standing next to any node, like with my side up against a cave wall, even when pointing into completely open space, the light beam goes dark.

Since flashlights are useless in broad daylight, and the corresponding processing to make this effect possible in game, would it at all be possible to disable the flashlight beam, ie turn off the flashlight, when the light levels around the player are at a higher level than the flashlight emits.

I notice lag when I have the flashlight active in my hand, while walking on the surface during the day. It would seem that the flashlight continues to emit it's light beam, when maybe it shouldn't.

Again, thanks for the awesome mod. I've been wanting this for a LONG time. I can't sling a torch, and have the light stick when the torch lands. It lights up while being thrown, but then goes dark. This is unsettling in a dark cave.

Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 

Red_King_Cyclops
Member
 
Posts: 245
Joined: Sun Jun 16, 2019 20:17
Location: Earth

Re: [Mod] Light Tool [0.4] [light_tool]

by Red_King_Cyclops » Thu Aug 15, 2019 21:04

ShadMOrdre wrote:Extex,

This is a really great mod. Makes exploring caves and duanes geomoria far more creepy.

One issue, one feature. Maybe.

When standing next to any node, like with my side up against a cave wall, even when pointing into completely open space, the light beam goes dark.

Since flashlights are useless in broad daylight, and the corresponding processing to make this effect possible in game, would it at all be possible to disable the flashlight beam, ie turn off the flashlight, when the light levels around the player are at a higher level than the flashlight emits.

I notice lag when I have the flashlight active in my hand, while walking on the surface during the day. It would seem that the flashlight continues to emit it's light beam, when maybe it shouldn't.

Again, thanks for the awesome mod. I've been wanting this for a LONG time. I can't sling a torch, and have the light stick when the torch lands. It lights up while being thrown, but then goes dark. This is unsettling in a dark cave.

Shad

I noticed from the API that the light tool has a limit to the length of the light beam it emits, which is not entirely realistic.

Technically, with the wielded_light mod and the sling mod, you can sling torches across caverns and have them emit light the entire time.
My mod space_travel is similar to Galacticraft, but for Minetest.
 

ShadMOrdre
Member
 
Posts: 523
Joined: Mon Dec 29, 2014 08:07
Location: USA
GitHub: ShadMOrdre
In-game: shadmordre

Re: [Mod] Light Tool [0.4] [light_tool]

by ShadMOrdre » Thu Aug 15, 2019 22:41

Now that I think a little more, maybe a simple state based tool.

In on_place, you can easily enable/disable the beam. Effectively, an on/off switch. Might be far easier to code than determining light levels and such.

Another feature, within the state based tool concept, is to use a state as config, and allowing players to alter the strength of the light-source and length of light beam. It would be nice to switch to a higher powered light beam to shine further on in larger caves and dungeons, while enabling shorter beams for smaller spaces. All this allows some control over lag, while empowering this tool much further.

Red_King,

I use the slingshot and wielded_light mods, and they still serve a very valid purpose. My only issue, is that the light is so fleeting, in that if there is lag, the light may or may not show. When the torch lands, it becomes an item entity, so if you fire too many, you add to the lag. I'd like to see them sticky when landing, thus enabling lighting on demand. But that's best left to discussing in those topics.

Shad
MY MODS: lib_ecology lib_materials lib_clouds lib_node_shapes ---- Inspired By: Open Source Virtual World Simulator Opensimulator.
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.4] [light_tool]

by Extex » Fri Aug 16, 2019 04:47

Variable distances? Not sure about that one. I made a less laggy version under the spark-edition branch that only places blocks at the very end and right in front of the player

On/Off? Just scroll onto something else
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.4] [light_tool]

by Extex » Mon Aug 26, 2019 18:19

135 382 downloads on contentDB!
Last edited by Extex on Mon Sep 30, 2019 23:44, edited 2 times in total.
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Extex
Member
 
Posts: 92
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Light Tool [0.4] [light_tool]

by Extex » Mon Sep 30, 2019 23:32

What are your opinions on an admin light tool?
One that is not obstructed by blocks
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 


Return to Mod Releases



Who is online

Users browsing this forum: MSN [Bot] and 24 guests