Mod startup settings should be stored on the save file

Bugs that are actually features.
Post Reply
ElderAxe
Fast Inserter
Fast Inserter
Posts: 131
Joined: Thu May 18, 2017 8:04 am
Contact:

Mod startup settings should be stored on the save file

Post by ElderAxe »

Hello,

Today i loaded a 2 week old save after i played with vanilla & different mod setups. When the game started it said "Migrated content" and removed some items.
This problem caused bc of some mod startup setting. I cannot change them after starting a game. But with the following steps you can load an old game with different mod settings.
Currently to prevent this problem i have to start a new game with the mod startup settings of the old game (i cannot remember all of the configs btw). After the factorio restarts with new startup configs, the old game can be loaded without problems.

How to reproduce:
- Install & activate bob's enemies mod.
- start a new game with mod settings "enable alien artifacts", "enable coloured alien artifacts" & "enable small alien artifacts" checked
- save the game and quit
- on the main menu click "new game"
- on the "mod settings" window uncheck "enable alien artifacts", "enable coloured alien artifacts" & "enable small alien artifacts"
- press apply
after factorio reloads
- load the saved game.
- you will see "migrated content" message.

I always thought splitting factorio into a launcher and the game itself will solve all of mod related problems.

Thanks for this great game.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13246
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Mod startup settings should be stored on the save file

Post by Rseding91 »

Thanks for the report however this is working correctly. Startup settings can't be part of a save file because they're required when the game is started and which save file you want to load isn't known until you're ready to load the game or join a MP game.
If you want to get ahold of me I'm almost always on Discord.

TheOddler
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri May 12, 2017 5:52 pm
Contact:

Re: Mod startup settings should be stored on the save file

Post by TheOddler »

Perhaps there should be a fourth settings type. Something that has to be fixed when starting a new game and can't be changed later. It however doesn't need to be known when factorio is loading. This setting should then also be saved. "savegame-global" or something.

I, for instance, made a mod that changes the world generation to generate a realworld map (ish). You can select the scale of the map, and spawn location. If you would change the scale or spawn in a savegame where already part of the map is generated, it will start generating new parts at a different scale, which will break the world. So you need to set the scale and such when starting a new savegame, and shouldn't change them later. There is however no way to enforce this at the moment, at least none that I have found.

The closest I came is to ignore changes to the setting during runtime (and give the player a console message stating he shouldn't do that, and reverse the change). However, the changes will be picked up when the player then restarts factorio.

I tried overriding the settings.global values when a change happens at runtime, but that doesn't seem to work:

Code: Select all

script.on_event(defines.events.on_runtime_mod_setting_changed, function(event)
    if not event then return end
    ......
    if event.setting == "map-gen-scale" then settings.global["map-gen-scale"].value = scale end
    ......
end)

Post Reply

Return to “Not a bug”