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
7 days ago
0.16 - 2.0
214K
Transportation Logistics Trains Mining Fluids Power

b [Fixed] Migration error when trying to launch a tutorial about rails

1 year, 10 months ago

I tried to launch the rails tutorial from the tips and tricks window, and the following error appeared:

 396.545 Applying migration: Cargo Ships: migrations-0-1-11.lua
 396.700 Error AppManager.cpp:697: Failed to load tutorial: Error while applying migration: Cargo Ships: migrations-0-1-11.lua

__cargo-ships__/migrations/migrations-0-1-11.lua:2: module logic.oil_placement not found;  no such file __cargo-ships__/migrations/logic/oil_placement.lua no such file __core__/lualib/logic/oil_placement.lua
stack traceback:
        [C]: in function 'require'
        __cargo-ships__/migrations/migrations-0-1-11.lua:2: in main chunk
 396.700 Resuming game state
1 year, 10 months ago

What operating system are you running, and can you post your factorio-current.log file? It's supposed to be looking in "cargo-ships/logic/oil_placement.lua", not "cargo-ships/migrations/logic/oil_placement.lua". I just played through all the tutorials just to reproduce it, and it doesn't happen on my Windows 11 machine. It could be there is a file search path bug in a non-windows build of Factorio.

1 year, 10 months ago

ubuntu 22.04, launching factorio via steam. The whole factorio log: https://pastebin.com/eYWK8juY (btw how to insert a snippet with log that collapses or something, like a spoiler tag?)

1 year, 10 months ago
(updated 1 year, 10 months ago)

That's perfect. You can also open an issue on GitHub and attach the log file there.

I definitely think this is a Factorio bug. For the purpose of the bug report, can you try something quick? Extract the cargo-ships zip file into the mods directory, then change migrations-0-1-11.lua line 1, change "logic.oil-placement" to "logic/oil-placement".

The guaranteed workaround is to change "logic.oil-placement" to "__cargo-ships__/logic/oil-placement"

1 year, 10 months ago
(updated 1 year, 10 months ago)

I changed it like you requested in the require() to logic/oil-placement and it didn't work (I even restarted the game to be sure mod changes applied):

 133.878 Error AppManager.cpp:697: Failed to load tutorial: Error while applying migration: Cargo Ships: migrations-0-1-11.lua

__cargo-ships__/migrations/migrations-0-1-11.lua:2: module logic/oil-placement not found;  no such file __cargo-ships__/migrations/logic/oil-placement.lua no such file __core__/lualib/logic/oil-placement.lua
stack traceback:
    [C]: in function 'require'
    __cargo-ships__/migrations/migrations-0-1-11.lua:2: in main chunk

I tried the guaranted workaround as well, but it still doesn't want to work:

  95.739 Error AppManager.cpp:697: Failed to load tutorial: Error while applying migration: Cargo Ships: migrations-0-1-11.lua

__cargo-ships__/migrations/migrations-0-1-11.lua:2: module cargo-ships/logic/oil-placement not found;  no such file __cargo-ships__/migrations/cargo-ships/logic/oil-placement.lua no such file __core__/lualib/cargo-ships/logic/oil-placement.lua
stack traceback:
    [C]: in function 'require'
    __cargo-ships__/migrations/migrations-0-1-11.lua:2: in main chunk

Here is a save file: https://file.io/ENhLnkcSgU3z

Is it some problem with relative paths? I used grep to find usages of require in this mod, and this seems to be the only place where require tries to load the module from a parent directory (actually sibling directory).

1 year, 10 months ago

In the workaround, the double underscores before and after "cargo-ships" are important.

Apparently relative paths are known to be buggy, but they ought to work when everything is in the same mod. So I'll probably replace them with absolute paths every8 after I report it. See if you are interested: https://forums.factorio.com/viewtopic.php?f=28&t=100610&p=556401&hilit=Mod+require+relative+path#p556401

1 year, 10 months ago
(updated 1 year, 10 months ago)

I managed to fix it but it was hecking confusing xD

There are 2 things:
1. is the typo in the require - the file contains underscore (oil_placement) while in the require there is a dash (oil-placement)
2. Modules seemd to be resolved from the directory of the file, so I changed it to __cargo-ships__.logic.oil_placement (game was looking for logic/oil-placement inside the migrations directory)

So yeah, use __cargo-ships__.logic.oil_placement

Also - is the mod closed source? The most recent public commit was one year ago

1 year, 10 months ago

I took over script maintenance from the original owner, but I don't think I have commit permission on the repo. The latest updates are in an open pull request from my fork. The issue tracker is still on the linked original repo.

1 year, 10 months ago
(updated 1 year, 10 months ago)

I started to write the bug report, and realized I did not reproduce the problem correctly. When I open an existing Space Exploration save, open the Tips and Tricks window, then try to play any tutorial, I get the same message on Windows. So the tutorials that are loaded as a full savegame work, but the tutorials that are loaded as part of the tips and tricks do not. This will be an interesting bug report. Posted: https://forums.factorio.com/viewtopic.php?f=7&t=104656

1 year, 9 months ago

Fixed in latest release.

New response