Page 1 of 2

[Mod] Walking Light [0.6] [walking_light]

PostPosted: Tue Jul 31, 2012 08:31
by Echo
Hold a torch in your hand and light up the night and cave!

When a torch is wielded, a transparent lighting node is placed on players position (and removed from the old position).

License
Code: WTFPL, textures: CC BY-SA

Mod dependencies
default

Download
0.6 walking_light_0_6.zip
0.5 walking_light_0_5.zip
0.4 walking_light_0_4.zip
0.3 walking_light_0_3.zip
0.2 walking_light_0_2.zip
0.1 walking_light.zip


Version History
  • 0.6 fixed server crash when a player leaves (thanks to Nubelite)
  • 0.5 thanks to the trick from worldedit, no more lost light
  • 0.4 added the "Lighting mese pickaxe". Just put a torch above a mese-pick
  • 0.3 torch lights when wading through water / code cleanup / seems to be a problem in the minetest engine with the light update, sometimes the voxel based dynamic lighting stays although there is no light source
  • 0.2 torch lights directly when selected / minor bugfixes
  • 0.1 first release

Edit: added word "license" for sfan5s squealer-script

PostPosted: Tue Jul 31, 2012 08:38
by LolManKuba
Nice! Finally there's a mod like this.

PostPosted: Tue Jul 31, 2012 08:49
by Calinou
Haha, nice!

PostPosted: Tue Jul 31, 2012 08:51
by Splizard
Cool mod! It's a bit buggy though (sometimes the lighting is not removed).

PostPosted: Tue Jul 31, 2012 12:11
by Topywo
Great mod!

I tried the following 2 additions (line 36 and 38) and they worked too:

if is_air ~= nil and (is_air.name == "air" or is_air.name == "default:water_source" or is_air.name == "walking_light:light")then
-- print('set '..minetest.pos_to_string(ontop))
if (is_air.name == "air" or is_air.name == "default:water_source") then

Thanks again :-)

PostPosted: Tue Jul 31, 2012 15:39
by kddekadenz
Could you please mirror this on another site?

PostPosted: Tue Jul 31, 2012 16:41
by LolManKuba
Splizard wrote:Cool mod! It's a bit buggy though (sometimes the lighting is not removed).

Kind've obvious if it's the first version.

PostPosted: Tue Jul 31, 2012 17:31
by Echo
Topywo wrote:Great mod!

I tried the following 2 additions (line 36 and 38) and they worked too:

if is_air ~= nil and (is_air.name == "air" or is_air.name == "default:water_source" or is_air.name == "walking_light:light")then
-- print('set '..minetest.pos_to_string(ontop))
if (is_air.name == "air" or is_air.name == "default:water_source") then

Thanks again :-)


Feel free to modify whatever you want. I suggest you invent a waterproofed burning torch ;-)

And make sure that you do not make air-holes in the water...

PostPosted: Tue Jul 31, 2012 18:11
by cactuz_pl
Idea:
Lighting mese pickaxe (craft: torch + mese pickaxe), this would be very handy while mining.

PostPosted: Tue Jul 31, 2012 18:25
by LolManKuba
cactuz_pl wrote:Idea:
Lighting mese pickaxe (craft: torch + mese pickaxe), this would be very handy while mining.

+2

PostPosted: Tue Jul 31, 2012 18:58
by Liandri
+ 1 for the mod :D

cactuz_pl wrote:Idea:
Lighting mese pickaxe (craft: torch + mese pickaxe), this would be very handy while mining.


+ 1!. Some sort of a "mining helmet" with a light attached would be nice too :D

PostPosted: Tue Jul 31, 2012 19:21
by Ragnarok
Amazing mod =)

cactuz_pl wrote:Idea:
Lighting mese pickaxe (craft: torch + mese pickaxe), this would be very handy while mining.


LOL - Tactical Pickaxe :D

PostPosted: Tue Jul 31, 2012 19:46
by Echo
Ragnarok wrote:Amazing mod =)

cactuz_pl wrote:Idea:
Lighting mese pickaxe (craft: torch + mese pickaxe), this would be very handy while mining.


LOL - Tactical Pickaxe :D


Reminds me of "doom 3". You want the "duct tape" mod :-)

PostPosted: Thu Aug 09, 2012 10:55
by Echo
Updated the mod.

The problem with the "not removed" lighting is still there.
The lighting node is removed but the voxel based dynamic lighting isn't always updated properly. Seems to be a problem in the minetest engine (ok, minetest isn't made for this "dynamic" dynamic lighting).

Anybody any idea?

PostPosted: Thu Aug 09, 2012 12:30
by RandomBot
so its like terraria torches, +1

PostPosted: Thu Aug 09, 2012 16:53
by Ghost_of_tino
Echo wrote:Updated the mod.

The problem with the "not removed" lighting is still there.
The lighting node is removed but the voxel based dynamic lighting isn't always updated properly. Seems to be a problem in the minetest engine (ok, minetest isn't made for this "dynamic" dynamic lighting).

Anybody any idea?

I heard that in the latest WorldEdit, they had a lightfix command. You may want to see how they pulled it off.

PostPosted: Tue Aug 14, 2012 17:20
by Echo
Echo wrote:
Ragnarok wrote:Amazing mod =)

cactuz_pl wrote:Idea:
Lighting mese pickaxe (craft: torch + mese pickaxe), this would be very handy while mining.


LOL - Tactical Pickaxe :D


Reminds me of "doom 3". You want the "duct tape" mod :-)


added the tactical pickaxe :)

PostPosted: Tue Aug 14, 2012 22:48
by Ragnarok
Heh, so cool :) Nice inventory texture.

PostPosted: Fri Aug 17, 2012 12:29
by Echo
Ghost_of_tino wrote:[...]
I heard that in the latest WorldEdit, they had a lightfix command. You may want to see how they pulled it off.


They add a non-transparent node and remove it to enforce the recalculation of the light. So do I in the new version. No more lost light, so far...

PostPosted: Thu Aug 23, 2012 03:30
by Nubelite
I ran into a small issue using this mod on my server. to resolve it i had to add

if player ~= nil then

above line 28. No more crashing for me now. lol

PostPosted: Thu Aug 23, 2012 05:02
by Nubelite
Still getting the error and the server crashes

ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...t Server/bin/../mods/minetest/walking_light/init.lua:29: bad argument #2 to 'remove' (number expected, got userdata)

PostPosted: Thu Aug 23, 2012 18:12
by Echo
Nubelite wrote:I ran into a small issue using this mod on my server. to resolve it i had to add

if player ~= nil then

above line 28. No more crashing for me now. lol

Nubelite wrote:Still getting the error and the server crashes

ERROR: An unhandled exception occurred: ServerError: LuaError: error: ...t Server/bin/../mods/minetest/walking_light/init.lua:29: bad argument #2 to 'remove' (number expected, got userdata)


Thank you for your note. I was able to fix the bug. I totally misused the function table.remove, which is not visible in singleplayer. Also repaired that a leaving player could leave his light.

PostPosted: Tue Oct 16, 2012 02:12
by Neuromancer
Just looking for your thoughts on this. I love this mod, but it breaks the water sounds in the immersive sounds mod because that checks what is at the users head, body and feet. If it's air, at the head, then the user could be treading water, if it's water, then gurgling bubbles. But when I have a torch in my hand, and use this mod, the logic is all screwed up. I was wondering if you could put the lightsource node just to the right of the user, this would be logical because they are holding the torch in their right hand. I don't check what is directly to the right of the player for the water logic. I don't know how difficult this would be to do in your mod, but it would take a lot of if then or logic in the immersive sounds mod, which I'd prefer not to get into if I don't have to.

PostPosted: Tue Oct 23, 2012 16:38
by prof-turbo
Cool, a little slowly but that's not really a problem.

PostPosted: Mon Oct 29, 2012 04:16
by RealBadAngel
Im using the idea in Technic mod for Flashlight. Yesterday i rewrote the code, and believe its faster and more reliable:
https://github.com/RealBadAngel/technic/blob/master/flashlight.lua

PostPosted: Mon Jul 01, 2013 19:54
by Slain
is it possible for a mod like this to be made compatible with the crafting mod?

PostPosted: Mon Jul 01, 2013 21:54
by Mito551
how is this one isn't? and try dwarves for new, improved version of this mod

PostPosted: Sun Nov 10, 2013 19:15
by nfsprodriver
Hello everybody!

This is my first post. First I want to say, I do not understand much of programming mods, but a little bit:

This release is for everybody needing a bit more speed with the walking light. In my version I:

-removed the cobble as smoke or whatever
-compressed the walking_light texture to 1x1px (there's no difference I think)

I think, it would speed up the fps when you use the walking_light, by the way a fantastic mod!!!
'Hope you enjoy...

My English might not be very good ;) .

Re: [Mod] Walking Light [0.6] [walking_light]

PostPosted: Sun Apr 27, 2014 11:16
by dgm5555
is there some odd way you've zipped the files. I can't extract them (Ubuntu 14.04, default unzip)

Re: [Mod] Walking Light [0.6] [walking_light]

PostPosted: Sun Sep 21, 2014 21:31
by sloantothebone
your mod produces a stone block which is visible when I walk backwards and removed half my door in voxelgarden. You might try making it be overwritten by things like doors and signs, etc and overwrite water blocks, instead of being overwritten by water blocks and overwriting doors.