expose autosave interval

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
hoylemd
Inserter
Inserter
Posts: 27
Joined: Tue Apr 17, 2018 2:14 am
Contact:

expose autosave interval

Post 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!

hoylemd
Inserter
Inserter
Posts: 27
Joined: Tue Apr 17, 2018 2:14 am
Contact:

Re: expose autosave interval

Post by hoylemd »

I've published an initial verson of my mod here, just for context: https://mods.factorio.com/mod/autosave-alert

Theis
Inserter
Inserter
Posts: 29
Joined: Tue Sep 13, 2022 9:57 am
Contact:

Re: expose autosave interval

Post 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.

hoylemd
Inserter
Inserter
Posts: 27
Joined: Tue Apr 17, 2018 2:14 am
Contact:

Re: expose autosave interval

Post 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

Post Reply

Return to “Modding interface requests”