Project Zomboid

Project Zomboid

[B42] Lantern Fix
82 Comments
Shiro 16 hours ago 
I second the candle idea, I have been searching for a similar mod for years now, we absolutely need a non-electric light source in B42, and what better candidate than the humble candle
Rhinehart666 28 Sep @ 5:24pm 
Thanks, this is so helpful, I'm surprised there aren't more mods for placeable, non-electric lighting. Candles would also be super useful since they're easier to replace late game than fuel.
NamelessDude77  [author] 25 Aug @ 4:46pm 
@Harry there's a chance for candles to made it into the mod, not sure about flashlights and glow sticks though. If you can't find one, maybe you could try crafting an improvised lantern.
Harry 25 Aug @ 4:01pm 
any chance of doing the same with flash lights, glow sticks and candles? I tried looking for one and can't find any. also i cant wait to find a lantern in my game!
Nu_man 8 Aug @ 7:18pm 
they won't add MP but they'll add a lantern you can't have lit on the ground. already insane you can't be holding a torch and drop that while its on, thank you for making the game what it should be in this area.
NamelessDude77  [author] 6 Aug @ 8:12am 
@pimatstudio the workaround used to turn the lanterns on is spawning a light object at the same square the lantern is, same with the propane lantern sound. On the other hand, walkie-talkies are always carried with the player, so I don't think there are any similarities you could use. I don't understand walkie-talkies code, but if I could guess, I'd first try making the radio stay on when unequipping and then keep the "Device Options" in the menu when unequipped, but I think you have already tried those :P
pimatstudio 6 Aug @ 4:41am 
@NamelessDude77
Hey, would you also be able to make a walkie-talkie work while holstered by the belt for example? I've been wondering if it's even possible, and since your mod does something similar, maybe you've got an answer to that? I was trying to find any possible way to do that but to no avail so far.
NamelessDude77  [author] 5 Aug @ 3:05pm 
@skylars8311 yes
skylars8311 5 Aug @ 2:54pm 
can this be added and used mid save?
The 8th Victim 5 Aug @ 2:17pm 
Thx !
NamelessDude77  [author] 5 Aug @ 1:20pm 
Fixed the rest.

@Migs thanks! :D

@Gimbo I'm considering it, but right now I don't have time
Gimbo 5 Aug @ 1:16pm 
dude thanks a lot........your mod is essential, can i ask if u were thinking to make similar for candles?
Migs 5 Aug @ 12:03pm 
Thank you for updating the mod, may your pillow always be cozy and cold on both sides :lunar2025snakeinablanket:
Bulletmagnet 5 Aug @ 8:36am 
Was literally about to post the same error. Thanks for the quick response!
NamelessDude77  [author] 5 Aug @ 7:16am 
@Calamity I don't think so.
NamelessDude77  [author] 5 Aug @ 7:12am 
Should be fixed now. But will make detecting lanterns more difficult, you'll have to right click the same square the lantern is placed for it to show up in menu until I find a better solution.
Phil 5 Aug @ 2:57am 
Having this error:

function: findLanterns -- file: LanternFix_main.lua line # 36 | MOD: [B42] Lantern Fix
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@20f4705b
function: createMenu -- file: ISWorldObjectContextMenu.lua line # 214 | Vanilla
function: createMenu -- file: ISMenuContextWorld.lua line # 50 | Vanilla
function: createWorldMenu -- file: ISContextManager.lua line # 28 | Vanilla
function: doRClick -- file: ISObjectClickHandler.lua line # 63 | Vanilla
function: onObjectRightMouseButtonUp -- file: ISObjectClickHandler.lua line # 428 | Vanilla
Ziodyne967 4 Aug @ 9:29pm 
Dang, I just tried it with the mod off. Can't turn the lantern on while it's unequipped and on the ground again. I liked using lanterns when I have to go out camping on the side of the road, so this mod was really good. At least I dont get errors every time I right-click now. Just gotta wait until all the mods update, as usual.
Ziodyne967 4 Aug @ 9:24pm 
huh, there appears to be an issue with the mod. Did the devs integrate this into the main game like they did with resizing map symbols? Either way, every time I right click, the game gives me an error.
Calamity 4 Aug @ 8:36pm 
is this compatible with lantern mods?
卷毛Jed 4 Aug @ 6:14pm 
Additionally, this issue occurs with other actions as well, not just this mod, and it may have been caused by the latest update.
卷毛Jed 4 Aug @ 6:12pm 
Thank you for your reply. Right-clicking the “Cigarette” on my character to “Smoke” will trigger the error. The error message is as follows:[B42] Lantern Fix Error:
function: findLanterns -- LanternFix_main.lua line 36
Triggered by: Right-clicking a world object
Error: Object tried to call nil
NamelessDude77  [author] 4 Aug @ 5:46pm 
@卷毛Jed does right clicking in the inventory trigger the error? I'm still unable to reproduce this. I'll see if the code used in that function has changed tomorrow, I'm very tired now.
卷毛Jed 4 Aug @ 4:55pm 
After the newest Project Zomboid B42 patch, smoking a cigarette triggers a Lua error related to [B42] Lantern Fix. When I right‑click to smoke, the error pops up: function: findLanterns -- file: LanternFix_main.lua line #36 | java.lang.RuntimeException: Object tried to call nil in findLanterns. Game version: B42 latest patch. Other mods: [list here or “None besides Lantern Fix”]. Hope this helps identify the issue.
NamelessDude77  [author] 4 Aug @ 4:45pm 
@Codemonkey3 just checked it, but no issues on my side with my current set of mods. You can post your stack trace in the bugs discussion so I can see what it could be.
Codemonkey3 4 Aug @ 3:52pm 
There appears to be some sort of conflict with the newest patch. Right clicking the ground creates a lua error regarding it.
MrFrenglitch 29 Jul @ 7:41pm 
Thanks for the fix @NamelessDude77

I had the same issue where errors would pop when trying to pick stuff on the ground. I had the deactivate and reactivate each mod one by one and figured out the errors popped only when the lantern fix mod was enabled. So I came here and read your comment and it worked! No more errors. Thanks.
NamelessDude77  [author] 27 Jul @ 7:22am 
@Smurf∞¸.•'¯) The place option will turn off your lantern, it's a known modding limitation, there's no way to hook into manually placed objects, so there's nothing I can do about it, unfortunately. It should work when using the drop function while you hold them, though. If it still doesn't work, tell me how are you doing it and I'll see what I can do.
Smurf∞¸.•'¯) 27 Jul @ 6:42am 
i try place or drop the lantern but it won't lit up , only hold on hand it lit
Smurf∞¸.•'¯) 24 Jul @ 9:36pm 
can u make more light item such as candle and etc can be place on the world instead of holding them
Cosmo 21 Jul @ 3:30pm 
@NamelessDude77 you my hero no errors and auto logging mod work without error too
Cosmo 21 Jul @ 3:24pm 
@NamelessDude77 let me check
NamelessDude77  [author] 21 Jul @ 3:22pm 
@Cosmo Try loading Bodily Functions after Lantern Fix, it should fix your issue.
FusionPhoenix 21 Jul @ 11:57am 
i have tons of candles and there are mods to make more. Can you make this work with candles too? it would allow me to save generator fuel and also it would make a good early game alternative to adding batteries to lamps
Cosmo 20 Jul @ 3:12pm 
at zombie.gameStates.IngameState.update(IngameState.java:1464)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:87)
at zombie.GameWindow.logic(GameWindow.java:382)
at zombie.GameWindow.frameStep(GameWindow.java:916)
at zombie.GameWindow.mainThreadStep(GameWindow.java:642)
at zombie.MainThread.mainLoop(MainThread.java:76)
at java.base/java.lang.Thread.run(Unknown Source)
`
Cosmo 20 Jul @ 3:12pm 
at zombie.MovingObjectUpdateSchedulerUpdateBucket.update(MovingObjectUpdateSchedulerUpdateBucket.java:71)
at zombie.MovingObjectUpdateScheduler.update(MovingObjectUpdateScheduler.java:158)
at zombie.iso.IsoCell.ProcessObjects(IsoCell.java:3054)
at zombie.iso.IsoCell.updateInternal(IsoCell.java:5959)
at zombie.iso.IsoCell.update(IsoCell.java:5892)
at zombie.iso.IsoWorld.updateWorld(IsoWorld.java:4197)
at zombie.iso.IsoWorld.updateInternal(IsoWorld.java:4317)
at zombie.iso.IsoWorld.update(IsoWorld.java:4231)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1699)
Cosmo 20 Jul @ 3:12pm 
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:100)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:954)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1760)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:85)
at zombie.characters.CharacterTimedActions.LuaTimedActionNew.perform(LuaTimedActionNew.java:143)
at zombie.characters.IsoGameCharacter.updateInternal(IsoGameCharacter.java:10617)
at zombie.characters.IsoGameCharacter.update(IsoGameCharacter.java:10255)
at zombie.characters.IsoPlayer.updateInternal1(IsoPlayer.java:2287)
at zombie.characters.IsoPlayer.update(IsoPlayer.java:2266)
Cosmo 20 Jul @ 3:11pm 
Hey @NamelessDude77 dont know why but "Auto logging mode" when u trying to auto gather logs and u have lantern in your inventory generate errors preventing "Auto logging mode" form working. Honestly, I don't know what the connection is here, but if you can, look at the building.

`function: transferItem -- file: BodilyFunctions.lua line # 1235 | MOD: Bodily Functions (0.12.3)
function: transferItem -- file: LanternFix_actions.lua line # 221 | MOD: [B42] Lantern Fix
function: transferItem -- file: TMRadio.lua line # 1096 | MOD: True Music Radio
function: perform -- file: ISGrabItemAction.lua line # 105 | Vanilla
java.lang.RuntimeException: Object tried to call nil in transferItem
Agent 34 10 Jul @ 10:15am 
Could u do this with candles as well?
Space Donuts 4 Jul @ 4:08pm 
Do you think it is possible to add the bulb/lamp glow? sometimes i forget my lamp since it blends to the grass lol.
NamelessDude77  [author] 2 Jul @ 11:21am 
@Zergyt Are you sure you didn't forget to disable invisible cheat in debug mode? Pressing N in debug mode also toggles invisible which disables/enables sounds.
Zergyt 2 Jul @ 11:09am 
This mod breaks sounds. Any sound of walking, actions, and other things is lost.
NamelessDude77  [author] 2 Jul @ 8:03am 
@Zarigani-san good catch, these tiles could work like a placeable objects, but I think you wouldn't be able to hold them as a 3D object. Well, I think it's better than nothing, I might look into adding them as a separate mod, just need some time, coz I'm busy right now.

@RunYouCleverBoy yeah, I don't think I can change the colors of lit lanterns in your hands. I could, however, add options to change the color of placed lanterns, so you can try and match with the default color.
RunYouCleverBoy 2 Jul @ 7:16am 
hello
holding lantern and it on the floor have different light color and bright (radius)
Zarigani-san 1 Jul @ 11:49pm 
I'm not familiar with mods, but is it possible to use the images of candles on the ground that you see at campsites?
ex.Coords: (X: 1221, Y: 10549)
NamelessDude77  [author] 18 Jun @ 7:38pm 
Candle guys, I might add them if they're still not in the game when B42 reaches Stable, or before if the sprites become available in some update.
Shiro 18 Jun @ 1:11pm 
PLEASE include candles in your mod I beg you, thank you a lot for your work!
D.A.V. 17 Jun @ 5:26am 
Класс. Благодарю. Считаю это должно стать базовой функцией!
jermany (He/Him) 15 Jun @ 5:05pm 
Your thumbnail is so cozy, i love it
tender lavender 14 Jun @ 3:32pm 
yay finally thx! :cherrypie: