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

Place to get help with not working mods / modding interface.
Post Reply
TreefrogGreaken
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Thu May 04, 2017 12:07 pm
Contact:

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

Post 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
Attachments
Scenario.zip
(39.84 KiB) Downloaded 21 times
0.17 Oil Test.zip
(359.13 KiB) Downloaded 22 times

Zaflis
Filter Inserter
Filter Inserter
Posts: 355
Joined: Sun Apr 24, 2016 12:51 am
Contact:

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

Post 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.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4942
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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

Post Reply

Return to “Modding help”