Project Zomboid

Project Zomboid

[BROKEN] Improved Generator Longevity
52 Comments
Laires 3 Jan @ 2:44am 
@Aparajita Yes in sandbox there is option to change the condition, idk what admin panel is. I know the mod doesn't affect predetermined generator spawn locations, which are only a few, but the randomly spawned ones do spawn with the condition set in Sandbox which you can modify mid-playthrough with a mod that allows for that. But it will only change generators that haven't spawned yet so you will have to enter a new area to see them. I didn't have issues making this mod work even with hundreds of other mods while playing B41. There were some inconsistencies and some generators reset to 0% condition after updating modlist, but all in all I regret nothing. In the worst case you will end up with regular 100% condition generators you'd have without the mod so there is no risk to it as far as I'm concerned.
GenChadT  [author] 1 Jan @ 5:52pm 
@Aparajita This mod is deprecated and its highly likely it doesn't work anymore. I only left it up for MP servers that installed it and don't want to corrupt their saves.
Aparajita 20 Dec, 2024 @ 11:56am 
Laires, I'd like to use the mod, too, but I do not see the ability to change anything in the admin panel. Is it only changeable via editing the SandboxVars?
Laires 21 Apr, 2024 @ 1:59am 
Love this mod to bits. The only reason I still play the game and try long playthroughs is thanks to this mod. Set condition to 9999, fuel consumption to 0 and generator spawn rate to Extremely Rare. Now every generator you come across will be useful. No more are they just reactive on/off switch for gas stations. Now you can proactively power street lights anywhere, plop down 4 gens and power the entirety of a school and turn that into your base, because now you can base in large buildings and cover their entirety with electricity! Pairs extremely well with mods that make it tougher to generate food, to find food, to find water and in combination with Madhouse Repairs for fortification HP and Horde Night for putting them to the test this is how I enjoy playing the game and it would simply not be possible without this one mod tying it all together. Thank you GenChadT. :)
Ovaxius 5 Feb, 2023 @ 9:58am 
lol would do however i'm a little rusty on the programming however it's a idea if you can't get it past 200%
GenChadT  [author] 5 Feb, 2023 @ 9:51am 
@Ovaxius possibly. Rewriting vanilla methods is a bit out of my wheelhouse so feel free to go for it if you have the kills.
Ovaxius 5 Feb, 2023 @ 9:48am 
wouldn't it be easier to set the degrading rate to 50 to 25 percent? it might not be 200% but the slower degrading rate would act as if it was 200%
kERHUS 4 Feb, 2023 @ 11:21am 
GenChadT  [author] 27 Dec, 2022 @ 9:34pm 
@zee It's designed to be used only on new saves but others have commented it's worked afterwards? So YMMV
WolfChen 24 Dec, 2022 @ 3:38pm 
@zee not sure, it says that it only works with new saves.
zee 5 Dec, 2022 @ 2:46pm 
Is it safe to add mid game?
Tofuman 17 Nov, 2022 @ 8:08am 
Alright thanks!
GenChadT  [author] 17 Nov, 2022 @ 6:45am 
@Tofuman Should be fine.
Tofuman 17 Nov, 2022 @ 3:26am 
Pardon me for asking, is this safe to remove mid game? Cheers
GenChadT  [author] 12 Oct, 2022 @ 9:39pm 
@UdderlyEvelyn Thanks for the tip. My coding skills aren't top notch, I'm unsure of how to do this :p
UdderlyEvelyn 8 Oct, 2022 @ 1:15pm 
Should mod the repair function to allow you to repair the generator to whatever your max condition setting is - currently while you can find a generator that goes to, e.g., 1000% you can never repair it past 100%.
GenChadT  [author] 28 Aug, 2022 @ 8:25am 
@Ankha What you can do for now is edit the generator fuel burn settings in your Sandbox options - instead of the vanilla value of "1", try to set it to something like "0.25" and that will slow fuel depletion speed by 75%
GenChadT  [author] 28 Aug, 2022 @ 8:24am 
@Ankha I've looked into it but unfortunately fuel level/capacity seems to be baked into generator function and isn't editable, whereas the "ConditionMax" is an item value that my mod simply changes.

I've been looking into developing an "Admin Generator" which resets its fuel value and condition whenever the cell its in is loaded for use at server community bases, etc. but have no ETA on it being finished.
Hello! Can you add a setting for the maximum amount of fuel in the generator? So that you can immediately fill in 100 liters and forget about refueling the generator for the next couple of months.
GenChadT  [author] 29 Jul, 2022 @ 8:04am 
@Thee'e Vang Oh I know, that was intentional. It'll probably go up again once I find out how far you can push these things! :)
Elden Ring 2 when? 28 Jul, 2022 @ 12:19pm 
You actually changed it to 9999% as the max when you added compatibility for the steam powered generator. Which I'm fine with honestly lol
Elden Ring 2 when? 27 Jul, 2022 @ 12:11pm 
@CoronaBunny only newly spawned generators will reflect the new changes which requires a new game world unless spawned in by an admin
GenChadT  [author] 27 Jul, 2022 @ 10:07am 
This mod is VERY simple, 18 lines of code, so there's virtually no room for it to conflict with other mods.
GenChadT  [author] 27 Jul, 2022 @ 10:04am 
@CoronaBunny It's not a mod conflict, it just apparently doesn't work on old saves. It works on our server and we have 160+ mods :)
CoronaBunny 27 Jul, 2022 @ 9:49am 
Oh well, all right then, I'll do that then. You always do die in Zomboid, after all...

Well, I'm running several mods, including the Brita set, and the Apex pack. So perhaps something there disagrees. Perhaps someone else had better luck.

Anyhoo, thanks for the mod.
GenChadT  [author] 27 Jul, 2022 @ 9:39am 
@CoronaBunny I was under the impression that generators in newly initialized areas would spawn with the correct settings, but perhaps not. The description will be updated to reflect that. When you get around to creating a new save it will update those generators.
CoronaBunny 27 Jul, 2022 @ 1:23am 
Is there a way to force this to trigger in an old-save game? Or does "best used with" mean "only use with"?

I'm using "Change Sandbox Options 2" (2829504578), BTW.

I've travelled to a new zone, but generators still spawn with "100%". Maybe I'm missing something?

I play casually every now and then, and really don't want to have to start a new game.
Tx.
Elden Ring 2 when? 26 Jul, 2022 @ 11:24am 
ty so much
GenChadT  [author] 25 Jul, 2022 @ 7:40pm 
@Thee'e Vang Now includes a setting for Steam Powered Generator's max condition.
GenChadT  [author] 23 Jul, 2022 @ 11:49pm 
@Thee'e Vang I can certainly try!
Elden Ring 2 when? 22 Jul, 2022 @ 11:33pm 
Can you make a patch for the steam powered generators also?
GenChadT  [author] 22 Jul, 2022 @ 9:44am 
@Thee'e Vang It only changes the properties of newly spawned generators. So this mod is best used on new saves. Editing the description now to clarify.
Elden Ring 2 when? 21 Jul, 2022 @ 10:42am 
Does this still work my generator still shows 100% or does it only work for newly spawned generators?
GenChadT  [author] 20 Jul, 2022 @ 6:17pm 
I'm just of the opinion with sandbox games that if there's a variable that can be tweaked.. it should be tweakable. I'll be fooling with generators and other items and sandbox settings in the future.
GenChadT  [author] 20 Jul, 2022 @ 6:16pm 
More than 3 freezers on average for sure, plus dozens of flood lights, etc. We usually end up in larger buildings or compounds requiring more than one generator to cover everything.
Checkered Scones 20 Jul, 2022 @ 3:50pm 
i have 200 in storage, i've survived 3 months and only repaired my generator once.
Checkered Scones 20 Jul, 2022 @ 3:50pm 
1/3 are usually the amount i run

i almost never have issues with repairing my generator because when leveling electrical, you get a lot of scrap from dismantling digital watches
Checkered Scones 20 Jul, 2022 @ 3:49pm 
how many freezers do you usually have running?
GenChadT  [author] 20 Jul, 2022 @ 2:59pm 
Until generator mechanics are updated to be a little more dynamic, much of our playerbase has determined generator maintenance/refueling to be little more than an annoying task that requires them to login at odd times. So anything we did to increase the length of time between refueling/repairing, however long of a period of time that may seem to others, was a net benefit.

Thought maybe other server owners/players might enjoy control over these variables and so it was made publicly available.
GenChadT  [author] 20 Jul, 2022 @ 2:52pm 
@Checkered Scones I am aware of the repair/refuel mechanics of the generators ingame. There are many different play styles within PZ, for whom this mod caters. On our slower-paced PvE server, some players may go several IRL days or more without logging in and do not wish their generators to be out of fuel/broken down with rotting food all around.

Our fuel burn rate is turned down so low to compensate for this behavior, that generators were breaking down before needing to be refueled - necessitating this mod. Now you can set your fuel burn as low as you want without worrying about the generator breaking down faster.
Checkered Scones 19 Jul, 2022 @ 11:32pm 
and no, there's no repair stacking mechanic, they can be repaired forever.
Checkered Scones 19 Jul, 2022 @ 11:32pm 
you are aware that most generators run out of fuel around 15 times average before they even need to think about repairs, yeah?
Checkered Scones 19 Jul, 2022 @ 11:31pm 
this mod isn't really... necessary.

And i understand that might sound like an insult...

but you have to repair generators once every 3 months or so, and they can be repaired easily, with electrical scrap.
GenChadT  [author] 23 Jun, 2022 @ 4:00pm 
@Eagle7 (Evo) Thanks for the kind words! This mod will most likely only affect generators on new saves. If you add it mid-save, it might update newly spawned generators in unvisited cells but won't affect those in safehouses and visited areas.
Eagle7 (Evo) 23 Jun, 2022 @ 11:57am 
Cool mod! Do we need to start a new Sandbox game to incorporate this?
GenChadT  [author] 16 Jun, 2022 @ 2:56pm 
Sorry for the rapid fire updates.
Willow 4 Jun, 2022 @ 2:49am 
understandable, no worries!
GenChadT  [author] 3 Jun, 2022 @ 10:31pm 
@Willow Not taking requests unfortunately. I'm brand new to coding/modding and it took me quite a while to research how to get this working.
Willow 3 Jun, 2022 @ 11:31am 
I'm not sure if you take requests, but would you be willing to make a mod that removes the damage from using a generator indoors? Heck with realism
GenChadT  [author] 29 May, 2022 @ 6:26pm 
@Besty It only boosts the durability. You'll still need to refuel it normally based on the generator fuel burn rate you set in sandbox options.

I'm trying to rework the code to add a sandbox option for gen condition but it's proving more work than I initially expected.