Fractal Softworks Forum

Starsector => Mods => Topic started by: LazyWizard on November 19, 2015, 03:23:51 PM

Title: [0.96a] Autosave v1.2b (released 2023-05-05)
Post by: LazyWizard on November 19, 2015, 03:23:51 PM
Autosave
... because sometimes F5 is too hard to remember ...
Download version 1.2b (https://github.com/LazyWizard/autosave/releases/download/1.2b/Autosave.1.2b.zip) (mirror (https://www.mediafire.com/file/338sdgn2xpikyug/Autosave_1.2b.zip/file)) (requires LazyLib (http://fractalsoftworks.com/forum/index.php?topic=5444.0))
View source code and progress (https://github.com/LazyWizard/autosave)
Supports Version Checker (http://fractalsoftworks.com/forum/index.php?topic=8181)

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
Quote
1.2b (May 05, 2023)
=====================
Updated to be compatible with Starsector 0.96a

 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
[close]
Title: Re: [0.7a] Autosave v1.0d (released 2015-11-19)
Post by: LazyWizard on November 19, 2015, 04:22:41 PM
I uploaded a quick hotfix, get it here (https://bitbucket.org/LazyWizard/autosave/downloads/Autosave%201.0d.zip) (mirror (http://www.mediafire.com/download/n07rerrag1317yk/Autosave_1.0d.zip)).

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.
Title: Re: [0.7a] Autosave v1.0d (released 2015-11-19)
Post by: Hopelessnoob on November 20, 2015, 10:58:53 PM
Wish I had downloaded this when I played this morning.
Title: Re: [0.7.2a] Autosave v1.0e (released 2017-03-16)
Post by: LazyWizard on March 16, 2017, 09:18:18 PM
Version 1.0e is up, get it here (https://bitbucket.org/LazyWizard/autosave/downloads/Autosave%201.0e.zip) (mirror (http://www.mediafire.com/file/ukc5h2a6h8idlhs/Autosave_1.0e.zip)).

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.
Title: Re: [0.8a] Autosave v1.0f (released 2017-04-21)
Post by: LazyWizard on April 21, 2017, 11:18:42 AM
Version 1.0f is up, get it here (https://bitbucket.org/LazyWizard/autosave/downloads/Autosave%201.0f.zip) (mirror (http://www.mediafire.com/file/p68fngdcaqzfgls/Autosave_1.0f.zip)).

No new features, just a recompile to make it compatible with Starsector 0.8a.
Title: Re: [0.9a] Autosave v1.1 (released 2018-11-16)
Post by: LazyWizard on November 16, 2018, 09:07:13 PM
Version 1.1 is up, get it here (https://bitbucket.org/LazyWizard/autosave/downloads/Autosave%201.1.zip) (mirror (http://www.mediafire.com/file/20dhab2heqi7ia6/Autosave_1.1.zip)). This mod requires LazyLib 2.4b (http://fractalsoftworks.com/forum/index.php?topic=5444.0) or higher!

Changelog:
Quote
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
Title: Re: [0.9.1a] Autosave v1.1 (released 2018-11-16)
Post by: Alphascrub on June 27, 2019, 01:54:21 AM
Sorry if you answered this elsewhere but is this mod safe to use in 9.1a?
Title: Re: [0.9.1a] Autosave v1.1 (released 2018-11-16)
Post by: SCC on June 27, 2019, 02:15:15 AM
Yes, it says so in the thread title.
Title: Re: [0.9.1a] Autosave v1.1 (released 2018-11-16)
Post by: jn_xyp on July 21, 2020, 12:37:02 PM
May I repost this on fossic.org? With some strings translated.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: LazyWizard on August 28, 2020, 09:21:25 PM
Version 1.1b is up, get it here (https://github.com/LazyWizard/autosave/releases/download/1.1b/Autosave_1.1b.zip). This mod requires LazyLib (http://fractalsoftworks.com/forum/index.php?topic=5444.0).

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.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: Aeios on September 14, 2020, 04:32:32 AM
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.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: LazyWizard on September 14, 2020, 04:43:28 AM
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.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: Aeios on September 14, 2020, 11:00:54 AM
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.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: LazyWizard on September 14, 2020, 11:07:12 AM
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.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: Aeios on September 14, 2020, 11:09:18 AM
My bad, should have read the mod text again. Sorry for the false flag, and thanks  ;D
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: LazyWizard on September 14, 2020, 11:14:30 AM
No worries, it's completely understandable. It's a confusing setup. The config files will be replaced with an in-game dialog and per-save settings in the next version. ETA is somewhere around the heat death of the universe, or whenever I can muster up motivation to work on mods again. Whichever of those two comes first.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: Neitronus on October 06, 2020, 01:48:59 AM
Is there any way to link autosave feature to ingame cycle/day etc rather than to fixed system timer? Optionaly ofc.
Title: Re: [0.9.1a] Autosave v1.1b (released 2020-08-28)
Post by: Warlord-616x on October 28, 2020, 11:16:53 AM
this is all i get.

[attachment deleted by admin]
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: LazyWizard on March 26, 2021, 12:15:07 PM
Version 1.1c has been released. No new features, just a compatibility bump. Grab it here (https://github.com/LazyWizard/autosave/releases/download/1.1c/Autosave.1.1c.zip).

And just as a reminder, autosaves are disabled by default. You'll need to launch the game once with this mod enabled, then edit saves/common/config/lw_autosave_settings.json.data[/url] to enable them.
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: Rasip on April 01, 2021, 08:19:22 PM
Any chance of a new feature being added? Specifically, using save copy instead of overwriting the save?
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: LazyWizard on April 02, 2021, 08:41:51 AM
Any chance of a new feature being added? Specifically, using save copy instead of overwriting the save?

Unfortunately, no. The autosave portion of this mod works by simulating keyboard presses, and there's no dedicated keybind for making a save copy.
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: rhif on May 02, 2021, 03:22:33 PM
Nice mod. Would like to add that the saving can be done now without needing to emulate keypresses.

Saving:
Code
Global.getSector().getCampaignUI().cmdSave();

Save Copy:
Code
Global.getSector().getCampaignUI().cmdSaveCopy();

Not a knock on your mod, of course. I'm still learning more about the modding API and figured I'd share a discovery.  :)
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: Damienov on May 02, 2021, 07:11:20 PM
Nice mod. Would like to add that the saving can be done now without needing to emulate keypresses.

Saving:
Code
Global.getSector().getCampaignUI().cmdSave();

Save Copy:
Code
Global.getSector().getCampaignUI().cmdSaveCopy();

Not a knock on your mod, of course. I'm still learning more about the modding API and figured I'd share a discovery.  :)
perhaps contribute on this mod github (https://github.com/LazyWizard/autosave) would be a better option for that

and I think it was intentional as to why its not automated as stated on the first post
Quote
autosaving is disabled by default because save times can become extremely long with many mods enabled
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: Deshara on June 08, 2021, 12:07:27 PM
i love this mod but I have 1 small problem; the autosave can be a little aggressive about saving when u leave a market or after a battle, which combined with the fact that u cant pull up the pause menu to load or quit without exiting a market or battle turns it into a bit of a problem -- which is a shame bc saving when I leave a market & after a good battle is the only feature of this mod that I want! This could be fixed for me either by giving the option to save copy instead of save so it doesnt overwrite my last save (in case I wanna redo something that I messed up in the market), and/or, introducing an option that allows you to introduce a delay between the autosave being triggered and actually firing, so I have time to hit escape & load before the mod overwrites the save i want to load
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: Reggie on July 15, 2021, 11:42:56 PM
I really need this mod but when I try to start the game it crashes and I get this error message. I've tried starting with the settings untouched and with the settings changed but it doesn't make any difference.


42293 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: JSONObject["forceSaveAfterPlayerBattles"] is not a Boolean.

Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: Reggie on July 16, 2021, 02:32:29 PM
I really need this mod but when I try to start the game it crashes and I get this error message. I've tried starting with the settings untouched and with the settings changed but it doesn't make any difference.


42293 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: JSONObject["forceSaveAfterPlayerBattles"] is not a Boolean.


figured out the problem, the settings folder in saves/config has a typo.
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: Alukard on January 07, 2022, 02:05:10 AM
I really need this mod but when I try to start the game it crashes and I get this error message. I've tried starting with the settings untouched and with the settings changed but it doesn't make any difference.
How to fix that?
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: Jinnigan on January 15, 2022, 05:28:30 PM
I really need this mod but when I try to start the game it crashes and I get this error message. I've tried starting with the settings untouched and with the settings changed but it doesn't make any difference.
How to fix that?
in \Fractal Softworks\Starsector\saves\common\config\lw_autosave_settings.json.data,

change

"enableAutosaves": "enabled",

to

"enableAutosaves": true,

here's a list of all my mods i'm using, since it might be an interaction from another mod causing the problem?
Spoiler
{"enabledMods": [
  "$$$_lightshow",
  "$$$_trailermoments",
  "pantera_ANewLevel40",
  "apex_design",
  "lw_autosave",
  "battletechportraitpack",
  "timid_admins",
  "CAS",
  "chatter",
  "timid_commissioned_hull_mods",
  "istl_dassaultmikoyan",
  "hm_flagpack",
  "dronelib",
  "fleetsizebydp",
  "sun_fuel_siphoning",
  "gunnyhegexpeditionary",
  "hiigaran_descendants",
  "interestingportraitspack",
  "kadur_remnant",
  "lw_lazylib",
  "leadingPip",
  "logisticsNotifications",
  "luddenhance",
  "mag_protect",
  "MagicLib",
  "sun_new_beginnings",
  "nexerelin",
  "objects_analysis",
  "ORA",
  "planet_search",
  "portrait",
  "roider",
  "tahlan_scalartech",
  "SEEKER",
  "shadow_ships",
  "swp",
  "simpleplayerflags",
  "speedUp",
  "sun_starship_legends",
  "tahlan",
  "Terraforming & Station Construction",
  "TORCHSHIPS",
  "transfer_all_items",
  "US",
  "URW",
  "vayrasector",
  "vayrashippack",
  "WEAPONARCS",
  "whichmod",
  "audio_plus",
  "astroidships",
  "shaderLib"
]}
[close]
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: voodofreak on April 05, 2022, 05:49:40 AM
I noticed that you've updated the mod in March but the current version of the game doesn't seem to like it. Am I doing something wrong here?


[attachment deleted by admin]
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: 123nick on May 26, 2022, 01:00:13 PM
Can there be an option to autosave _before_ starting a battle, or going into one? like, if an enemy fleet that is pursuing is like 10 pixels away from your fleet then autosave pre emptively? so its easier to just reload a save and restart a battle which idk how to do any other way.
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: LazyWizard on July 12, 2022, 05:44:28 AM
Version 1.2 is up, get it here (https://github.com/LazyWizard/autosave/releases/download/1.2/Autosave.1.2.zip) (mirror (https://www.mediafire.com/file/r3zesjfrckuu4ux/Autosave_1.2.zip/file)). Still requires LazyLib (https://fractalsoftworks.com/forum/index.php?topic=5444.0).

Changelog:
Quote
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



Can there be an option to autosave _before_ starting a battle, or going into one? like, if an enemy fleet that is pursuing is like 10 pixels away from your fleet then autosave pre emptively? so its easier to just reload a save and restart a battle which idk how to do any other way.

There's no good way to do this, unfortunately, otherwise I'd have added it in this release. Sorry!
Title: Re: [0.95.1a] Autosave v1.2 (released 2022-07-12)
Post by: TheHZDev on July 12, 2022, 07:26:17 AM
Sir, can you allow me to translate this mod into Chinese and update it to the Chinese Starsector Forum(https://fossic.org)?
Thank you very much.
Title: Re: [0.95a] Autosave v1.1c (released 2021-03-26)
Post by: 123nick on September 09, 2022, 01:23:53 PM
Version 1.2 is up, get it here (https://github.com/LazyWizard/autosave/releases/download/1.2/Autosave.1.2.zip) (mirror (https://www.mediafire.com/file/r3zesjfrckuu4ux/Autosave_1.2.zip/file)). Still requires LazyLib (https://fractalsoftworks.com/forum/index.php?topic=5444.0).

Changelog:
Quote
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



Can there be an option to autosave _before_ starting a battle, or going into one? like, if an enemy fleet that is pursuing is like 10 pixels away from your fleet then autosave pre emptively? so its easier to just reload a save and restart a battle which idk how to do any other way.

There's no good way to do this, unfortunately, otherwise I'd have added it in this release. Sorry!

Thanks for replying, itd be nice to have but i understand why itd be hard to implement

Could it be possible to have an option to NOT force autosaves if youve already had a forced autosave less than 5 minutes ago (configurable)?
Title: Re: [0.96a] Autosave v1.2b (released 2023-05-05)
Post by: LazyWizard on May 05, 2023, 02:07:46 PM
Version 1.2b is out, get it here (https://github.com/LazyWizard/autosave/releases/download/1.2b/Autosave.1.2b.zip) (mirror (https://www.mediafire.com/file/338sdgn2xpikyug/Autosave_1.2b.zip/file)) (requires LazyLib (http://fractalsoftworks.com/forum/index.php?topic=5444.0)).

Just as a reminder: autosaves are disabled by default due to how long saves can be with many mods enabled. On a fresh install, the mod will only warn you when you haven't saved in a while.

To enable autosaves, run the game with the mod enabled once, then edit the file saves/common/config/lw_autosave_settings.json.data and set "enableAutosaves" to true.
Title: Re: [0.96a] Autosave v1.2b (released 2023-05-05)
Post by: Joss on June 11, 2023, 08:09:05 AM
Losing 5 hours of gameplay like it just happened to me makes for a very bad first time experience.
And I really shouldn't have to install a mod to get a basic standard feature that any decent game already normally offers (e.g. Valheim, No Man's Sky, an mostly every other good game actually).
Yes, I admit that when I'm fully immersed in YOUR game I'm not thinking of pressing F5 every 5 minutes, especially when I assume the game would adequately perform this repetitive unfulfilling task by itself.
Now I don't think I'm gonna go through the painful experience of starting again from scratch, and I'm probably just gonna shelve the game for now.
I don't think I can recommend Starsector to people I know, since I don't want them to experience the same frustration and disappointment themselves.
Title: Re: [0.96a] Autosave v1.2b (released 2023-05-05)
Post by: perenoel on July 26, 2023, 11:31:00 AM
Thank you so much for this mod. The game is so immersive I usually forget to save while chaining missions and then these Luddic church fanatics get me.
Title: Re: [0.96a] Autosave v1.2b (released 2023-05-05)
Post by: rockyrocknl on September 16, 2023, 11:55:36 AM
love this mod

I would like to offer a suggestion for making the "saveAsCopy" config support an integer value where it saves every X saves as a copy including the first save of the session(if possible)
so something like :
0 makes no copy
1 makes a copy every time
N>1 makes copy every Nth save and also on the first save of the session (if possible)
-1 makes a copy only on the first save of the session(if possible)

I personally have auto save set to 10 minutes and force after battles
So it is not feasible to save as copy every time but also don't like the idea of having no backup if it saves after I do a dumdum
Title: Re: [0.96a] Autosave v1.2b (released 2023-05-05)
Post by: shadowwolf666 on February 04, 2024, 11:45:28 AM
 I basically can't play without this mod because I get too immersed and forget the save function exists lmao

I hate to be a nag but is there anyway we could get an ETA on when this mod will be compatible with the new version? I know its not been out long lol I just can't play without it or I'll lose hours of progress XD


Thanks for all you do!!!! <3

I forgot to ask if there's a way to manually install this as to sidestep the mod automatically being disabled for being out of date even if it technically still works.
Title: Re: [0.96a] Autosave v1.2b (released 2023-05-05)
Post by: KnightNave on February 07, 2024, 03:13:13 PM
I forgot to ask if there's a way to manually install this as to sidestep the mod automatically being disabled for being out of date even if it technically still works.

did a brief test to make sure it was compatible.
To manually install it, just go to the mod->mod_info.json and change "gameVersion": "0.97a", and save.