[2.1] fluid_boxes index and unpipable fluids

Place to get help with not working mods / modding interface.
Cubickman
Inserter
Inserter
Posts: 34
Joined: Sun Nov 10, 2024 9:08 am
Contact:

[2.1] fluid_boxes index and unpipable fluids

Post by Cubickman »

Hi
After making several unsuccessful attempts, reading and re-reading the API, tearing my hair out and asking for help on Discord (receiving replies that unfortunately didn’t solve my problem), I’m posting it here.

In my mod I have two fluids that shouldn't go into pipes. I want it to be untransportable, so that the machine that produces it and the one that uses it are right next to each other. One transfers from Biochamber to Biochamber, and the other from the Foundry to the Refinery.
(If there’s another way to achieve the desired result, I’ll go for it.) Otherwise, here’s what I did:

I created a new fluid_box with filter for that fluid and an underground connection_type. And I added it to the assembling-machine fluid_boxes array. The recipe "ingredients" or "results" with that fluid have a fluidbox_index.
It work's, the fluid can't go in pipes and can connect directly with the assembling-machine it need to go in.

But now the input is broken for vanilla recipe that have 2 fluids input in this assembling-machine. The input display superimposes the icons for the two fluids, and only one of them can be fed into the machine. So the recipe cannot be performed.
And the Refinery also displays the fluid icon when there is no recipe set.
image du problème.PNG
image du problème.PNG (1.14 MiB) Viewed 146 times

First question: Given that two standard pipe_connections cannot be in the same location, does this mean I must use an ‘underground’ pipe_connection as I did if I want the fluids to enter and exit via the base locations ?

Second question: What am I doing wrong ? Why does adding this mess up the basic recipes ?

And the third question: Why does the refinery display the icon when no recipe has been set ?

I hope someone can help me get it working. Thanks in advance :space-age:
I’ve attached the code (I’ve used version 2.1.9).
Attachments
Code.txt
(14.97 KiB) Downloaded 9 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4812
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.1] fluid_boxes index and unpipable fluids

Post by boskid »

Coal liquefaction has 2 fluid ingredients, "heavy-oil" and "steam". Since this recipe does not use fluidbox_index, standard logic kicks in and assigns fluid ingredients to all available input fluidboxes. Since this logic sees 4 input fluidboxes and 2 ingredients, first 2 fluidboxes are assigned to heavy-oil and last 2 are assigned to "steam". There are no ways to make fluidboxes not participate in the default fluidbox assigning logic so the outcome is exactly what you got. Currently the only possible solution for this is going over all relevant recipes and assigning them fluidbox_index on ingredients and products such that the normal logic does not apply and extra fluidboxes are not used unless explicitly asked to.
Cubickman
Inserter
Inserter
Posts: 34
Joined: Sun Nov 10, 2024 9:08 am
Contact:

Re: [2.1] fluid_boxes index and unpipable fluids

Post by Cubickman »

Ok

I edited the base recipes manually and it works, thanks.
But does that mean that if another mod adds a recipe without specifying an index, the recipe will break and I would then have to again manually edit the recipes from that other mod ?

And for my third question, do you have any idea of why the refinery display the icon when no recipe has been set ?

Thanks in advance
Post Reply

Return to “Modding help”