Project Zomboid

Project Zomboid

[B42] Random Power
41 Comments
UsatoAsashi 27 Jul @ 4:35am 
after adding into mid-save, my world has power all the time
Pokemastuh 8 Jul @ 5:42pm 
Hello.

By any chance would this still work with build 41?

Thank you.
seronis 1 Jul @ 9:03am 
New to PZ in general so I dont know everything the base game has. Does there happen to be some kind of energy storage system you can build that will store power while its on (or while a generator runs) and provide that power like a generator while the grid is down? I think it would be interesting for someone to slowly build up energy storage capacity to take advantage when not in middle of a brown out
RedChili  [author] 18 Jun @ 4:45am 
@Timou I can look into it and see if it's just as easy. But I'm not sure how noticeable it would be that the water is back on. With the electricity you can see lights and devices turn on, but water will have to be checked manually.

@ditoseadio Thank you, glad you like it! The only setting you should be mindful of is the Electricity Shutoff and NOT set it to instant, because then the mod will not work. It will wait until the power is turned off before the mod activates, so you can set it to 0-30 days, 6 months, or any other time.

I will look into adding more options for controlling the intervals and stuff, it's just that this mod is not very high priority for me, but it seems a lot of people like the idea of it so I can see if it's quick to add more options.
ditoseadio 11 Jun @ 4:44pm 
Hi, congratulations on this mod—I love it!

I have a question: if I adjust the power settings in the sandbox options, what happens with the in-game setting under the mod tab?

Also, could you include the option to manually adjust how often it checks and how long the power can last? That would be awesome.
Timou 23 May @ 10:39pm 
Can you make the same for water?
RedChili  [author] 22 May @ 6:11am 
Okay the patch is released, it should fix the issues with power not turning back on, on old and new saves. It also fixes so you don't have to quit and load when power turns off to activate the mod, it will detect it by itself now.

I'm migrating the options from mod options to sandbox, it will make the mod compatible when multiplayer is released.

Also added a new option for turning lights on at night and keeping them on until morning
RedChili  [author] 22 May @ 4:17am 
Gonna release a small patch today that should fix the issues with power not turning back off.
I also found why it doesn't work when you set power turn-off to instant, because when you do it literally just does not create a power-grid in the world, so my function to turn power back on just does not do anything.
I will add a sandbox option where you can enable instant shut-off and still use my mod.
RedChili  [author] 20 May @ 4:59am 
So the latest B42.8 patch actually dropped a bunch of new functions for power grid management. I might actually look into making a full on mod where you can restore power to specific areas and stuff like that.
Hawk! 17 May @ 5:23pm 
maybe it has something to do with my day time length? I have days set to last 2 hours or irl time instead of the default one hour of irl time, also when checking in debug mode the electrical shut off was set to its max amount of days possible, unless your mod does that as a way to be able to have power go on n off over time
Hawk! 17 May @ 5:20pm 
ye it was like the first time the mod turned the power back on, it was on for like 12hours , when i quit out and went back to the save a day or so later the power just seemed to stay on, like a day or two later it still hadn't went off again
RedChili  [author] 17 May @ 5:16pm 
@Hawk! Oh okay, that's weird. I'll take a look and add a fallback in-case the initial check fails
Hawk! 17 May @ 5:00pm 
Nope my save was not set to instant, it was the default 0- 30 days, but when i added the mod to the save the power was already off as its beyond the first month
RedChili  [author] 17 May @ 3:53pm 
Ah wait, actually, are you on a save where you have the sandbox power shutoff setting set to instant? If so, that's probably why. I'll make a fix for it real quick
RedChili  [author] 17 May @ 3:51pm 
@Hawk! Hmm that's weird, it should be running a check continuously when loading the game and the world power has been off. I'll look into it
Hawk! 17 May @ 1:46pm 
Ye power still not went off had to debug mode to turn it back off
Hawk! 15 May @ 7:41pm 
So the power turned back on for me after having the mod running for a little while, but it hasn't went back off yet and its been like almost 2 full days, is there a chance of a bug where it stays on or resets the 0-30day timer on power if you close out of the game with the power back on from this mod? Or has something like the 20% chance to turn it on proc'd while it was on multiple times and just extended the duration?
Siete87 15 May @ 3:28pm 
now it does appear!
RedChili  [author] 14 May @ 2:48pm 
@Siete87 If you have subscribed to the mod and you are on B42 then it should show in the mod list. Did you try searching for it?
Siete87 14 May @ 2:45pm 
It does not appear in the mod list so how could I be able to activate it?
RedChili  [author] 14 May @ 6:36am 
@Cyrisa No right now there's just a setting for how likely the power is to be turned on every 8 hours. When I have time I can add some more options. If the power is turned off by another mod by just setting the world power to off without touching the sandbox settings, then my mod will still try to turn it on/off.

@AJ It would be cool, and should be doable, but it's too much work for me atm

@Ryan I have no idea, I haven't tested this mod much. You could try and see what happens
Ryan 13 May @ 10:11pm 
Compatible with black out mod?
AJ 12 May @ 11:05pm 
to add on, if you made something like save our station but for the electricity and water, that would be really cool. I know you said you have other projects, but its something to consider if this is possible at all.
Cyrisa 11 May @ 8:13pm 
Are there sandbox options to customize how long power stays on and how long this feature plays out or if forever?

Will this stop randomly turning power on/off if power is turned on again by another mod?
RedChili  [author] 10 May @ 4:07am 
@Brindav Oh wait yeah I know what it is, I'll fix it
Brindav 9 May @ 2:43pm 
ok managed to make it work by launching a game where power is set to off at 14 days, while spawning a month later, seemingly the mod just doesn't work when power is set to be immediately off, not a big deal but might warrant a warning if i'm not mistaken.
RedChili  [author] 9 May @ 2:07pm 
@Brindav I used 0-30 days.
You'll be able to see if it works if you load a game, save and exit, then open C:\Users\YourUsername\Zomboid\console.txt and search for "Adding OnTicks for Random Power"
If that shows in the console log then it should be working. If you search for "Won't add ticks" and it's found, then it's not working.

I can run some more tests tomorrow and see if I can reproduce and fix the issue
Brindav 9 May @ 1:49pm 
it doesn't seem to work, be it old save or new, even after reloading and waiting some days, might be my settings, which ones did you use to make it work ?
RedChili  [author] 9 May @ 1:34pm 
@Brindav If it's a new save, try just quitting to main menu and then load it back.
It's possible that I have to add some check, but from what I remember it should already work when starting with no power.

@morgash1989 It would be fun to make a mod like that, but I have so many other ones I'm working on already, I just did this one quickly because it was requested
Brindav 9 May @ 1:28pm 
On my side the new update has broken the system on vanilla, (at the very least when starting with no power) the power doesn't come back up even with 90% so either i'm insanely unlucky or it's go a bug.
Brindav 9 May @ 1:13pm 
@Chamait You could just remove the mod i think it wouldn't affect anything.
morgash1989 9 May @ 1:11pm 
The best if you could do it, would be to have to make some repairs on the electrical sites to restore it for some time instead of just random
Chamait 9 May @ 1:04pm 
is there a option to turn off the power permanently? after a couple days?
RedChili  [author] 9 May @ 4:04am 
@p6kocka Yes it will work, it checks the sandbox settings to see if power should be shut off naturally, and if it should, then it adds the rest of the mod functions that turns power on and off.

I pushed one more patch just now, I made a mistake that would turn power off immediately in a new world
p6kocka 9 May @ 3:56am 
Will this mod work even when starting the game after 12 months (vanilla sandbox settings)?
RedChili  [author] 9 May @ 3:49am 
Pushed an update that changes how it turns it on and off that should make it bulletproof.
Let me know if it's still having issues!
RedChili  [author] 9 May @ 2:33am 
@Brindav Hello! That's very odd, it was working well when I was fast forwarding during testing. But I was standing still in a house, so maybe if there's a cell/chunk update at the same time as the power is supposed to go down, then it just stays on?
I'll add an additional check to try and catch those
Brindav 9 May @ 1:01am 
so i've tried with no other mods and it seems like the power still doesnt go down, at least when starting with the power cut off, the power does randomly comes back online every so often but after that it will play the sound of it stopping without it having any effect on the switches/streetlights. Hope this can help.
Brindav 9 May @ 12:46am 
so i'm that guy on reddit and once again thank you ! i've tried it and seemingly the power does get back up and the mod options do work (put it to 80, then 10 and it did change the frequency of the power surges) but unless i have another mod tampering with power which i do no think i have, the power seems to never go down after the first time the power came back, ie : start with no power, power gets back at random, 2-6 hours later i hear the loud sound inducing power should stop yet the lights still work. i'll try without any other mods for more input.
Quilava 9 May @ 12:42am 
I love the idea, when the city go dark for many day, then suddenly it lit up one night, you have to act fast, go in and get what you can before it go dark again :cta_emo7:
thatonewh_recoldy 8 May @ 5:27pm 
Really cool concept! will def use perm in my world.