Break Time


Pauses the game periodically to encourage you to get off your butt and take a break.

Utilities
8 months ago
2.0
235

b Break time never ends if you remove the mod during the break

5 months ago

So i saved during break time and then removed the mod. But the break did not end. Save was unusable after that.

5 months ago
(updated 5 months ago)

wow, ran into the same problem today and that was chilling... wouldn't want to lose the save...

I looked at the source what this mod does and got some hints; it seems when you go to the mod settings (after loading the save that's running slooooowwwww), in map tab at Break Time and change either Break interval or Break Duration, it seems to reset the time, speed up the game to the original 60FPS and everything seems to run fine... I don't completely understand why that is, but this seems to be the effect.

I just tried this and will have to find out how it behaves in the next hours and after saving, but maybe that's the workaround.

Maybe the mod should initialize the timer and speeding up to 60FPS when loading a save, doesn't seem reasonable that you're stuck in your break. I reckon that could also happen when autosaving, which would render the purpose of autosave unusable if you're stuck in the slow zone and need to restart from an autosave...


edit: mmmmh, might be tricky, though... https://forums.factorio.com/viewtopic.php?t=103250

or maybe force a save right before the break hits? that's actually what you really would want to do, if you choose to call it a day. Something like the auto save that happens when you start travelling to a planet the first time, although I don't know if a mod can trigger this or if it's hard coded into Factorio...


edit2: maybe https://lua-api.factorio.com/latest/classes/LuaGameScript.html#auto_save

so, maybe in the line before https://github.com/Identifier/FactorioMods/blob/78b37d17c1cad857823227067a55f6f4f4053a7e/BreakTime/control.lua#L52

add

game.auto_save("BreakTime_before_break")

might result in an _autosave-BreakTime_before_break save file, if I'm reading this right...

4 months ago

Yes, I can see why this would happen. The mod simply changes the game speed to a very slow value during the break time, and then sets it back to normal when the break is over. If you removed the mod in between, then nothing would ever set the game speed back to normal.

The best way to prevent this situation would be if I could detect when a save is about to happen, at which point I could briefly set the game speed to normal, let it save, and then resume the break time slow speed. But it doesn't look like there's a way to do anything during saving, since in multiplayer one person might save their game at different times than other players. https://forums.factorio.com/104337

As a workaround, if anyone gets into this situation again, simply re-enable the mod and load the save, then save it again when the speed is back to normal, and then you can safely remove the mod again.

4 months ago

Yes this is what I did. thanks for the workaround.

btw another idea would be to detect when the player summons the menu, at least in single player. And yes I think you could savely distinguish between single- and multiplayer and make it behave differently. users would undertand.

And another thing: This mod is good. It forced me to take a breake.

4 months ago

yes, I like the mod, too! I really got up in the break time and fetched a glass of water and walked a few steps! setting alarm clocks and such never worked for me. :-)

New response