[Mod] Walking Light [0.6] [walking_light]

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

[Mod] Walking Light [0.6] [walking_light]

by Echo » Tue Jul 31, 2012 08:31

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

by LolManKuba » Tue Jul 31, 2012 08:38

Nice! Finally there's a mod like this.
 

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

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

by Splizard » Tue Jul 31, 2012 08:51

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

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

by Topywo » Tue Jul 31, 2012 12:11

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
Location: Germany
GitHub: tinyworlds

by kddekadenz » Tue Jul 31, 2012 15:39

Could you please mirror this on another site?
 

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

by LolManKuba » Tue Jul 31, 2012 16:41

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: 121
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Tue Jul 31, 2012 17:31

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: 874
Joined: Tue Jun 05, 2012 16:34
Location: Poland

by cactuz_pl » Tue Jul 31, 2012 18:11

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

by LolManKuba » Tue Jul 31, 2012 18:25

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 » Tue Jul 31, 2012 18:58

+ 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: 213
Joined: Thu Mar 22, 2012 12:56
Location: Poland

by Ragnarok » Tue Jul 31, 2012 19:21

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: 121
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Tue Jul 31, 2012 19:46

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: 121
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Thu Aug 09, 2012 10:55

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 » Thu Aug 09, 2012 12:30

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 » Thu Aug 09, 2012 16:53

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: 121
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Tue Aug 14, 2012 17:20

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: 213
Joined: Thu Mar 22, 2012 12:56
Location: Poland
 

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

by Echo » Fri Aug 17, 2012 12:29

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 » Thu Aug 23, 2012 03:30

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 » Thu Aug 23, 2012 05:02

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: 121
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Thu Aug 23, 2012 18:12

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: 794
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Tue Oct 16, 2012 02:12

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: 518
Joined: Mon May 07, 2012 17:02
Location: MinetestForFun or Teeworlds master server list

by prof-turbo » Tue Oct 23, 2012 16:38

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: 556
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Mon Oct 29, 2012 04:16

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
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: orwell and 7 guests