Project Zomboid

Project Zomboid

Blackouts [B41]
This topic has been locked
Joy Tomaro  [developer] 19 Apr, 2024 @ 4:18pm
Bug Reports & Compatibility (4/19/2024 Patch)
Let me know of any bugs you find related to this mod.

KNOWN BUGS:
double sound effect occasionally in multiplayer. the effect is minor
coolbags mod may still have some minor incompatibility (may have been fixed in latest patch but i'll have to test it later)
Last edited by Joy Tomaro; 19 Apr, 2024 @ 4:23pm
< >
Showing 1-15 of 32 comments
apple 22 Apr, 2024 @ 5:09am 
Since the latest update to "fix" gas pumps and assorted appliances still working during a blackout, i'm having some issues in a modpack (the sophie collection) that includes Restore Utilities.

With power restored, which to my understanding just increases the various shut off dates by X amount, we are unable to use gas pumps/etc.

if we put a generator down, we are able to use them as normal.
I have verified that power is not being cut by Blackouts (with the debug command) and i've forced both ShutOffs and Restores, but the state remains the same - lights/etc have power, but some appliances don;t.

It feels like it must be related to the latest update here but i'm having real trouble nailing it down - any ideas?
Burryaga  [developer] 22 Apr, 2024 @ 5:04pm 
Can you use debug console to fire print(SandboxVars.ElecShutModifier) and tell me what it says? Would be nice to know both clientside and serverside. Sounds like a possible conflict with Restore Utilities. This mod should restore your ElecShutModifier when blackout ends as well as revert the only other variable it impacts, the hydro power setting that it has always toggled. I am suspicious that a conflict with Restore Power broke the loop and is preventing variable from correctly reverting.
Burryaga  [developer] 22 Apr, 2024 @ 5:08pm 
If I'm right you may find that using the override setting can fix that, because it should force override the ElecShutModifier back to a functional default (non-blackout) state.
Burryaga  [developer] 22 Apr, 2024 @ 5:11pm 
I will give some thought to what could be done to prevent that from happening if your feedback confirms my suspicion.
Burryaga  [developer] 22 Apr, 2024 @ 5:31pm 
You could also likely use the override temporarily as a tool to reset the ElecShutModifier state to your intended server setting. This should fix it serverside, rather than just clientside as if you tried resetting that variable with the debug console.
Last edited by Burryaga; 22 Apr, 2024 @ 6:02pm
Burryaga  [developer] 22 Apr, 2024 @ 6:17pm 
I just pulled the code for Restore Utilities and it has several mechanisms for syncing ElecShutModifier that superficially appear prone to conflict with our effort to control that variable during and after blackouts. I will give some thought to making the mods compatible, since I'm sure it's a popular combination.
apple 23 Apr, 2024 @ 1:41am 
Thanks for these replies.
The server is currently on day 134, with Restore Utilities having "restored" power until around day 172, I think.

If i print ElecShutModifier however, i get back day 96. This would explain why some things think we don't have power, since we're way beyond that point.

The dev console on server then reports that ElecShutModifier is (correctly) set to 172.

I'm not sure how the override is supposed to work - I have tried setting it to 172 and reloading the lua but it seems to reset to 0 and do nothing.
apple 23 Apr, 2024 @ 1:47am 
oop! I tried the override again - set it to 172 and instead of restarting the server used the `/reloadlua` command. This seems to have worked (temporarily??) - I can now use a gas pump without the generator being on, with power "restored" since our ShutOffModifier is day 172.
apple 23 Apr, 2024 @ 1:57am 
That doesn't seem to persist if the server reboots but I think i'm fine with doing it until we know what's going on/there's a better fix. Thanks a tonne for the pointers - and great work on the mod.
Burryaga  [developer] 23 Apr, 2024 @ 3:17am 
I'm glad there's a workaround for now. As soon as I have time, I will find a way to make sure Restore Utilities and this mod don't bork each other. I probably just need to play with them together a bit and review their code.
Burryaga  [developer] 23 Apr, 2024 @ 5:42pm 
Updates on this: Restore Utilities has a fairly complex procedure for continuously adjusting the shutoff date based on a variety of factors and then syncing its own decision about shutoff date across the clients. The decisions that it is making about shutoff dates are preventing our mod from restoring the shutoff date to the value you have set in your sandbox. Every time someone repairs power or water in certain ways, Restore Utilities tells the server to recreate a new copy of your sandbox options and transmits the entire updated sandbox options to itself (which sounds weird to me, but that's what the code appears to do): it activates "newSandbox:sendToServer()" from within the server folder during a command that presumably runs on the server. This is not necessary for modifying sandbox options from our testing. Perhaps it is done to ensure sandbox options stay updated if a server crashes; I'm not sure.

The (probably excessively) complex process employed by Restore Utilities also prevents other sandbox-settings related mods from working, such as Sandbox Settings Sync Fix by UdderlyEvelyn and Daikon.

I am still trying to work around it, but I wanted people to understand why this is an issue in the first place. Blackouts works fine in its current form by itself, but when other mods completely recreate and resync sandbox options and especially the ElecShutModifier is repeatedly modified by another mod in unpredictable ways, this is likely to result in conflicts of interest between such mods. I will try to think of a way to ensure that the ElecShutModifier value required for this mod to behave as expected is restored properly in spite of any other mods that change it, but given all the different times in the flow of the game's execution where a mod could change ElecShutModifier in a way that impacts this one, we will never be able to fully guarantee this mod's behaviors will be unaffected by such a change.

Short-term, what I can do is ensure that when power is restored *by our mod*, it returns to the value of the override setting if that setting is being used. This should allow our mod to play more nicely with other mods that affect ElecShutModifier.

One thing I would expect not to work is restoring power manually using Restore Utilities after Blackouts has caused the blackout, because Restore Utilities adds days to the ElecShutModifier manually in a way that would not be aware of the prior value stored by Blackouts.

For those who are not essentially using multiple mods that produce blackouts in their own ways, there is no need to worry about anything in this conversation as far as we know, as it should not apply to you. This mod should safely grab your base sandbox option for ElecShutModifier and back it up for later use long before it ever triggers a blackout involving that variable, so unless another mod adjusts that variable before we do, all should be well.
Last edited by Burryaga; 23 Apr, 2024 @ 5:52pm
Burryaga  [developer] 23 Apr, 2024 @ 6:16pm 
I am currently experimenting with ways around this issue. I will publish a hotfix if I solve it before the weekend. I will wait for after the weekend if I solve it during the weekend.
apple 24 Apr, 2024 @ 5:12am 
Thanks so much for investigating - with the workaround involving the override we're sorted for a bit, but really appreciate the effort!
Burryaga  [developer] 24 Apr, 2024 @ 5:42am 
I think I may have a working approach but I need to test further before I upload it. Will keep y'all updated and this thread will remain open for people's information until I have some optimism that the issue may be resolved.
apple 25 Apr, 2024 @ 6:47am 
With the latest update (and acknowledgment of the incompat) this issue appears to have sorted itself on our server. I've set the override back to 0 and all the things we couldn't use (computers, gas pumps, etc) now work as I'd expect, with power restored via Restore Utilities & no blackout in effect.

I've also done some testing with manual blackout triggering and black restore triggering and the power continues to behave as expected, so all looks good to me!
< >
Showing 1-15 of 32 comments
Per page: 1530 50