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

g Water Ores "dependency" causing issues

11 days ago

Offshore oil working correctly with ore generation in water is currently dependent on specifically the Water Ores mod, which hasn't been updated to 2.0. If the condition for deactivating Cargo Ships' land/water resource layer adjustment could be changed to an internal setting of some sort, so other mods can flip it if necessary, this would be extremely helpful.

11 days ago

There should not be any reference to Water Ores at all in the latest version. Offshore oil is generated correctly in new 2.0 games when enabled both in the mod startup setting and the planet resource generation. The new patches will be spaced differently than they were in the old system.

There appears to be an issue when migrating maps from the old placement method to the new one that will be fixed soon. That may be the cause of what you are seeing.

11 days ago

Just downloaded 1.0.8 to be absolutely certain. Water Ores is a condition on line 99 of data-final-fixes.lua.

11 days ago

(For clarity, it's working fine under vanilla conditions - it's the disabling of land/water resource layer separation being contingent on specifically the named Water Ores mod being installed, so any other mod can't prompt the disabling of that separation.)

11 days ago

Thank you for correcting me. I had forgotten about that part of the code.

The line is

if data.raw.resource["offshore-oil"] then
    if not mods["Water_Ores"] then
        [Modify collision masks so that water ores stay on water and land ores stay on land]

If offshore oil is disabled, or if Water Ores is enabled, then no collision mask changes are made. Refreshing my memory, the reason for that line is that Oil Rigs used to be able to mine normal oil as well, so if Water Ores put normal oil in the water then Cargo Ships didn't need to do anything extra. That condition was a compatibility fix/hack to accommodate that mod and not mess up its other changes to collision masks. Now that offshore-oil has its own resource generation slider, and Oil Rigs can only mine "offshore resources", I'm not sure this compatibility fix even makes sense anymore.

Can you explain exactly what you want to do that this code is interfering with? Do you want to make something similar to Water Ores? I'm sure we can come to a solution together.

11 days ago

Kubius - might be easier if you make a pull request with the changes required to get it working with Dredgeworks?

11 days ago
(updated 11 days ago)

What I'm doing that the code is interfering with is removing the resource collision from water as a portion of Dredgeworks world generation (this was originally done by Water Ores, but I rolled the functionality into Dredgeworks itself).

Water resource collision is set as the inverse of all tiles that had regular resource collision, and if regular resource collision is removed (by Water Ores / Dredgeworks / whatever other mod) every tile has water resource collision.

I think it's quite plausible that the resource-layer-splitting code in question is no longer necessary at all due to the rework to how offshore oil is generated, but not 100% certain of that. The main thing here is compatibility with removing the resource collision from water, and doing it in a way that doesn't hardcode for a particular mod is probably better for "futureproofing".

11 days ago

The extra resource layers are unfortunately necessary to make the autoplacer function correctly. All resources have to have 'resource' layer for miners to recognize them. Vanilla adds 'resource' to water tiles to keep all resources on land, but for offshore resources to be placed on water it must be removed from water tiles. Then we add 'land_resource' and 'water_resource' to keep those respective categories out of the wrong zones. You are correct that some of those changes might be unnecessary if other mods are also putting ores in water. But I'm not sure skipping all of them is the right solution anymore, even in the case of Water Ores.

There is nothing stopping you from simply undoing all those changes in your own 'data-final-fixes.lua' file, with a "(?) cargo-ships" dependency to ensure it executes last. In fact, you might only need to remove the "land_resource" layer from the specific ores you want on both land and water. Then those will not be constrained by the new masks, while offshore-oil and crude-oil will remain constrained.

11 days ago

I'll give that approach a try, and stop back in here if it doesn't work. Thanks for your consideration.

10 days ago

Seemed to work out pretty well. I do think Water Ores' old solution of "just remove the separate layer entirely" would interact poorly with the new offshore oil generation, but whether that's their problem or yours is probably up to you?

New response