Page 1 of 1

Option to Reset mod settings at load fail.

Posted: Tue May 01, 2018 10:35 pm
by TatsuZZMage
So i was messing around with the MOD Quarry, and noticed its mod option allowed ya to set the power usage multiplier to 0 so i did, it gave a failed to load pwr usage can't be 0 msg on restart. Now i couldn't change the mod setting back to a working one, so i tried deleted the entry in the mod-settings.dat, and that crashed it(like i thought it would :lol:) SO idea a Revert to last mod settings or just a reset mod settings & restart button on the load failed screen.

Re: Option to Reset mod settings at load fail.

Posted: Wed May 02, 2018 9:04 am
by bobingabout
Well, you have the abillity to disable a mod on startup, I'd say that resetting related settings to defaults should be an option.

though, another way around it is if we had a LAUNCHER that could edit the settings. so not only would you be able to fix it in the launcher, but could also edit the settings without being in game in the first place.

Re: Option to Reset mod settings at load fail.

Posted: Wed May 02, 2018 9:56 am
by bobucles
Wait. So the mod LETS you choose a setting that immediately crashes? That sounds like a bug with the mod! If you are text editing at least that makes sense, since there isn't too much reason for a novice modder to sanity check their configs.

It would be nice to have an option to "restore mod defaults". If there are no defaults then at least an option to redownload or disable the mod. Or does that already exist? I haven't looked too heavily into it.

Re: Option to Reset mod settings at load fail.

Posted: Wed May 02, 2018 6:57 pm
by Rseding91
You can currently reset mod settings by deleting the mod-settings.dat file in the mods folder.

Re: Option to Reset mod settings at load fail.

Posted: Thu May 03, 2018 11:30 am
by bobingabout
Rseding91 wrote:You can currently reset mod settings by deleting the mod-settings.dat file in the mods folder.
Although true, that resets the settings of all mods, would be nice to reset the settings only of mods with an issue.

Re: Option to Reset mod settings at load fail.

Posted: Thu May 03, 2018 5:22 pm
by Rseding91
bobingabout wrote:
Rseding91 wrote:You can currently reset mod settings by deleting the mod-settings.dat file in the mods folder.
Although true, that resets the settings of all mods, would be nice to reset the settings only of mods with an issue.
That doesn't actually fix anything. Any mod can use any other mod(s) settings so you really never know what setting is causing what mod to error.

Re: Option to Reset mod settings at load fail.

Posted: Fri May 04, 2018 1:04 am
by Jap2.0
Rseding91 wrote:
bobingabout wrote:
Rseding91 wrote:You can currently reset mod settings by deleting the mod-settings.dat file in the mods folder.
Although true, that resets the settings of all mods, would be nice to reset the settings only of mods with an issue.
That doesn't actually fix anything. Any mod can use any other mod(s) settings so you really never know what setting is causing what mod to error.
Um, no. TatsuZZMage changed a power usage option in the settings for the quarry mod to 0, then was specifically told that power usage cannot be 0. I think that's pretty clear.
In addition to that, most mods tend to use their own settings, so unless you have a jungle of tightly intertwined dependencies, chances are there is one or a small number of possible mod settings which are causing the issue.

Re: Option to Reset mod settings at load fail.

Posted: Fri May 04, 2018 7:37 am
by Optera
Rseding91 wrote:
bobingabout wrote:
Rseding91 wrote:You can currently reset mod settings by deleting the mod-settings.dat file in the mods folder.
Although true, that resets the settings of all mods, would be nice to reset the settings only of mods with an issue.
That doesn't actually fix anything. Any mod can use any other mod(s) settings so you really never know what setting is causing what mod to error.
Being able to reset the settings defined in a crashed mod certainly would help.
If other mods change values for a mod then both use bad practice of shared setting names.

Re: Option to Reset mod settings at load fail.

Posted: Thu Sep 24, 2020 3:08 pm
by dabalciunas
Ok, this feature is urgently required.

It is so annoying and game-breaking, especially when I play with lots of mods, and 1 of them crashes, but I cannot fix its settings because Factorio won't let the mod load on startup.

So I have just 2 choices, both of them very unpleasant:

- Never load that mod again, because it would crash at startup every time, although it was just a simple wrong parameter given in the mod settings - which could be easily fixed if the modsettings.dat was a standard text file (e.g. JSON / XML)

- Reset the mod settings of over 25 mods

Now I can't simply continue my gameplay, until I adjust mod settings for over 25 mods. Thank you this terrible serialization design.

Re: Option to Reset mod settings at load fail.

Posted: Thu Sep 24, 2020 3:40 pm
by jodokus31
+1 to reset settings of a single mod

related:
viewtopic.php?f=34&t=59851

Re: Option to Reset mod settings at load fail.

Posted: Thu Sep 24, 2020 11:19 pm
by Squelch
Would a generic migration script work to set any given mod back to its defaults?

Re: Option to Reset mod settings at load fail.

Posted: Mon Sep 28, 2020 4:21 pm
by blahfasel2000
dabalciunas wrote:
Thu Sep 24, 2020 3:08 pm
So I have just 2 choices, both of them very unpleasant:
Assuming the crash happens in the data stage there's a third option, although it requires a bit more work (but no deeper understanding of Factorio modding needed):

Make a backup copy of the offending mods zip file, then delete data.lua, data-updates.lua and data-final-fixes.lua from the original zip. Start the game with the mod enabled. It won't crash this time because the data stage of the mod has been removed completely, so you can enter mod settings and change whatever setting causes the crash. Restore the mods zip file from the backup copy and restart. Done.

If the crash happens in the settings stage already, then it becomes more complicated, as you'd have to edit the mods settings stage lua code. This is unlikely though, as usually the settings stage only defines the mod settings available in the menu in a straightforward way and doesn't do anything else.

Re: Option to Reset mod settings at load fail.

Posted: Tue Sep 29, 2020 4:15 am
by ssilk
Generally I see that kind of requests at the side of the mod author. Because he/she forgot to handle this case.

Factorio or the user cannot guess what’s right in which case, as rseding said. It could be any parameter, not only those of the mod. You need to go deep inside of the mod to handle it correctly.

Re: Option to Reset mod settings at load fail.

Posted: Tue Sep 29, 2020 7:12 pm
by steinio
It's just about a new option aside disable listed mods and disable all mods which resets all mod options to default like the button in mod settings or like deleting mod-settings.dat.

I would not go that far that each mod should be resetable individually on an erroneous load.

Re: Option to Reset mod settings at load fail.

Posted: Wed Oct 14, 2020 10:51 am
by dabalciunas
steinio wrote:
Tue Sep 29, 2020 7:12 pm
It's just about a new option aside disable listed mods and disable all mods which resets all mod options to default like the button in mod settings or like deleting mod-settings.dat.

I would not go that far that each mod should be resetable individually on an erroneous load.
Actually, it is even simpler.

The game could simply make a backup of the previous mod settings. If the game fails to load, it restores the previous settings. So simple, so much benefit, almost no implementation cost.

Why encumber Factorio players with such a manual burden, when the solution is so simple ?!?

Re: Option to Reset mod settings at load fail.

Posted: Wed Oct 14, 2020 2:39 pm
by steinio
dabalciunas wrote:
Wed Oct 14, 2020 10:51 am
steinio wrote:
Tue Sep 29, 2020 7:12 pm
It's just about a new option aside disable listed mods and disable all mods which resets all mod options to default like the button in mod settings or like deleting mod-settings.dat.

I would not go that far that each mod should be resetable individually on an erroneous load.
Actually, it is even simpler.

The game could simply make a backup of the previous mod settings. If the game fails to load, it restores the previous settings. So simple, so much benefit, almost no implementation cost.

Why encumber Factorio players with such a manual burden, when the solution is so simple ?!?
Hmm actually... Yeah.

Re: Option to Reset mod settings at load fail.

Posted: Thu Oct 15, 2020 5:31 am
by ssilk
dabalciunas wrote:
Wed Oct 14, 2020 10:51 am
Actually, it is even simpler.

The game could simply make a backup of the previous mod settings. If the game fails to load, it restores the previous settings. So simple, so much benefit, almost no implementation cost.

Why encumber Factorio players with such a manual burden, when the solution is so simple ?!?
What if the problem comes from a combination of things? Like changed setting of mod and then updated mod.
Or more complex: changed setting of mod A, then changed mod B, then changed mod C, which is not compatible with change of mod A.

Re: Option to Reset mod settings at load fail.

Posted: Thu Oct 15, 2020 4:19 pm
by Optera
ssilk wrote:
Thu Oct 15, 2020 5:31 am
dabalciunas wrote:
Wed Oct 14, 2020 10:51 am
Actually, it is even simpler.

The game could simply make a backup of the previous mod settings. If the game fails to load, it restores the previous settings. So simple, so much benefit, almost no implementation cost.

Why encumber Factorio players with such a manual burden, when the solution is so simple ?!?
What if the problem comes from a combination of things? Like changed setting of mod and then updated mod.
Or more complex: changed setting of mod A, then changed mod B, then changed mod C, which is not compatible with change of mod A.
Error, circular incompatibility detected.
We already have something very similar if A requires B, B requires C and C requires A.

Re: Option to Reset mod settings at load fail.

Posted: Thu Oct 15, 2020 8:57 pm
by Hornwitser
ssilk wrote:
Thu Oct 15, 2020 5:31 am
What if the problem comes from a combination of things? Like changed setting of mod and then updated mod.
Or more complex: changed setting of mod A, then changed mod B, then changed mod C, which is not compatible with change of mod A.
Then include which mods were loaded too in previous configuration. Last working config = the set of mods (and their versions) that were successfully loaded along with their startup settings.

Re: Option to Reset mod settings at load fail.

Posted: Fri Oct 23, 2020 8:45 pm
by jodokus31
This is relevant:
viewtopic.php?p=517613#p517613

Probably solves the issue