Finite Water - Fresh water is rare


Fresh water is like oil. You can research an offshore pump later in the game, but you have to desalinize the water.

Content
4 years ago
0.16 - 0.18
10
Environment

g Compatibility

4 years ago

Hi, this mod and Burner Offshore Pump (https://mods.factorio.com/mod/BurnerOffshorePump) mod seem to not work together. I think the other mod is doing something to replace the default offshore pump after you build it. Wanted to report this to see if there was anything that you could do about it.

Thanks!

4 years ago

+1, the Burner Offshore Pump has this two entities:

type: "assembling-machine"; name: "burner-offshore-pump", 120 fluids/second
type: "assembling-machine"; name: "electric-offshore-pump", 1200 fluids/second

Discussion: https://mods.factorio.com/mod/BurnerOffshorePump/discussion/5d01a1a9b785df000cbc9fe5

4 years ago
(updated 4 years ago)

DellAquila,

For this, in data-final-fixes.lua, I added the below block of code (I wish I could properly indent the code here... sorry):

if mods["BurnerOffshorePump"] then
data.raw["assembling-machine"]["burner-offshore-pump"].fluid_boxes.fluid_box.filter = "saline-water"
data.raw["assembling-machine"]["electric-offshore-pump"].fluid_boxes.fluid_box.filter = "saline-water"
for _,result in pairs (data.raw["recipe"]["bop-make-water"].results) do
if result.name == "water" then
result.name = "saline-water"
end
end
end

Then, in order for the pumps to be unlocked with the proper tech, in the if - then block above it for checking if saline to water is enabled, I added the below block of code after the closing of data:extends but before the end closing the if block:

if mods["BurnerOffshorePump"] then
local saltwatertech = data.raw["technology"]["salt-water"]
for p, effect in pairs (saltwatertech.effects) do
if effect.recipe == "offshore-pump" then
saltwatertech.effects[p] = nil
end
end
table.insert(saltwatertech.effects, {type = "unlock-recipe", recipe = "burner-offshore-pump"})
table.insert(saltwatertech.effects, {type = "unlock-recipe", recipe = "electric-offshore-pump"})
end

This removes the regular pump recipe and replaces it with the ones added by darkfrei's mod.

I'd also recommend against creating whole new of something in vanilla and then overwriting it (as you do with the recipe). In darkfrei's mod, the recipe is altered to add hidden = true, but then yours overwrites that. Instead, it may be best to store it in a local variable (local offshorepump = data.raw["recipe"]["offshore-pump"]), and then make the changes you want that way (ie, offshorepump.enabled = false, etc).

New response