Project Zomboid

Project Zomboid

Enhanced Flashlight Glow
35 Comments
Guicsr_ 30 Jun @ 8:54pm 
I didn't notice, but I have to change it in the menu because it's set to default on standard.
Gio  [author] 30 Jun @ 8:28pm 
@Guicsr_ I just tested it on 42.10 and it's working perfectly. If you can't notice the effect, it might be that the brightness setting is too low for your monitor/setup. Try increasing it in the in-game mod settings.

There are 3 settings for brightness included in the mod.
Guicsr_ 29 Jun @ 9:10pm 
Is the mod still working? It seems like nothing changed when I activated it, this was on b42.9
Amroth 16 Mar @ 8:23am 
That's what I initially assumed because the car would glow when turning on the headlights. Turns out, another mod was going through each vehicle light every in-game minute and setting their intensity to maximum, lol.

Sorry for the false alarm. And thanks for the mod, absolutely essential +1
Gio  [author] 15 Mar @ 5:40pm 
@Amroth I see. I was thinking maybe that turning on car headlights would give increase a player's torch strength or something. Thanks for testing
Amroth 15 Mar @ 5:13pm 
I did some more testing, false alarm. Seems to work fine together. It was another mod causing issues.
Gio  [author] 15 Mar @ 5:09pm 
Looking into it @Amroth
Amroth 13 Mar @ 1:03pm 
Is there a way to make this compatible with Nepenthe's High Beams mod?

Both are absolutely essential, but having this on breaks high beams.
Gio  [author] 8 Feb @ 12:11am 
@Drestalos The b41 version should work fine I think? It's just lacking the settings like changing brightness level and toggling the lantern radius. I have personally had problems with the texture mod in b41 before though. Definitely remember some sort of flickering occurring with that mod.

To be completely honest though, I haven't tested the b41 version, but the logic is exactly the same for how the light is generated, so it should be identically to the version I have tested. I don't think anything has changed in terms of APIs for what I'm touching since b41 (minus the mod settings).
Drestalos 7 Feb @ 3:59pm 
Yea, probably just something on my end, it does shine light outward, but it also flickers; could it be Every Texture Optimised or something? I'm running build 41 for what it's worth. I don't think it's your mod, just wanted to see if it was something easily fixed or required some other testing. I appreciate you getting back to me!
Gio  [author] 7 Feb @ 7:48am 
@Drestalos Additionally, the method used for generating light is such that it would be impossible for it to only light your character model. The minimum lightsource that can be made would light up a bigger radius than just the tile your character is on, let alone just your character model.
Gio  [author] 7 Feb @ 7:43am 
@Drestalos The mod should only be in effect when your character is actively using a lightsource. I.e. your character's torch strength > 0. Did you try running the mod by itself?
Drestalos 2 Feb @ 6:16pm 
Hey big guy, dunno if it's some sort of mod conflict, or a setting I may have on the base game, but when I add your mod, it causes a faint constant lighting flicker on my character model
MyScreamers 28 Jan @ 1:26pm 
How cain i expand the brightness radius from all the light sources in general?
Mr. Sinister 7 Jan @ 7:05am 
Need to have Brights for Headlights modded. Now that nighttime is so dark, you can't see anything while driving.
wazzupbeijing 6 Jan @ 3:06am 
car headlight mods would be awesome!
cause they're real problem you cant drive at night
Dima.V 5 Jan @ 12:03am 
How do you activate a bigger brightness?
Gio  [author] 26 Dec, 2024 @ 3:42pm 
@Krow I'd consider it. Not sure on if I'd be able to dynamically apply it like with this mod vs having to hard code it. Seems like a natural evolution after doing this mod though.
Krow 25 Dec, 2024 @ 7:46pm 
This is great! Any chance you'd be interested in doing something similar for cars? Blows my mind that you can only see five feet infront of you while driving
Gio  [author] 23 Dec, 2024 @ 3:22pm 
@black_rose

I created the mod pretty quickly, but the problem is the precision in the grid squares make it look extremely bad. Think like, when your character is moving the light radius moving isn't smooth, because it's only updated when moving to a new grid square (since I need to spawn the light on the square).

You can see what I mean if you do something like "right click > walk to". That's the grid the lights are being spawned on, but the player can move quite a distance in one square without it moving, so it causes the jittery light moving that I'm mentioning.

This effect isn't noticeable on this mod because there's already so much light from the other source that it gets really smoothed out.


I can throw you the code if you want to do it yourself, but I don't feel like bothering releasing something that I would never use / think looks bad.
black_rose 23 Dec, 2024 @ 2:08pm 
thats how it always is with these things lol.

also, outside the scope of this mod, but i have an idea for a mod where in the dark theres still a small, grey, lit area around the player to represent your ability to sense/feel your surroundings. idk how simple or similar what you've done here is though
Gio  [author] 23 Dec, 2024 @ 10:27am 
@black_rose

Thanks lol. I love how I made the estimate of 10mins, then I realized my lantern detection code wasn't working, so had to find a fix.

Hope you enjoy the new version!
black_rose 23 Dec, 2024 @ 10:23am 
A1 job my guy!
Gio  [author] 23 Dec, 2024 @ 8:59am 
@Markovicz

Thanks for catching that lol. I'll fix it

@MarshallSantini

Nice job finding the conflict, like I said, I think this new patch will hopefully fix everything, going to upload in the next 10mins or so.
Markovicz 23 Dec, 2024 @ 8:34am 
Workshop title: Enchanced ... .. In-game title: Enhanced ... . Just saying :cherrypie:
MarshallSantini 23 Dec, 2024 @ 8:30am 
Thank you so much for looking into this so immensely! I did some more testing yesterday and found that Katta's clothes comes with a flashlight that I didnt realize. When I turn on that flash light, the error does not appear. So I assume the conflict is with Katta's clothing mod which is overriding your mod. I can still post the mod list and full error if youd like.
I also checked the hand crank flashlight. For me it will turn on, then immediately off. The charge will still go down as if its staying on.
Gio  [author] 23 Dec, 2024 @ 6:54am 
@MarshallSantini

I found a way to not rely on checking items directly. Hopefully this should fix most if not all errors, working on a patch right now, should be done soon.
Gio  [author] 22 Dec, 2024 @ 8:19pm 
@MarshallSantini

I tried for a while and couldn't reproduce this error.

The line it's referring to is just making some function calls for a branch decision. The function calls depend on the secondaryItem object, or in other words, what the player is holding in their left hand. I'm pretty new to lua, so not sure if my syntax was slightly off on checking if such an object existed. I tried to make a correction, however like I said I wasn't even able to reproduce it in any configuration of main-hand, off-hand, modded lights, vanilla lights, etc..

If you could please consider posting steps to reproduce along with a screenshot or plain-text of your mod list I would greatly appreciate it.

Sorry if too much technical jargon btw, just letting you know I looked into it. Thanks for reporting.
Gio  [author] 22 Dec, 2024 @ 6:20pm 
@MarshallSantini

I'll take a look tonight, can you post your modlist? I'll make a bug report thread to put your mods.
MarshallSantini 22 Dec, 2024 @ 5:56pm 
I must have a conflict of some sort, is there any known incompatibilities? The only flashlight related mod I believe I have is the crank flash light. But I am getting an immense amount of errors as soon as I turn on a flash light. I tired using multiple flashlights, but the error stayed.

function: flashlightChecker -- file: light_controller.lua line # 63 | MOD: Enhanced Flashlight Glow

LOG : General , 1734918722041> Object tried to call nil in flashlightChecker
ERROR: General , 1734918722041> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in flashlightChecker at KahluaUtil.fail line:82.
ERROR: General , 1734918722041> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in flashlightChecker
black_rose 22 Dec, 2024 @ 5:03pm 
you are "the bomb" ;)
Mongrel Man 22 Dec, 2024 @ 2:50pm 
@Walter Blanco thanks man
Gio  [author] 22 Dec, 2024 @ 2:37pm 
@Mongrel Man

Done.
Mongrel Man 22 Dec, 2024 @ 2:30pm 
Can you add a before and after photo?
CozyCouch 22 Dec, 2024 @ 2:12pm 
thank you! this is a livesaver after the power shutdown!