Project Zomboid

Project Zomboid

[B42] Random Power
58 条留言
モン000スター 12 月 12 日 下午 10:53 
no longer works please update
モン000スター 12 月 11 日 下午 4:27 
anyone test this in b42 MP?
mac.edgar 12 月 4 日 上午 11:36 
HI, I think the probability slider on the mod options is not working. No matter the number i set, even at 1%, the power comes back almost every day.
mac.edgar 12 月 2 日 下午 7:38 
Amazing idea
Afyrmo 11 月 13 日 下午 3:16 
Hi, thanks a lot for this mod, it adds a really cool layer of uncertainty to the power shutoff.

While looking at the code I noticed that migrateOldModOptions() forces the sandbox options RandomPower.OnAtNight and RandomPower.InstantPowerShutoff to false the first time a save is loaded (even if they were set differently), but after that they stay as configured in the sandbox for future sessions. I thought it might be useful to mention this in the description or adjust the behavior if that wasn’t intended.

Also, if you ever want RandomPowerChance to correspond exactly to a probability of chance / 100, you could use something like local turnOnRoll = ZombRand(100); if turnOnRoll < chance then ... end, so there are 100 equiprobable outcomes and exactly chance of them are successes.

Thanks again for your work on this mod!
RedChili  [作者] 11 月 10 日 上午 8:36 
@KemonoAmigo There should already be a sound cue, the vanilla game has it, but I haven't tested it in a while so maybe something changed. I'll add some custom solution to make sure it always give off a sound.

@Bonnie Boestar I'll add that option in a patch soon

@Kaoeutsu It's an interesting mechanic, and would be doable. I will add it if I have time
Kaoeutsu 11 月 10 日 上午 4:06 
how about blackouts near the day the energy is cut off that get more frequent the closer to the day the energy is cut off?
Bonnie Boestar 10 月 30 日 下午 4:59 
Seems like a great mod, the only thing really missing is an option to limit the amount of time power can come back on. It would realistically only come back on a few times before shutting off for good.
KemonoAmigo 10 月 29 日 下午 4:01 
I added a getPlayer():Say("Power is back") to RandomPower.turnOnPower(). I think adding this or a sound cue to this function in a future update would be helpful.
RedChili  [作者] 10 月 18 日 上午 12:57 
@Torek Seems quite a few people want a setting like that, and it's definitely doable so I'll add that when I have some time (should be in the next day or two)
Torek 10 月 17 日 上午 10:50 
this seems spectacular mod for an intemediate phase between the complete shutdown.
Is it posible to have this work only when the power is shut down but only for 1/2 weeks?
TheyCallMeVincenzo 9 月 12 日 上午 4:21 
Could you make a mod where life and living and PAWStv come on every so often? Random broadcasts?
Sexta-feira 8 月 26 日 上午 7:13 
can you add a sound cue for when the power is turned on?
Kaoeutsu 8 月 13 日 上午 7:32 
you know what would be really cool? blackouts, you could make so near the date the power gets cut off random blackouts start happening for a few hours, that would be really immersive and cool!
SoBaKa-UbIvAkA))) 8 月 9 日 下午 5:20 
I wish there was an option for power to shut off several times before it never turns off again, like in Fear the walking dead TV series, but longer. As I understand, now it has chance to turn on even after months have passed
aldairg 8 月 6 日 下午 8:52 
B41? 🥺
jaquerossetto 8 月 6 日 上午 5:49 
This is really cool!
It's so damn creepy when its all quiet during the night and suddenly the lights turn back and all the tvs are on max volume xD

One idea I had if you ever feel like adding more stuff: the option to set a timer to completely turn off eletricity, so on a long playthrough you have 100% energy at the start, then the randoms on and off and then one day it never turns back on again.
UsatoAsashi 7 月 27 日 上午 4:35 
after adding into mid-save, my world has power all the time
Pokemastuh 7 月 8 日 下午 5:42 
Hello.

By any chance would this still work with build 41?

Thank you.
seronis 7 月 1 日 上午 9:03 
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  [作者] 6 月 18 日 上午 4:45 
@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 6 月 11 日 下午 4:44 
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 5 月 23 日 下午 10:39 
Can you make the same for water?
RedChili  [作者] 5 月 22 日 上午 6:11 
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  [作者] 5 月 22 日 上午 4:17 
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  [作者] 5 月 20 日 上午 4:59 
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! 5 月 17 日 下午 5:23 
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! 5 月 17 日 下午 5:20 
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  [作者] 5 月 17 日 下午 5:16 
@Hawk! Oh okay, that's weird. I'll take a look and add a fallback in-case the initial check fails
Hawk! 5 月 17 日 下午 5:00 
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  [作者] 5 月 17 日 下午 3:53 
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  [作者] 5 月 17 日 下午 3:51 
@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! 5 月 17 日 下午 1:46 
Ye power still not went off had to debug mode to turn it back off
Hawk! 5 月 15 日 下午 7:41 
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 5 月 15 日 下午 3:28 
now it does appear!
RedChili  [作者] 5 月 14 日 下午 2:48 
@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 5 月 14 日 下午 2:45 
It does not appear in the mod list so how could I be able to activate it?
RedChili  [作者] 5 月 14 日 上午 6:36 
@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 5 月 13 日 下午 10:11 
Compatible with black out mod?
AJ 5 月 12 日 下午 11:05 
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 5 月 11 日 下午 8:13 
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  [作者] 5 月 10 日 上午 4:07 
@Brindav Oh wait yeah I know what it is, I'll fix it
Brindav 5 月 9 日 下午 2:43 
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  [作者] 5 月 9 日 下午 2:07 
@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 5 月 9 日 下午 1:49 
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  [作者] 5 月 9 日 下午 1:34 
@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 5 月 9 日 下午 1:28 
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 5 月 9 日 下午 1:13 
@Chamait You could just remove the mod i think it wouldn't affect anything.
morgash1989 5 月 9 日 下午 1:11 
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 5 月 9 日 下午 1:04 
is there a option to turn off the power permanently? after a couple days?