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
a month ago
0.16 - 2.0
224K
Transportation Logistics Trains Mining Fluids Power

g Crash when trying to grab blueprint for placement

4 months ago

Trying to grab a blueprint to place down, and getting a continuous crash

The mod Cargo Ships (1.0.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event cargo-ships::on_player_cursor_stack_changed (ID 32)
LuaItemStack API call when LuaItemStack was invalid for read.
stack traceback:
[C]: in function 'get_blueprint_entities'
cargo-ships/logic/pump_placement.lua:77: in function 'is_holding_pump'
cargo-ships/logic/pump_placement.lua:100: in function 'PumpVisualisation'
cargo-ships/control.lua:339: in function <cargo-ships/control.lua:337>

4 months ago

Should be fixed in the latest update, 1.0.5

4 months ago
(updated 4 months ago)

The mod Cargo Ships (1.0.5) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event cargo-ships::on_player_cursor_stack_changed (ID 32)
Record is not a BlueprintRecord.
stack traceback:
[C]: in function 'get_blueprint_entities'
cargo-ships/logic/pump_placement.lua:77: in function 'check_blueprint_for_pumps'
cargo-ships/logic/pump_placement.lua:95: in function 'is_holding_pump'
cargo-ships/logic/pump_placement.lua:136: in function 'PumpVisualisation'
cargo-ships/control.lua:339: in function <cargo-ships/control.lua:337>

Still happening in 1.0.5

That said, this happened when grabbing a blueprint book from the quickbar or inventory, rather than the blueprint library

4 months ago

Crash happens when grabbing a blueprint book containing other blueprint books, deconstruction planners or upgrade planners.

Changing line 95 in cargo-ships/logic/pump_placement.lua from:
if check_blueprint_for_pumps(record) then
to
if record.type == "blueprint" and check_blueprint_for_pumps(record) then
should fix it.

4 months ago

Thanks for the report, should be fixed in 1.0.6.

4 months ago

Sweet, I'll see if I can find anything else involving blueprints

I suspect that the same issue exists in multiple locations, not sure how it's coded, but you may wish to simply have whatever function this is as it's own function instead of re-writing it multiple times.

That said, I have no idea if that would be even possible

4 months ago
(updated 4 months ago)

Just dropping you a quick note that this is still happening in 1.0.6. Very cool mod concept, so I am excited to give it a go. I will disable for now as it crashes anytime I pull blueprint book out of the My Blueprints interface or import a new string. Hope you can get it working.

The mod Cargo Ships (1.0.6) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event cargo-ships::on_player_cursor_stack_changed (ID 32)
BlueprintRecord cannot be read while it is a preview.
stack traceback:
[C]: in function 'get_blueprint_entities'
cargo-ships/logic/pump_placement.lua:77: in function <cargo-ships/logic/pump_placement.lua:76>
(...tail calls...)
cargo-ships/logic/pump_placement.lua:144: in function 'PumpVisualisation'
cargo-ships/control.lua:339: in function <cargo-ships/control.lua:337>

4 months ago

I think I might have a fix for you.

Encapsulate all calls for "check_blueprint_for_pumps" with pcall

so

if pcall(check_blueprint_for_pumps) then
...
else
...
end

4 months ago

Pcall is probably a good bandaid since it's just a visual feature causing the problem, but I'd like to make it work properly. I'm very confused because I can't get the "preview" crash on my machine. Can someone please post detailed instructions to reproduce it, their factorio-current.log file, blueprint string and/or save file?

4 months ago

Oh 100%, pcall is a great bandaid, but it's just a bandaid.

I have another comment to make, but that'll go in the other thread since it's more relevent there.

Unless you want a single thread of this, I'll toss one up

New response