Add show-time-to-next-autosave debug option to the API

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
LCStark
Fast Inserter
Fast Inserter
Posts: 207
Joined: Thu Jan 28, 2021 5:04 pm
Contact:

Add show-time-to-next-autosave debug option to the API

Post by LCStark »

We have this debug setting available:
06-30-2026, 13-44-54.png
06-30-2026, 13-44-54.png (2.14 KiB) Viewed 182 times


Turning it on displays time remaining to next auto-save in top-right corner:
06-30-2026, 13-44-43.png
06-30-2026, 13-44-43.png (9.39 KiB) Viewed 182 times


It would be nice if we could read that value in the API. I've checked and there are two auto-save related members available: `LuaGameScript::auto_save` to perform an auto-save programmatically, and `LuaGameScript::autosave_enabled` to check if auto-saving is enabled and to toggle it.

I propose adding another property, maybe something like `LuaGameScript::autosave_time_to_next`, which would be a read-only value returning the same time remaining as that debug option (though returning it as number of ticks remaining would probably be most convenient).
Rseding91
Factorio Staff
Factorio Staff
Posts: 17413
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add show-time-to-next-autosave debug option to the API

Post by Rseding91 »

This is unfortunately not possible as this value is not part of the game state and so would cause desyncs if used in multiplayer. It also is different for every player in a multiplayer game and different on the dedicated server.
If you want to get ahold of me I'm almost always on Discord.
User avatar
LCStark
Fast Inserter
Fast Inserter
Posts: 207
Joined: Thu Jan 28, 2021 5:04 pm
Contact:

Re: Add show-time-to-next-autosave debug option to the API

Post by LCStark »

Ah, shame. Since `auto_save` specifically mentions only saving on the server, I assumed it might be possible to make it work the same way here - returning time to the next auto-save for the server. Anyway, thanks for a quick response!
Post Reply

Return to “Modding interface requests”