Get autosave settings?
Posted: Thu Apr 20, 2023 6:43 pm
Hi folks,
(actual question underlined if you want to skip the context)
I have an idea for a small mod I want to implement: an autosave warning system. I like the autosave system, but it often happens at an inopportune time. One thing I like about Satisfactory is that it gives you a bit of a warning when autosave is about to happen, and I found that really helpful to avoid being annoyed by the sudden pause.
My ideal dreamland concept would be a mod you install and it all just works - it knows the current interval, and knows the time since the last autosave, and can therefore accurately compute when the next one will happen, and give you a 1 minute, 30s, 10s, 5,4,3,2,1 countdown (for example, maybe even configurable). But I don't expect that will be completely possible.
So my MVP would be for it to be entirely manually configured: Basically theres a ui (maybe in mod settings?) where you input how often you want the warnings (and what warnings you want), and it's up to the player to ensure that matches up with their actual autosave settings. Then the actual warning timing can be based on `game.tick`. I'll Probably implement that soon.
Which brings me to my actual question. Once I have the MVP done, I'd like to automate it! Is there any way to get the autosave interval of the current map? I looked through the docs and I couldnt find an obvious way to get it, but I might have just missed it.
I also realize this wouldn't really work based on `game.tick` alone if the autosave interval changes (unless autosave is implemented in a strict `game.autosave when game.tick % interval == 0` way, but I'm going to assume I'm not that lucky ) . If there's *also* a way to determine the tick of the most recent autosave, that'd pretty much solve it all, but again, not going to get my hopes up. I did see that I could just override the entire autosave system, https://mods.factorio.com/mod/ixuAutoSave (which would make this all trivial), but I want to avoid that if I can.
(actual question underlined if you want to skip the context)
I have an idea for a small mod I want to implement: an autosave warning system. I like the autosave system, but it often happens at an inopportune time. One thing I like about Satisfactory is that it gives you a bit of a warning when autosave is about to happen, and I found that really helpful to avoid being annoyed by the sudden pause.
My ideal dreamland concept would be a mod you install and it all just works - it knows the current interval, and knows the time since the last autosave, and can therefore accurately compute when the next one will happen, and give you a 1 minute, 30s, 10s, 5,4,3,2,1 countdown (for example, maybe even configurable). But I don't expect that will be completely possible.
So my MVP would be for it to be entirely manually configured: Basically theres a ui (maybe in mod settings?) where you input how often you want the warnings (and what warnings you want), and it's up to the player to ensure that matches up with their actual autosave settings. Then the actual warning timing can be based on `game.tick`. I'll Probably implement that soon.
Which brings me to my actual question. Once I have the MVP done, I'd like to automate it! Is there any way to get the autosave interval of the current map? I looked through the docs and I couldnt find an obvious way to get it, but I might have just missed it.
I also realize this wouldn't really work based on `game.tick` alone if the autosave interval changes (unless autosave is implemented in a strict `game.autosave when game.tick % interval == 0` way, but I'm going to assume I'm not that lucky ) . If there's *also* a way to determine the tick of the most recent autosave, that'd pretty much solve it all, but again, not going to get my hopes up. I did see that I could just override the entire autosave system, https://mods.factorio.com/mod/ixuAutoSave (which would make this all trivial), but I want to avoid that if I can.