[HELP] Adding a pumpjack that requires fluid?

Place to get help with not working mods / modding interface.
JBC363
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Feb 02, 2018 8:15 am
Contact:

[HELP] Adding a pumpjack that requires fluid?

Post by JBC363 »

I'm trying to mod in a pumpjack that consumes fluid (i.e, water) (similar to how vanilla mining drills need acid on uranium) to successfully extract fluid (i.e, natural gas). However given the state of the FluidBox documentation (or lack thereof), how would one go about this? Is it even possible?

Thanks in advance.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [HELP] Adding a pumpjack that requires fluid?

Post by bobingabout »

This has come up before, and I answered.

Keep in mind that there's 2 definitions of fluid boxes on mining drills (Boilers too, but we don't need to talk about them right now), and you need to specify both types for it to work.

Additionally, the fluid used for mining is specified on the resource.

Lets start by quoting some code.
First, the output box from the pumpjack

Code: Select all

    output_fluid_box =
    {
      base_area = 2,
      base_level = 1,
      pipe_covers = pipecoverspictures(),
      pipe_connections =
      {
        {
          positions = { {1, -2}, {2, -1}, {-1, 2}, {-2, 1} }
        }
      },
    },
then the input code from the electric mining drill

Code: Select all

    input_fluid_box =
    {
      production_type = "input-output",
      pipe_picture = assembler2pipepictures(),
      pipe_covers = pipecoverspictures(),
      base_area = 1,
      pipe_connections =
      {
        { position = {-2, 0} },
        { position = {2, 0} },
        { position = {0, 2} },
      }
    },
Simply specifying both will add both sets of pipes to the entity.

Note, pipe_connections is different between the two definitions there. The input is configured to always place 3 connections on the entity at specific points, which rotate when the entity rotates. if you take the output location as the front (vector_to_place_result = {0, -1.85}, making it the equivalent of 0,-2), the other 3 connections are the middle tile of the other 3 sides.
The definition of pipe connections is different for the output used on the pumpjack, and defines a specific location to put the connection based on the entities rotation.
You can use either type of definition for either pipe connection, as long as neither of them has a connection placed in the same tile at the same time.
all numbers are designed for a 3x3 entity, you'll need to change the numbers for any other size of entity.

Moving on to the resource:
I can't quote directly, because I can't see gamecode here, however, you need to add required_fluid = and fluid_amount = to the minable table of the resource (alongside hardness, mining_time and result tags)

And that should be about everything you need.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [HELP] Adding a pumpjack that requires fluid?

Post by darkfrei »

JBC363 wrote:I'm trying to mod in a pumpjack that consumes fluid (i.e, water)
Hydraulic Pumpjacks
Post Reply

Return to “Modding help”