Project Zomboid

Project Zomboid

[BROKEN] Improved Generator Longevity
dtoxic 8 Nov, 2022 @ 10:52am
Repair past 100%
Allow repair of generator past 100% if more then 100% is selected in sandbox.

The "Fix Generator" code is found i believe in ISFixGenerator.lua

i am doing some test,will post a solution if i manage to find it
Last edited by dtoxic; 8 Nov, 2022 @ 10:55am
< >
Showing 1-9 of 9 comments
GenChadT  [developer] 5 Dec, 2022 @ 6:33pm 
Thanks @dtoxic. I will credit you if you're able to find a solution
dtoxic 6 Dec, 2022 @ 1:15am 
I could not find a viable solution to this,i tried everything i could think,but my coding skills are not that good,i think that fixing generator is somehow hard coded into the game,i could not manage to make it work,i have some other things i want to try,will let you know how it goes
GenChadT  [developer] 27 Dec, 2022 @ 9:33pm 
@dtoxic sounds good my code is FOSS so feel free to use it if you find a solution
GenChadT  [developer] 25 Jan, 2023 @ 6:49am 
@dtoxic I was working on a rewrite of several vanilla functions but mod devs on the Discord have informed me that 100 condition is a hard limit set in the untouchable Java code of the game. Unless either of us can come up with a workaround it looks like we're stuck waiting on the devs to update things.
GenChadT  [developer] 25 Jan, 2023 @ 6:55am 
I had to rewrite IsFixGenerator and a few other Lua methods including some that govern the context menu as they all did a check for < 100 condition. Even though I could get the repair function to appear in the menu, as soon as I tried to use it, it would revert the generator back to 100 :/
dtoxic 25 Jan, 2023 @ 12:48pm 
yeap,same with me...was banging my head to find a solution but nothing would take,my initial thought that it was somehow hardcoded proved to be correct....well guess it's waiting time till/if this is addressed...anyway thx for looking into it
Angry 25 Jan, 2023 @ 2:31pm 
Is it possible to increase the time it takes for the generator to lose 1% of it's condition? So the generator max condition would always be 100% and the sandbox option, instead of increasing generator condition past 100%, would actually increase the time it takes for the generator to degrade by 1%, thus bypassing the generator hard limit.
dtoxic 26 Jan, 2023 @ 1:29am 
i think that is tied to "time" so if you can could you check the following,start a sandbox game with time 1h = 1d and then try say 8h = 1d note the date at witch you start the generator and keep it running till it drops say 20% then do the same but with different time scale ,i wont be near my gaming pc for a couple of days so i cant check it for the time being,post your findings here
Last edited by dtoxic; 26 Jan, 2023 @ 1:29am
DragonKing 16 Jul, 2023 @ 3:34am 
Hmm, not sure if this would work, but here goes.

One dumb way I can think working around the 100% limit (1% loss an hour) problem, would be to keep a reference of connected generators and add 1% condition every x.x hours or whatever metric you want to use, to counteract the "loss" if you will. I assume that in theory, it would be a hacky way of implementing a "condition loss override" adjustment so that generators degrade slower.

In theory, if you set it to recover 1% every 2.0 hours, the generator would last about 2x as long, depending on how the timer would work. Ideally each generator would have its own condition managed as an instance, and the timer would be retained between loading a game/server world, but even a global timer should do well enough, as long as the timer is tracked and does not reset.

The closer to 1.0 you go, the longer the generator would last before needing repairs. if it were set to 100.0 hours, it would in effect disable any modification, though I don't see much point in allowing extreme values, then just disable the mod at that point xD

Main issue with that approach is how significant even a small change in values will have on the effect with this approach, making it a bit hard to estimate how long a generator will actually last.
Last edited by DragonKing; 16 Jul, 2023 @ 3:36am
< >
Showing 1-9 of 9 comments
Per page: 1530 50