[Mod] Walking Light [0.6] [walking_light]

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

[Mod] Walking Light [0.6] [walking_light]

by Echo » Post

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
Last edited by Echo on Sat Feb 09, 2013 13:15, edited 1 time in total.

User avatar
LolManKuba
Member
Posts: 939
Joined: Fri Feb 10, 2012 22:36
Location: Ontario, Canada
Contact:

by LolManKuba » Post

Nice! Finally there's a mod like this.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

Haha, nice!

User avatar
Splizard
Member
Posts: 227
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard
Location: New Zealand
Contact:

by Splizard » Post

Cool mod! It's a bit buggy though (sometimes the lighting is not removed).
Games: Builda City, The Hungry Games Mods: Lifters, Snow Biomes and Gates. Also checkout my texture pack Gridtoon!

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

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 :-)

User avatar
kddekadenz
Member
Posts: 323
Joined: Mon Jun 27, 2011 17:21
GitHub: tinyworlds
Location: Germany
Contact:

by kddekadenz » Post

Could you please mirror this on another site?

User avatar
LolManKuba
Member
Posts: 939
Joined: Fri Feb 10, 2012 22:36
Location: Ontario, Canada
Contact:

by LolManKuba » Post

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.

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

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...

User avatar
cactuz_pl
Member
Posts: 876
Joined: Tue Jun 05, 2012 16:34
Location: Poland

by cactuz_pl » Post

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

User avatar
LolManKuba
Member
Posts: 939
Joined: Fri Feb 10, 2012 22:36
Location: Ontario, Canada
Contact:

by LolManKuba » Post

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

User avatar
Liandri
Member
Posts: 29
Joined: Tue Jan 10, 2012 12:20

by Liandri » Post

+ 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

User avatar
Ragnarok
Member
Posts: 217
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

Amazing mod =)
cactuz_pl wrote:Idea:
Lighting mese pickaxe (craft: torch + mese pickaxe), this would be very handy while mining.
LOL - Tactical Pickaxe :D

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

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 :-)

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

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?

User avatar
RandomBot
Member
Posts: 164
Joined: Sun May 20, 2012 03:46
Location: Behind you, go ahead, look....

by RandomBot » Post

so its like terraria torches, +1
"Everyone has a plan, until they get punched in the face"
- Mike Tyson

Ghost_of_tino

by Ghost_of_tino » Post

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.

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

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 :)

User avatar
Ragnarok
Member
Posts: 217
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

Heh, so cool :) Nice inventory texture.

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

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...

Nubelite
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

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
Member
Posts: 161
Joined: Mon Jul 16, 2012 23:10

by Nubelite » Post

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)

User avatar
Echo
Member
Posts: 122
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Post

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.

User avatar
Neuromancer
Member
Posts: 958
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Post

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.

User avatar
prof-turbo
Member
Posts: 516
Joined: Mon May 07, 2012 17:02
Location: MinetestForFun or Teeworlds master server list

by prof-turbo » Post

Cool, a little slowly but that's not really a problem.
You should take a look at http://www.xorhub.com

User avatar
RealBadAngel
Member
Posts: 557
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Post

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 ... hlight.lua

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests