[Starsector Mods][0.95.1a] Autosave v1.2 (released 2022-07-12)

  • Post category:Mods
  • Post comments:0 Comments

Autosave
… because sometimes F5 is too hard to remember …
Download version 1.2 (mirror) (requires

)
View source code and progress
Supports

Please note: autosaving is disabled by default because save times can become extremely long with many mods enabled. Instead, the mod simply warns you when you haven’t saved in a while. If you want to enable autosaving, edit lw_autosave_settings.json.data in the saves/common/config folder and set “enableAutosaves” to true (this file will only exist after you have launched the game with Autosave enabled at least once).

You can set forced autosaves to happen after enough time has passed since the last save, after market transactions, after hyperspace jumps, after fighting a battle, or any combination of the four.

Changelog:

Spoiler: click to expand
Spoiler

1.2 (July 12, 2022)
=====================
Updated to be compatible with Starsector 0.95.1a
Added the following to saves/common/config/lw_autosave_settings.json.data:
 – “forceSaveAfterMapChange”, forces a save after every hyperspace jump
 – “saveAsCopy”, if enabled, every autosave creates a new save
Removed autosave_settings.json.default as it was confusing new players
Updated config loading logic to autopopulate any missing entries
Updated autosave to use API’s cmdSave() instead of simulating keypresses

 1.1c (March 26, 2021)
=======================
Updated to be compatible with Starsector 0.95a
Renamed generated settings file to saves/common/lw_autosave_settings.json.data
(Old settings file will be removed if present)

 1.1b (August 28, 2020)
========================
Moved version file hosting to GitHub

 1.1 (November 16, 2018)
=========================
Updated to be compatible with Starsector 0.9a
This mod now requires LazyLib 2.4b or later
Settings are now stored in saves/common/autosave_settings.json.data
 – This file will only exist after launching the mod at least once

 1.0f (April 21, 2017)
=======================
Updated to be compatible with Starsector 0.8a

 1.0e (March 16, 2017)
=======================
Switched version file hosting to Bitbucket

 1.0d (November 19, 2015)
==========================
Fixed issue where simulated quicksave key presses weren’t always registering

 1.0c (November 19, 2015)
==========================
Updated to be compatible with Starsector 0.7a

 1.0b (December 08, 2014)
==========================
Added “minutesBetweenSubsequentWarnings” setting to autosave_settings.json
Fixed bug where the mod started spamming sector messages after a failed autosave

 1.0 (December 08, 2014)
=========================
Initial release:
 – By default, warns when you haven’t saved in a while, and tells you how many
   battles and market transactions have occurred since the last save
 – Player can enable autosaves in autosave_settings.json, can autosave if enough
   time has passed since the last save, or set it to force a save after every
   battle or market transaction


I uploaded a quick hotfix, get it here (mirror).

This fixes an issue where the autosaver didn’t “release” the quicksave key. This didn’t affect manual saves in any way, but it prevented subsequent autosaves from working until you pressed F5 yourself to “unstick” it.


Wish I had downloaded this when I played this morning.

Version 1.0e is up, get it here (mirror).

This update adds no new features and only fixes the version file hosting. If you don’t use Version Checker you don’t need to download this.


Version 1.0f is up, get it here (mirror).

No new features, just a recompile to make it compatible with Starsector 0.8a.


Version 1.1 is up, get it here (mirror). This mod requires

Changelog:

1.1 (November 16, 2018)
=========================
Updated to be compatible with Starsector 0.9a
This mod now requires LazyLib 2.4b or later
Settings are now stored in saves/common/autosave_settings.json.data
 – This file will only exist after launching the mod at least once


Sorry if you answered this elsewhere but is this mod safe to use in 9.1a?

Yes, it says so in the thread title.

May I repost this on fossic.org? With some strings translated.

Version 1.1b is up, get it here. This mod requires

This update adds no new features, and only moves the mod’s version files from Bitbucket (which can no longer be connected to with the outdated JRE that Starsector ships with) to GitHub. If you don’t use the Version Checker mod you don’t need to download this update.

May I repost this on fossic.org? With some strings translated.

Of course, and sorry for the extremely late response.


The forced autosave function doesn’t seem to be working. I have it enabled in the config file, however it doesn’t have any effect.

I just tested it, and all three autosave types (timed, post-battle, and post-market) worked on my machine. Could you post the contents of your lw_autosave_settings.json.data file?

Did the game have focus when it tried to save? The mod works by simulating a press of the F5 key, so anything that would prevent that from registering would also block autosaving from working.


I can’t find that file anywhere in the mod folder. I edited the autosave_settings.json.default.
{
    # How long since the last save before the mod prompts you to save again
    “minutesWithoutSaveBeforeWarning”:15,
    “minutesBetweenSubsequentWarnings”:5,

    #####################
    # AUTOSAVE SETTINGS #
    #####################

    # Set to true to enable the rest of this file’s options
    “enableAutosaves”:true,

    # REQUIRED – must be the same key you press to save the game manually!
    # Key IDs are integers and can be found in the Java documentation here:
    # https://docs.oracle.com/javase/7/docs/api/constant-values.html#java.awt.event.KeyEvent.VK_0
    “saveKey”:116, # Default: 116 (F5)

    # How long after the last save before an autosave will be forced
    “minutesBeforeForcedAutosave”:15,

    # Enable to autosave after the player performs any market actions
    “forceSaveAfterMarketTransactions”:false,

    # Enable to autosave after the player is in a battle
    “forceSaveAfterPlayerBattles”:false
}

Not sure about the focus thing, but I am certain I don’t have any apps or anything that may interfere with my keyboard.


Ah, you’re editing the wrong file. You need to edit saves/common/config/lw_autosave_settings.json.data. The saves folder is in the game’s installation directory, not the mods folder.

My bad, should have read the mod text again. Sorry for the false flag, and thanks  ;D

Leave a Reply