Project Zomboid

Project Zomboid

87 个评价
[B42] Random Power
2
2
2
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
61.970 KB
5 月 8 日 下午 4:04
5 月 22 日 上午 6:08
4 项改动说明 ( 查看 )

订阅以下载
[B42] Random Power

描述
Idea by u/Free_At_Last2

A simple mod that adds a random chance to turn the power back on for a few hours every now and then.

Note that this mod is low priority for me. I will fix game breaking bugs, but new features will likely not be added for a while.

------------------------------
IMPORTANT
------------------------------
If you want to use this mod and start with electricity being off, you must do this:
1. In sandbox World options, make sure Electricity Shutoff is NOT "Instant"
2. Go to sandbox settings for "Random Power" and enable the option
"Use Instant Power Shutoff"

------------------------------
HOW IT WORKS
------------------------------
First it will check if the power has been turned off in your world, if the power has been turned off, then it will run a check every 8 in-game hours, and when this runs it has a 20% chance (can be changed in sandbox settings) to turn the power back on for 2-6 hours.

NEW: There's now a sandbox option to make it so the power turns on at night and stays on until morning, and it's guaranteed every night (from 22.00 - 06.00)

------------------------------
FAQ
------------------------------
Q: Can I add this mid-save?
A: Yes, but only if you did NOT set Electricity Shutoff to instant when you started the save.

Workshop ID: 3478240794
Mod ID: RandomPowerMod
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)