Access autosave settings?
Posted: Sat Aug 23, 2025 4:23 pm
Hi factorio modding folks!
A few years ago I made a little mod called autosave-alert (https://mods.factorio.com/mod/autosave-alert). I'm looking at updating it for 2.0, and was hoping the modding API might allow it to be a little better integrated. Right now, the user has to input their autosave interval setting separately in the mod's settings, and there no guarantee that will actually stay synchronized with the game's actual autosave time (since mods that let the game pause can cause it to get out of sync)
What I'm hoping is for a way to access the actual autosave interval setting from the game, so the player doesn't have to input it separately for the mod. Is there a way to access that setting from a mod? I see there's an autosave_enabled setting available (https://lua-api.factorio.com/latest/cla ... ve_enabled).
The other thing I wanted to try to fix was that some other mods allow the game to be paused, so the tick clock doesn't advance. but whatever click the autosave feature uses seems to be separate from that. Right now, my mod uses `on_nth_tick` to schedule the warning messages, I'm wondering if there's some way to get the wall clock time of the map, separate from ticks so that mod-pausing doesn't desync the warnings.
Any suggestions would be helpful! The main objective is to get the mod to provide warnings shortly before autosave (kind of like how satisfactory does) in as convenient a way as possible, so if my overall approach is flawed, I'd love to hear alternatives.
Thanks!
A few years ago I made a little mod called autosave-alert (https://mods.factorio.com/mod/autosave-alert). I'm looking at updating it for 2.0, and was hoping the modding API might allow it to be a little better integrated. Right now, the user has to input their autosave interval setting separately in the mod's settings, and there no guarantee that will actually stay synchronized with the game's actual autosave time (since mods that let the game pause can cause it to get out of sync)
What I'm hoping is for a way to access the actual autosave interval setting from the game, so the player doesn't have to input it separately for the mod. Is there a way to access that setting from a mod? I see there's an autosave_enabled setting available (https://lua-api.factorio.com/latest/cla ... ve_enabled).
The other thing I wanted to try to fix was that some other mods allow the game to be paused, so the tick clock doesn't advance. but whatever click the autosave feature uses seems to be separate from that. Right now, my mod uses `on_nth_tick` to schedule the warning messages, I'm wondering if there's some way to get the wall clock time of the map, separate from ticks so that mod-pausing doesn't desync the warnings.
Any suggestions would be helpful! The main objective is to get the mod to provide warnings shortly before autosave (kind of like how satisfactory does) in as convenient a way as possible, so if my overall approach is flawed, I'd love to hear alternatives.
Thanks!