Someone is getting the below error on loading a new game:. It's on code that's been around a long time, so not sure if a new Factorio release changed anything:
Code: Select all
205.288 Error ServerMultiplayerManager.cpp:95: MultiplayerManager failed: "Error while running on_init: Error while running event Natural_Evolution_Buildings::on_research_finished (ID 18)
__Natural_Evolution_Buildings__/control.lua:556: attempt to perform arithmetic on field 'deduction_constant' (a nil value)
stack traceback:
...mapps/common/Factorio/temp/currently-playing/control.lua:787: in function 'set_research'
...mapps/common/Factorio/temp/currently-playing/control.lua:122: in function 'init_forces'
...mapps/common/Factorio/temp/currently-playing/control.lua:22: in function <...mapps/common/Factorio/temp/currently-playing/control.lua:19>"
On Init:
Code: Select all
if global.deduction_constant == nil or global.deduction_constant == 0 then
global.deduction_constant = 0.00025 -------- DEDUCTION CONSTANT
end
Code: Select all
---------------------------------------------
script.on_event(defines.events.on_research_finished, function(event)
if research == "TerraformingStation-2" then
global.deduction_constant = global.deduction_constant + (global.deduction_constant / 4)
end
if research == "TerraformingStation-3" then
global.deduction_constant = global.deduction_constant + (global.deduction_constant / 4)
end
end)
Again, this has been working for a long time.
Thanks.