Cargo Ships


Adds massive cargo ships to the game, that function similarly to trains. Also adds deep sea oil, oil platforms, tanker ships, train bridges and other water based content.

Content
21 days ago
0.16 - 2.0
219K
Transportation Logistics Trains Mining Fluids Power

b [Fixed] Error in migration

2 years ago

I need help any one know how to fix this?

Error while applying migration: Cargo Ships: migrations_2.lua

cargo-ships/migrations/migrations_2.lua:5: attempt to index field 'deep_sea_oil_extraction' (a nil value)
stack traceback:
cargo-ships/migrations/migrations_2.lua:5: in main chunk

2 years ago

Should work if you change line 5 from

recipes["oil_rig"].enabled = technologies["deep_sea_oil_extraction"].researched

to

recipes["oil_rig"].enabled = technologies["deep_sea_oil_extraction"] and technologies["deep_sea_oil_extraction"].researched or false
2 years ago

i did but now

cargo-ships/migrations/migrations_2.lua:5: unexpected symbol near '.'

2 years ago
(updated 2 years ago)

Sure you copied/pasted the line correctly? It didn't crash when I loaded the mod into an existing game, and the migration was run.

Anyway, this breaks for a different reason: If the setting "deep_oil" has been turned off, neither recipes["oil_rig"] nor technologies["deep_sea_oil_extraction"] will exist. Try this instead:

if recipes["oil_rig"] and technologies["deep_sea_oil_extraction"] then
  recipes["oil_rig"].enabled = technologies["deep_sea_oil_extraction"].researched
end
2 years ago

I'm not even sure this migration is needed anymore, now that the game automatically reevaluates technology unlocks on configuration change.

Was the original error from starting a new game with oil disabled, or loading a specific old save?

2 years ago

This was fixed in 0.1.16. Thanks for the report.

New response