No Water, Just Coal - Steam Engine

Place to get help with not working mods / modding interface.
Petrenko
Inserter
Inserter
Posts: 32
Joined: Mon Mar 20, 2017 1:10 pm
Contact:

No Water, Just Coal - Steam Engine

Post by Petrenko »

Hello again,

i'd like to make a steam engine which doesn't need a water input but just get's coal insterted and burns it.

To be honest i just need this kind of logic. My plan is to simply burn a certain ressource in my mod and generate energy but without water or temperature requierement.

So far i looked into the steam engine and it nowhere specifies that it needs water. Makes me think i could boil any liquid and put it in there or, much more likely, i didn't find the right line which specifies the input. Maybe in another file? -> I downloaded a diesel generator mod and this one didn't specify it either.

Thanks in advance for any help =)
Yoyobuae
Filter Inserter
Filter Inserter
Posts: 511
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Yoyobuae »

Steam engine takes ANY liquid and tries to generate power off it. If liquid is heated then it generates some power, if liquid is at default temperature then it consumes the liquid without generating any power.

Steam engine is also the ONLY way to generate power from hot liquid input. And boiler is the ONLY way to heat liquids by burning fuel. So you have to use those two to generate power from burning fuel.

Diesel generator "cheats" by heating diesel "fuel" for free. It doesn't heat other types of liquid, but neither prevents them from entering the generator. So if your diesel gen gets full of water, for example, it will stop working until the water is removed.
Petrenko
Inserter
Inserter
Posts: 32
Joined: Mon Mar 20, 2017 1:10 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Petrenko »

Well fuck.

My idea was to have a house, the people who live in it will generate "workforce" (simply renaming energy would do the trick) when fed with water to drink, coal to cook and heat, and last but not least: potatoes.

So my idea was to use a steam engine that produces energy by consuming coal, water and potatoes.
Yoyobuae
Filter Inserter
Filter Inserter
Posts: 511
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Yoyobuae »

Petrenko wrote:So my idea was to use a steam engine that produces energy by consuming coal, water and potatoes.
Make an assembler which produces a hot liquid by consuming coal, water and potatos and connect it to a hidden steam engine entity.

Look at KS Power mod's oil boiler (burns oil to heat water). I guess I was wrong about boiler being the only way to heat liquids. xD

Hidden/invisible buildings is often how mods implement complex behavior into buildings.
Petrenko
Inserter
Inserter
Posts: 32
Joined: Mon Mar 20, 2017 1:10 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Petrenko »

I'm definetly going to look into this today :D

Thanks a lot for your help. I really like this community. =)

Also i hope to share all the code for just this single task, so anyone could easily copy this without fiddling it out of a huge mod. Wish me luck.
Petrenko
Inserter
Inserter
Posts: 32
Joined: Mon Mar 20, 2017 1:10 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Petrenko »

Alrighty,

i got the whole production set. Just a small problem.

My new factory will produce my new liquid. It accepts the recipe but the output is always water. The water is 100degree, as wished.

What i did:

1. Add a new fluid:

Code: Select all

local potatoesoup =
{
    type = "fluid",
    name = "potatoesoup",
    default_temperature = 100,
    max_temperature = 100,
    heat_capacity = "1KJ",
    base_color = {r=0,74, g=0.74, b=0.3},
    flow_color = {r=0.7, g=0.7, b=0.4},
    icon = "__robotarmy__/graphics/icons/potatoesoup.png",
    order = "a[fluid]-p[potatoesoup]",
    pressure_to_speed_ratio = 0.4,
    flow_to_energy_ratio = 0.59,
}
2. Add a recipe for the new fluid:

Code: Select all

  {
    type = "recipe",
    name = "potatoe_soup",
    energy_required = 1,
    enabled = "true",
    order = "b[fluid-chemistry]-f",
    category = "chemistry",
    ingredients =
    {
      {type="fluid", name="water", amount=60},
      {type="item", name="potatoe", amount=5},
      {type="item", name="coal", amount=1},
    },
      results = 
    {
        {type="fluid", name="potatoesoup", amount=60, temperature = 100},
      },
      main_product= "",
      icon = "__robotarmy__/graphics/icons/potatoe.png",
    subgroup = "fluid-recipes"
  },
3. Made a new factory:

Code: Select all

local kitchen_1 = 
{
    type = "assembling-machine",
    name = "kitchen_1",
    icon = "__base__/graphics/icons/assembling-machine-1.png",
    flags = {"placeable-neutral", "placeable-player", "player-creation"},
    minable = {hardness = 0.2, mining_time = 0.5, result = "kitchen_1_item"},
    max_health = 200,
    corpse = "big-remnants",
    dying_explosion = "medium-explosion",
    resistances =
    {
      {
        type = "fire",
        percent = 70
      }
    },
    fluid_boxes =
    {
      {
        production_type = "input",
        pipe_picture = assembler2pipepictures(),
        pipe_covers = pipecoverspictures(),
        base_area = 10,
        base_level = -1,
        pipe_connections = {{ type="input", position = {0, -5.8} }}
      },
      {
        production_type = "output",
        pipe_picture = assembler2pipepictures(),
        pipe_covers = pipecoverspictures(),
        base_area = 10,
        base_level = 1,
        pipe_connections = {{ type="output", position = {0, 5.5} }}
      },
      off_when_no_fluid_recipe = true
    },
    collision_box = {{-5.5, -5.5}, {5.5, 5.5}},
    selection_box = {{-5.5, -5.5}, {5.5, 5.5}},
    animation =
    {
      filename = "__robotarmy__/graphics/entity/kitchen/kitchen_1.png",
      priority="high",
      width = 650,
      height = 550,
        scale = 0.55,
      frame_count = 1,
      line_length = 1,
    },
    crafting_categories = {"chemistry"},
    crafting_speed = 0.5,
    energy_source =
    {
      type = "electric",
      usage_priority = "secondary-input",
      emissions = 0.05 / 1.5
    },
    energy_usage = "1kW",
    ingredient_count = 5,
    open_sound = { filename = "__base__/sound/machine-open.ogg", volume = 0.85 },
    close_sound = { filename = "__base__/sound/machine-close.ogg", volume = 0.75 },
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
      sound = {
        {
          filename = "__base__/sound/assembling-machine-t1-1.ogg",
          volume = 0.8
        },
        {
          filename = "__base__/sound/assembling-machine-t1-2.ogg",
          volume = 0.8
        },
      },
      idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
      apparent_volume = 1.5,
    }
}
Petrenko
Inserter
Inserter
Posts: 32
Joined: Mon Mar 20, 2017 1:10 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Petrenko »

Found the bug!

order = "b[fluid-chemistry]-f",

this shouldn't be around the potatoesoup since the potatoesoup already got a defined

order = "a[fluid]-p[potatoesoup]",

Aaaaand onto the next problem :D

The Steamengine i made works perfectly with water. It neglects potatoesoup though, even if it got the same values and of course a temperature of 100degree.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5401
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Klonan »

Petrenko wrote:Found the bug!

order = "b[fluid-chemistry]-f",

this shouldn't be around the potatoesoup since the potatoesoup already got a defined

order = "a[fluid]-p[potatoesoup]",

Aaaaand onto the next problem :D

The Steamengine i made works perfectly with water. It neglects potatoesoup though, even if it got the same values and of course a temperature of 100degree.

Steam engines create power based on the difference between default temperature and maximum temperature
Petrenko
Inserter
Inserter
Posts: 32
Joined: Mon Mar 20, 2017 1:10 pm
Contact:

Re: No Water, Just Coal - Steam Engine

Post by Petrenko »

Didn't know that.

Now everything works perfectly. Thanks a lot!
Post Reply

Return to “Modding help”