Cargo Ships


Adds massive cargo ships to the game, that function similarly to trains. Also adds tanker ships, train bridges. NOTE: In 2.1, You Must Install Oil Rigs Separately!

Content
11 days ago
0.16 - 2.1
275K
Transportation Logistics Trains Fluids

b [Fixed] Error in migration

4 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

4 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
4 years ago

i did but now

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

4 years ago
(updated 4 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
4 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?

4 years ago

This was fixed in 0.1.16. Thanks for the report.

New response