Page 1 of 1

expose autosave interval

Posted: Sat Apr 22, 2023 2:09 pm
by hoylemd
Hi folks!

I'm attempting to implement a simple 'autosave warning' mod (asked some stuff about it here viewtopic.php?f=25&t=105968), and the only thing preventing me from making it fully integrated is accessing the native autosave interval option. If that could be exposed in the modding API, then it'd eliminate the need for the user to set the autosave interval in 2 places (once in native settings and again in mod settings).

If it can be made read-only, that'd be fine for my purposes, but I know there are a couple of other mods that introduce new autosave functionality, but in order for them to work the user needs to manually set the native autosave interval to 'never'. So if there were a way for a mod to set it (or even just disable it) that'd probably be appreciated by those other mod authors.

Thanks for considering it!

Re: expose autosave interval

Posted: Mon Apr 24, 2023 6:44 pm
by hoylemd
I've published an initial verson of my mod here, just for context: https://mods.factorio.com/mod/autosave-alert

Re: expose autosave interval

Posted: Tue Apr 25, 2023 1:15 pm
by Theis
https://lua-api.factorio.com/latest/Lua ... ve_enabled is read/write.
So couldn't you just disable it while your mod is active?
Effectively forcing the user of your mod to use your custom timer.

Re: expose autosave interval

Posted: Sun Apr 30, 2023 4:57 pm
by hoylemd
Oh, cool, I must have missed that when I was browsing the documentation. Thanks for pointing that out!

Overriding the native autosave functionality would work for what I want to do, but my preference would be for my mod to be subordinate to the existing functionality instead of replacing it. i.e. so a user could just install it and never have to touch mod settings if they don't have to. If I have it override, then a user would still need to adjust the mod's autosave interval if they were using one that wasn't the default. But on the other hand, if I did commit to more of a replacement autosave system I could offer much more customizability (kind of like https://mods.factorio.com/mod/ixuAutoSave)

I'll give it a think. It's my first mod so I wanted to keep my ambitions low to start with :p