Rocket-Silo Construction


Building a Rocket Silo is now a 6 stages process. Each silo needs to be excavated, filled and built, while requiring a lot of power, materials and generating pollution. Custom Space Exploration, Bob&Angels, Industrial Revolution and Exotic Industries compatibility News: new graphics by snouz

Content
6 months ago
0.17 - 1.1
32.9K
Manufacturing

b Error while running event Rocket-Silo-Construction::on_init()

3 years ago

Hello,
A bug occurred when I wanted to update a mod on a server. The server crashed during startup.
Here is the error recovered in the logs:


Error while running event Rocket-Silo-Construction::on_init()
__Rocket-Silo-Construction__/control.lua:23: attempt to index local 'force' (a nil value)
stack traceback:
    __Rocket-Silo-Construction__/control.lua:23: in function 'ModSetup'
    __Rocket-Silo-Construction__/control.lua:36: in function
    <__Rocket-Silo-Construction__/control.lua:35>

I was able to correct the error to be able to restart my server without problem. I let you perhaps adapt the correction yourself but here is the correction code:


function ModSetup()
if global.rsc_silo_under_construction==nil then global.rsc_silo_under_construction={} end
global.st_insert_material_work = settings.startup["rsc-st-work-for-insert-material"].value
global.st_remove_stone_work    = settings.startup["rsc-st-work-for-remove-stone"].value
global.st_not_removable_silo   = settings.startup["rsc-st-not-removable-silo"].value 
global.st_dont_place_tiles     = settings.startup["rsc-st-dont-place-tiles"].value

for f=1, #game.forces do
    local force = game.forces[f]
    if force ~= nil then
        if force.technologies then 
            if force.technologies['rocket-silo'] and force.technologies['rocket-silo'].researched then 
                force.recipes['rsc-excavation-site'].enabled = true
                end
            if force.technologies['se-rocket-launch-pad'] and force.technologies['se-rocket-launch-pad'].researched then 
                force.recipes['rsc-serlp-excavation-site'].enabled = true
                end
            end
        end
    end
end

Thank you.

3 years ago

thanks for the report
new version released

New response