Fluid Prototypes

Place to get help with not working mods / modding interface.
DopplerEffect
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Jan 13, 2015 9:44 pm
Contact:

Fluid Prototypes

Post by DopplerEffect »

When creating a new fluid prototype, is it possible to set which tab and subgroup it appears in (similar to how an item has a subgroup property) or are they always going to appear in the fluid subgroup of the intermediate products tab?

Thanks
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Fluid Prototypes

Post by FreeER »

It's done the same way as items (giving the fluid/item a subgroup property equal to the name of the subgroup you want it to be in, the group that the subgroup is a part of determines the specific tab and the subgroup, more specifically the subgroup's 'order' property + the item/fluid's order property, determines where in the tab).

The 'testFluid' shown below (a copy/paste of base lubricant) will show up in the tool subgroup (which is a subgroup of the 'production' item-group).

For further reference look at the base game in data/base/prototypes/item/item-groups.lua (includes prototypes for the 'fluid' item-subgroup and it's parent item-group 'intermediate-products') and data/base/prototypes/fluid/fluid.lua (lubricant fluid prototype) and data/base/prototypes/recipe/fluid-recipe.lua (lubricant recipe prototype).

Code: Select all

{
    type = "fluid",
    name = "testFluid",
    default_temperature = 25,
    heat_capacity = "1KJ",
    base_color = {r=0.4, g=0.6, b=0.4},
    flow_color = {r=0.5, g=0.5, b=0.5},
    subgroup = "tool",
    max_temperature = 100,
    icon = "__base__/graphics/icons/fluid/lubricant.png",
    pressure_to_speed_ratio = 0.4,
    flow_to_energy_ratio = 0.59,
    order = "e[lubricant]",
  },
  {
    type = "recipe",
    name = "testFluid",
    category = "chemistry",
    enabled = true,
    energy_required = 1,
    ingredients = {},
    results=
    {
      {type="fluid", name="testFluid", amount=1}
    }
  }
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net
DopplerEffect
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Jan 13, 2015 9:44 pm
Contact:

Re: Fluid Prototypes

Post by DopplerEffect »

Alright, thanks for the reply. Wasn't sure considering the fluids in the base mod do not have a subgroup property
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Fluid Prototypes

Post by FreeER »

No problem, I wasn't certain myself, so I checked for a fluid-group file (I knew there was an item-group one), didn't see one so checked the file that listed the item-groups for 'fluid' and, after seeing it there, tested by adding subgroup to a fluid :)
Post Reply

Return to “Modding help”