one possible solution is to force a reset_recipes() and reset_technologies() event, as well as actually trigger a "on_startup_mod_settings_changed" event to run the equivalent of a migration script. (though if you trigger an event, reset_recipes() and reset_technologies() don't need to be forced as they can be included in the event.)
EG, if a mod update adds a new entity to the game, and adds that unlock to an existing technology, then you'd have a migration script run like this:
Code: Select all
for index, force in pairs(game.forces) do
force.reset_recipes()
force.reset_technologies()
if force.recipes["bob-distillery"] and force.technologies["electrolysis-1"].researched then
force.recipes["bob-distillery"].enabled = true
end
end
Basically, what I'm asking for is this event, but for startup settings http://lua-api.factorio.com/latest/even ... ng_changed
EG:
Code: Select all
script.on_runtime_mod_setting_changed(function(event)
if event.setting == "bobmods-plates-purewater" and settings.startup["bobmods-plates-purewater"].value == true then
for index, force in pairs(game.forces) do
force.reset_recipes()
force.reset_technologies()
if force.recipes["bob-distillery"] and force.technologies["electrolysis-1"].researched then
force.recipes["bob-distillery"].enabled = true
end
end
end
end)