[mod] Lighten wielded item [wielded_light]
Re: [mod] Lighten wielded item [wielded_light]
Planned is implementation to the sling mod. Or which kind of throwing did you mean?
- Phoenixflo44
- Member
- Posts: 639
- Joined: Fri Jul 28, 2017 15:01
- In-game: EvilPhoenix
- Location: Behind my PC, in Germany
Re: [mod] Lighten wielded item [wielded_light]
I mean the mod here but is already good
Spoiler
I hate my life
Re: [mod] Lighten wielded item [wielded_light]
If you throw the torch using Q button down into a cave, the light follow the torch. ;)
- Phoenixflo44
- Member
- Posts: 639
- Joined: Fri Jul 28, 2017 15:01
- In-game: EvilPhoenix
- Location: Behind my PC, in Germany
Re: [mod] Lighten wielded item [wielded_light]
That I meant otherwise good work.
Spoiler
I hate my life
Re: [mod] Lighten wielded item [wielded_light]
Enhanced throwing mod: https://github.com/minetest-mods/throwing/pull/16
Using enhanced version the shining for throwed items using https://github.com/minetest-mods/sling works out of the box
Using enhanced version the shining for throwed items using https://github.com/minetest-mods/sling works out of the box
- Attachments
-
- screenshot_20180508_225448.png (320.34 KiB) Viewed 1052 times
-
- screenshot_20180508_225446.png (372.27 KiB) Viewed 1052 times
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [mod] Lighten wielded item [wielded_light]
You’re modder of the day bell07 <3
Re: [mod] Lighten wielded item [wielded_light]
suggestions:bell07 wrote: 2. krondor registers only 1 helper node with light level 14. So krondors light is brighter, but with static brightness at maximum 14. My mod registers nodes 1-11. It is more dim but according the brightness of the wielded item.
I prefer to have a wielded item that is 2-3 levels darker than the placed thing, otherwise it's just too easy to always walk around with a lamp or torch all the time.
Also, having 1 node for each light level is not really needed, you can probably do a node for all the odd light levels, so you'd only have 6 nodes: 11, 9, 7, 5, 3 and 1. This won't change much visibly anyway.
Re: [mod] Lighten wielded item [wielded_light]
Just thought I'd put this out there. I implemented a similar thing for throwing lit items in my Geominer mod. Here's a glowstick being dropped but there is also one for throwing with your hand:
Geominer: viewtopic.php?f=9&t=17771
Geominer: viewtopic.php?f=9&t=17771
Re: [mod] Lighten wielded item [wielded_light]
The current setting is 2 levels darker. It is just 1 code line to change themsofar wrote:I prefer to have a wielded item that is 2-3 levels darker than the placed thing, otherwise it's just too easy to always walk around with a lamp or torch all the time.
Code: Select all
local level_delta = 2
In the meantime the wielded_light registers all 1-14 nodes because of the level could be set manually using wielded_light.register_item_light().sofar wrote:Also, having 1 node for each light level is not really needed, you can probably do a node for all the odd light levels, so you'd only have 6 nodes: 11, 9, 7, 5, 3 and 1. This won't change much visibly anyway.
I do not think to save 8 node definitions does an performance boost. Other mods defines > 100 items oO. I do not see the reason to support an other light levels count then mintest engine does.
Re: [mod] Lighten wielded item [wielded_light]
I did not know that. Looking to the code....Devy wrote:Just thought I'd put this out there. I implemented a similar thing for throwing lit items in my Geominer mod.
The difference is my mod uses nodetimers to remove the shining node, and does not have flickering if different light sources are in the same coordinates, and also check if shining is neccessary reading current node light level...
Re: [mod] Lighten wielded item [wielded_light]
Yeah, I looked at your code and it seems way better than what I did. Good job!bell07 wrote:I did not know that. Looking to the code....Devy wrote:Just thought I'd put this out there. I implemented a similar thing for throwing lit items in my Geominer mod.
The difference is my mod uses nodetimers to remove the shining node, and does not have flickering if different light sources are in the same coordinates, and also check if shining is neccessary reading current node light level...
In fact, I may use this instead of what I did.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [mod] Lighten wielded item [wielded_light]
I always liked your idea Devy, but applying the effect to any (existing) item is what I really need, instead of new single-purpose items. (Q-dropped torch replaces droppable glowstick, sling-thrown torch replaces throwable glowstick). Multi-purpose ftw!
- Hamlet
- Member
- Posts: 766
- Joined: Sat Jul 29, 2017 21:09
- IRC: H4mlet
- In-game: Hamlet
- Location: Lombardy, Italy
Re: [mod] Lighten wielded item [wielded_light]
Reading this thread I've noticed that the mod relies on placing and removing invisible light blocks; I've tried this kind of solution using Hardcore torchs by BrunoMine and I've found that this approach has one issue.bell07 wrote:Idea taken from torches_wieldlight in https://github.com/minetest-mods/torches, but written from scratch and usable for all shining items.[...]
If the invisible light block is placed under a falling node (sand, gravel, etc.) when the said light block is removed it triggers the fall of the nodes above.
Recently I've discovered Opposite Torch by Atreela which relies on "minetest.fix_light": instead of placing invisible nodes it updates the surrounding nodes' light level.
Do you think that it could be used in your mod?
My repositories: Codeberg.org | My ContentDB's page
Re: [mod] Lighten wielded item [wielded_light]
The attenuation is nice to have, but users should consider weakening the torch itself because it has several positive side effects in my opinion - at least for survival games. And you don't have to "explain" why wielded torches are weaker than wall-mounted ones.
I was worried too before testing this mod that it would make static lights useless, but because my torches were already level 10 -bright, the handheld torches only let you see one or two blocks around.
I was worried too before testing this mod that it would make static lights useless, but because my torches were already level 10 -bright, the handheld torches only let you see one or two blocks around.
My game? It's Minefall.
Re: [mod] Lighten wielded item [wielded_light]
Tried shortly and the issue does not appear in wielded_item. I use minetest.swap_node() to remove the block, that does not trigger falling nodes.Hamlet wrote:If the invisible light block is placed under a falling node (sand, gravel, etc.) when the said light block is removed it triggers the fall of the nodes above.
Interessting, I search for an other solution then placing blocks, because I can re-place only the air by shining node. Therefore the shining does not work on stairs, snow, ladders and other "nearly empty nodes".Hamlet wrote:Recently I've discovered Opposite Torch by Atreela which relies on "minetest.fix_light": instead of placing invisible nodes it updates the surrounding nodes' light level.
But how I can set the light level using minetest.fix_light(pos1, pos2)?
That was the reason why I implemented attenuation, the placing torches should not gets obsolete by this mod. And about realizm: How the shining should be if you wield 99-torches-stack?Astrobe wrote:I was worried too before testing this mod that it would make static lights useless, but because my torches were already level 10 -bright, the handheld torches only let you see one or two blocks around.
PS: If you have issues with to bright items in your subgame (like meselamp) you can override the value using wielded_light.register_item_light(itemname, light_level)
So it is possible to leave meselamp with placed light_level 14 as is, but set wielded item shining to light_level=1
Re: [mod] Lighten wielded item [wielded_light]
Actually the real "unlight" is done by make_darkness() or darken_place(), which looks like a heavy process. The author uses some sort of trick not to do it on every activation of the ABM (once per second).bell07 wrote:But how I can set the light level using minetest.fix_light(pos1, pos2)?
I don't think light is additive in Minetest, that's why we can't have lazors :-D (Archimedes' Death Ray mod? make a mirror from glass and tin, surround it with eight mese lights, watch the cows burn)bell07 wrote:That was the reason why I implemented attenuation, the placing torches should not gets obsolete by this mod. And about realizm: How the shining should be if you wield 99-torches-stack?
Re: [mod] Lighten wielded item [wielded_light]
Looked to the code, it is really a lot of woodo appears, for an area 30x30x30 the light calculation is done manually in lua each second. It is a hack, therefore to reset a "fix" function is needed. For a not moved object it is maybe ok, but the wielded_light requires a lightwight way to "smooth move" the light source if player or item moves. The current setting is update each 0.2 seconds with minimum shining duration x3. The trick I use is to reset the nodetimer if the helper node already in place and should continue shining. So the full node replacement is really on demand only.Astrobe wrote:Actually the real "unlight" is done by make_darkness() or darken_place(), which looks like a heavy process. The author uses some sort of trick not to do it on every activation of the ABM (once per second).
But my way is not possible to take opposite shining ...
Re: [mod] Lighten wielded item [wielded_light]
First post updated
Re: [mod] Lighten wielded item [wielded_light]
This can be avoided. Not sure if `swap_node` avoids the update, but a vmanip will for sure.Hamlet wrote: If the invisible light block is placed under a falling node (sand, gravel, etc.) when the said light block is removed it triggers the fall of the nodes above.
Manually updating the entire light map is likely more expensive.
- Hamlet
- Member
- Posts: 766
- Joined: Sat Jul 29, 2017 21:09
- IRC: H4mlet
- In-game: Hamlet
- Location: Lombardy, Italy
Re: [mod] Lighten wielded item [wielded_light]
I've checked both mods for the issue that I've mentioned, none of them has it.sofar wrote:This can be avoided. Not sure if `swap_node` avoids the update, but a vmanip will for sure.Hamlet wrote: If the invisible light block is placed under a falling node (sand, gravel, etc.) when the said light block is removed it triggers the fall of the nodes above.
Manually updating the entire light map is likely more expensive.
My repositories: Codeberg.org | My ContentDB's page
Re: [mod] Lighten wielded item [wielded_light]
Geominer had an item that did that, you should look it up an see the code, it may help.
- Pyrollo
- Developer
- Posts: 385
- Joined: Mon Jan 08, 2018 15:14
- GitHub: pyrollo
- In-game: Naj
- Location: Paris
Re: [mod] Lighten wielded item [wielded_light]
Hi,
Using wielded_light I was wondering if it would be easy to make it work also under water.
Have you already considered that ? Have you encountered any obstacle that prevents to do it so ?
Using wielded_light I was wondering if it would be easy to make it work also under water.
Have you already considered that ? Have you encountered any obstacle that prevents to do it so ?
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [mod] Lighten wielded item [wielded_light]
I also thought about that. Torches and lanterns should probably not work under water, but meselamps should.
Re: [mod] Lighten wielded item [wielded_light]
Mod Update!
Add search for alternative positions if current position is not air, like the newcomer "ilumination" mod does.
Played around shininig in water with same logic. Does flacker, in minetest 0.4.17.1, did not tested with Minetest-5.0.0.
Not merged to master because of this issues, but available for testing in https://github.com/minetest-mods/wielde ... ater_shine branch.
Add search for alternative positions if current position is not air, like the newcomer "ilumination" mod does.
Played around shininig in water with same logic. Does flacker, in minetest 0.4.17.1, did not tested with Minetest-5.0.0.
Not merged to master because of this issues, but available for testing in https://github.com/minetest-mods/wielde ... ater_shine branch.
Re: [mod] Lighten wielded item [wielded_light]
Hi. I'm curious what state the underwater support is in and how hard it might be for a complete noob to pick up?
I assumed that the light going out under water was intentional, because torches/fire, but got annoyed when I was using glow glass. I noticed the ladder thing too, but it hadn't quite sunk in that there was a technical issue involving non-air nodes.
I assumed that the light going out under water was intentional, because torches/fire, but got annoyed when I was using glow glass. I noticed the ladder thing too, but it hadn't quite sunk in that there was a technical issue involving non-air nodes.
Who is online
Users browsing this forum: No registered users and 56 guests