Page 1 of 1

[Resolved] How do I make a new liquid?

Posted: Thu Oct 27, 2016 10:48 pm
by Starfoth
I have tried searching for it and tried dissecting other mods that add liquids, but one issue remains; how do I make the graphic for it? Not the icon, I mean color the liquid a specific color? I can't find where that info is or where it is on the liquids lua file.

Re: How do I make a new liquid?

Posted: Fri Oct 28, 2016 2:46 am
by aubergine18
Here's an example of one of the existing liquids, they are all defined in data.raw.fluid

Note the base_color and flow_color properties:

Code: Select all

    {
      base_color = {
        b = 0,
        g = 0,
        r = 0
      },
      default_temperature = 25,
      flow_color = {
        b = 0.5,
        g = 0.5,
        r = 0.5
      },
      flow_to_energy_ratio = 0.59,
      heat_capacity = "1KJ",
      icon = "__base__/graphics/icons/fluid/crude-oil.png",
      max_temperature = 100,
      name = "crude-oil",
      order = "a[fluid]-b[crude-oil]",
      pressure_to_speed_ratio = 0.4,
      type = "fluid"
    },
So you'll need to make a table like that for your fluid, obviously with custom name, then

Code: Select all

data:extend{ your_liquid_table }
For example:

Code: Select all

data:extend {
    {
      base_color = {
        b = 0,
        g = 0,
        r = 0
      },
      default_temperature = 25,
      flow_color = {
        b = 0.5,
        g = 0.5,
        r = 0.5
      },
      flow_to_energy_ratio = 0.59,
      heat_capacity = "1KJ",
      icon = "__YourModName__/graphics/icons/fluid/your-liquid-name-here.png",
      max_temperature = 100,
      name = "your-liquid-name-here",
      order = "a[fluid]-b[crude-oil]",
      pressure_to_speed_ratio = 0.4,
      type = "fluid"
    },
}

Re: How do I make a new liquid?

Posted: Fri Oct 28, 2016 3:13 am
by Starfoth
Thank you again for your help