I dont get it! (fluid boxes)

Place to get help with not working mods / modding interface.
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

I dont get it! (fluid boxes)

Post by ficolas »

This code works fine...

Code: Select all

{
    type= "assembling-machine",
    name= "electrolycer",
	order = "m-r",
    flags= {"placeable-neutral", "player-creation"},
    collision_box= {{-1.4, -0.6}, {1.4, 1.0}},
    selection_box= {{-1.5, -0.6}, {1.5, 1.0}},
    minable= { hardness= 0.2, mining_time= 0.5, result= "electrolycer" },
    crafting_categories= { "electrolycer" },
    max_health= 150,
    drawing_position= {0.7, 0.12},
    ingredient_count= 5,
    energy_usage= "500kW",
    crafting_speed= 1,
	icon="__F-mod__/resources/icons/electrolycer.png",
    energy_source=
    {
      type= "electric",
      usage_priority = "secondary-input",
    },
    animation=
    {
      filename= "__F-mod__/resources/entity/electrolycer/electrolycer2.png",
      priority= "medium",
      frame_width= 147,
      frame_height= 128,
      line_length= 8,
      frame_count= 24,
      shift = {0, -0.525}
    },
	
	fluid_boxes =
    {
      {
        production_type = "input",
        pipe_covers = pipecoverspictures(),
        base_area = 10,
        base_level = -1,
        pipe_connections = {{ type="input", position = {-2, 0.5} }}
      },
But when I change the collision box to this:

Code: Select all

    collision_box= {{-1.4, -0.6}, {0.9, 1.0}},
    selection_box= {{-1.5, -0.6}, {1, 1.0}},
It gives an error message (invalid pipe connections specification for offset [-0.5, -2], what its weird is that I changed the colision on the right part of the electrolycer, and the fluid box is in the left part... so why it wont let me?

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: I dont get it! (fluid boxes)

Post by drs9999 »

I stumple upon this as well. I am quiet sure that it has to do with rotation.

If you rotate an assembly the selectionsbox will not rotate, so the fluidbox is inside the selectionbox and that is forbidden ( or at least it seems like). And I guess that is checked on start-up taht is why you receive the error there.

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: I dont get it! (fluid boxes)

Post by ficolas »

drs9999 wrote:I stumple upon this as well. I am quiet sure that it has to do with rotation.

If you rotate an assembly the selectionsbox will not rotate, so the fluidbox is inside the selectionbox and that is forbidden ( or at least it seems like). And I guess that is checked on start-up taht is why you receive the error there.
mmm that will be annoying... I also need a way to stop rotation because I dont want it to rotate... it looks so derpy rotating

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: I dont get it! (fluid boxes)

Post by ficolas »

Ok fixed
How I fixed the previous thing is moving the output and the input 0.5 further from the machine (it was inside it...) Ill let this here because maybe somebody reads it and gets its problem fixed.



But... even more problems! (but fixel older ones
The blast furnace doesnt seem to be outputing anything...
even more problems.jpg
even more problems.jpg (64.31 KiB) Viewed 4508 times
AAAnd I "fixed" it. I placed a pump to see if it worked that way, and it does. The problem is that I had base_level = 1, in the output, but it needs to be base_level = -1,
Again, im leaving this here because maybe somebody needs this info too :)

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: I dont get it! (fluid boxes)

Post by drs9999 »

ficolas wrote: AAAnd I "fixed" it. I placed a pump to see if it worked that way, and it does. The problem is that I had base_level = 1, in the output, but it needs to be base_level = -1,
Again, im leaving this here because maybe somebody needs this info too :)
That is weird... I had the same issue and resolved by changing the base-level the other way around ( from -1 to 1) :D

Please can a dev explain how this fluidbox stuff works? Also what is the base-area supposed to do?

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: I dont get it! (fluid boxes)

Post by ficolas »

Base level -1 means that it substracts from the entity liquid storage and puts it outside (output) and input is the other way arround
Specifying input/output migh just be for the arrows (I think you can have an input that outputs, not sure, but for example you can have a output that needs a pump to work, by setting base to 0)
The output/input needs to be multiple of 0.5 to work right with pipes, and be 0.5 far from the entity (the entity needs to be square or the input/output will get so far from the entity when rotating)

And if you want to create a new fluid go to prototypes-fluids, and for recipes prototypes/recipe/fluid recipes, and its quite easy to see from there.

If you set the heat of a liquid up by default, that liquid will worj as a "fuel" for the steam engine (so if I put my molten metals default temp to 1000+ that woulf make them so overpowered to run a steam engine, I think the steam engine will be able to produce even more than with water.

And a storage tank full of hot water can produce 85J (accumulator), this is quite random but is something I tested today, using water tanks as acumulators.
A water tank is better than a accumulator... I will try to make some crazy setup with this :D

Aaaand there goes most of what I know about liquids

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: I dont get it! (fluid boxes)

Post by drs9999 »

ficolas wrote:Base level -1 means that it substracts from the entity liquid storage and puts it outside (output) and input is the other way arround
Nope, I use base-level 1 for input and -1 for output and it works fine
ficolas wrote:Specifying input/output migh just be for the arrows
Well then this would be reduntant information, because you would get the same info from base-level
ficolas wrote:The output/input needs to be multiple of 0.5 to work right with pipes, and be 0.5 far from the entity (the entity needs to be square or the input/output will get so far from the entity when rotating)
Not sure about that, I believe it just has to be 0.5 bigger than the selection-box


EDIT: Forget the last point, you are right.

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: I dont get it! (fluid boxes)

Post by ficolas »

drs9999 wrote:
ficolas wrote:Base level -1 means that it substracts from the entity liquid storage and puts it outside (output) and input is the other way arround
Nope, I use base-level 1 for input and -1 for output and it works fine.
We said the same thing, 1 input and -1 output, I think you misreaded it.

Yea specifying input/output just because of arrows migh be rebundant, but it is what I think it is for, also it needs to be specified twice, not sure why.

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: I dont get it! (fluid boxes)

Post by drs9999 »

Derp, not misread but not written correctly...

I meant my inputs have base-level -1 and outputs have 1.

So I just did some tests.
I have a square-sized assembly.

I defined 2 inputs with base-level -1 @ bottom and 2 outputs with base-level 1 @ top. This config works fine and as expected.

If I switch the base-levels it will not work. Intresting is that if I switch inputs to top and outputs to bottom it will pump fluid into the assembly but will not output the results....

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: I dont get it! (fluid boxes)

Post by ficolas »

Yea Is true I mistaked when putting it, its output 1 and input -1.
I think its something about pressure, if it haves output 1 it means that it will make pressure for the liquid to go x tiles far, so if it is -1 and you add a pump, it will output, and if the input is 1, however, the liquid alredy haves a pressure, so it gets in without the machine needing to have pressure.

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: I dont get it! (fluid boxes)

Post by slpwnd »

Just got to the mods part of the forums after some time :/ I suppose you got the point of base_level by now.

The motivation is following: Fluid movement is based on the fluid column difference (and inertia). Fluid flows from fluid box with higher level to those with lower levels. Easy right :) However there are some special cases that need to be dealt with. For instance the chemical plant / oil refinery inputs should "consume all the liquid" that is coming in. That is why the concept of the base level was introduced. You can imagine that base_level -1 means that the fluid box is located 1m underground. This way anything coming from the pipe (no matter how low the fluid column is) will go in (and not back). The same works for base_level 1 or fluid box located 1m above the ground. It will always push the water to the connected pipe no matter how high the water level there is.

Post Reply

Return to “Modding help”