Page 1 of 1

[0.17.09] MODDING - Offshore Pump Fluid Type Not Respected or Locked

Posted: Sun Mar 10, 2019 3:07 pm
by TreefrogGreaken
What
My mod uses a modified offshore pump to output crude oil. The entity has been deep copied from base, and had its fluid type changed to crude-oil.

Code: Select all

local offshorecrudeoil = table.deepcopy(data.raw["offshore-pump"]["offshore-pump"])

offshorecrudeoil.name = "offshore-crude-oil-pump"
offshorecrudeoil.fluid = "crude-oil"
offshorenofluid.pumping_speed = 20
Bug
When the offshore pump is placed it has a water output. Placing a pipe after it then changes the output to crude-oil.

This allows the pump to be connected up to a water network, despite being a crude-oil output. The entire fluid network then shows crude-oil as the name but with blue fluid inside. When a new pipe is placed, it then changed the entire network to water, including the offshore pump, which should only output crude-oil.

Fix
The offshore pump should respect and lock to its own fluid value set in data.lua.

Image
Initial Placement, showing water as output.

Image
Added Pipe to output. Changes fluid to Crude-Oil.

Image
Offshore Crude Oil Pump connected to water network, showing fluid name as Crude-Oil, fluid colour as blue.

Image
Added Pipe to network, now showing name as water, has changed Offshore Crude Oil Pump to water output.

Link to Mod : https://www.dropbox.com/s/0xvdecrzh8p1n ... 0.zip?dl=0

Re: [0.17.09] MODDING - Offshore Pump Fluid Type Not Respected or Locked

Posted: Sun Mar 10, 2019 9:55 pm
by Zaflis
See: \Steam\SteamApps\common\Factorio\data\base\prototypes\entity\demo-entities.lua

Line 2604:

Code: Select all

    fluid_box =
    {
      base_area = 1,
      base_level = 1,
      pipe_covers = pipecoverspictures(),
      production_type = "output",
      filter = "water",
      pipe_connections =
      {
        {
          position = {0, 1},
          type = "output"
        }
      }
    },
You should propably override that with "crude-oil". Not sure if it completely solves the issue but seems potential.

Re: [0.17.09] MODDING - Offshore Pump Fluid Type Not Respected or Locked

Posted: Sun Mar 10, 2019 10:05 pm
by Klonan
Zaflis wrote:
Sun Mar 10, 2019 9:55 pm
See: \Steam\SteamApps\common\Factorio\data\base\prototypes\entity\demo-entities.lua

Line 2604:

Code: Select all

    fluid_box =
    {
      base_area = 1,
      base_level = 1,
      pipe_covers = pipecoverspictures(),
      production_type = "output",
      filter = "water",
      pipe_connections =
      {
        {
          position = {0, 1},
          type = "output"
        }
      }
    },
You should propably override that with "crude-oil". Not sure if it completely solves the issue but seems potential.
This is correct,

Moving to modding help