Steam recipe

Place to get help with not working mods / modding interface.
Post Reply
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Steam recipe

Post by darkfrei »

Hi all! How the game makes steam?

I've wrote this debug code:

Code: Select all

-- is possible to make it?
local bad_list = {}
for key, ingredients_list in pairs (all_ingredients) do
  for i, ingredient_name in pairs (ingredients_list) do
    if all_results and all_results[key] then
      if not (is_value_in_list (ingredient_name, all_results[key])) then
        if not bad_list[key] then bad_list[key] = {} end
        bad_list[key][#bad_list[key]+1] = ingredient_name
      end
    end
  end
end

log ('bad_list: ' .. serpent.block (bad_list))
And get items and fluids, that can't be produced in the game (vanilla 0.16.36, data.lua):

Code: Select all

bad_list: {
  fluid = {
    "crude-oil",
    "water",
    "steam"
  },
  item = {
    "copper-ore",
    "iron-ore",
    "stone",
    "raw-wood",
    "coal",
    "uranium-ore",
    "used-up-uranium-fuel-cell"
  }
}
And here is no steam recipe definition in data.raw.
Attachments
data.lua
(2.5 KiB) Downloaded 52 times

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Steam recipe

Post by eradicator »

The boiler and heat-exachanger have

Code: Select all

output_fluid_box.filter = "steam"
that might be related?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Steam recipe

Post by darkfrei »

eradicator wrote:The boiler and heat-exachanger have

Code: Select all

output_fluid_box.filter = "steam"
that might be related?
Ohh, yes.

Code: Select all

for t_name, t_prot in pairs (data.raw) do
  for e_name, e_prot in pairs (t_prot) do
    if e_prot.fluid_box and e_prot.fluid_box.filter and e_prot.fluid_box.filter == "steam" then
      log ('fluid_box '..t_name .. ' ' .. e_name .. ' - success')
      e_prot.fluid_box.filter = "crude-oil"
    end        
    if e_prot.output_fluid_box and e_prot.output_fluid_box.filter and e_prot.output_fluid_box.filter == "steam" then
      log ('output_fluid_box '..t_name .. ' ' .. e_name .. ' - success')
      e_prot.output_fluid_box.filter = "crude-oil"
    end
  end
end
Now this boiler makes crude oil. But generator can't produce electricity with this fluid.
Attachments
2018-04-22 14_19_18.png
2018-04-22 14_19_18.png (89.66 KiB) Viewed 1087 times
BoiledOil_0.0.1.zip
For 0.16
(799 Bytes) Downloaded 53 times

Bilka
Factorio Staff
Factorio Staff
Posts: 3139
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Steam recipe

Post by Bilka »

darkfrei wrote:Now this boiler makes crude oil. But generator can't produce electricity with this fluid.
Give the fluid a fuel_value and it can. KS Power and bobs both use that mechanic, if you need inspiration.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Steam recipe

Post by bobingabout »

I would sugest a fuel_value of 3.8MJ. because, IRL fuel value of the fluid is around 38MJ/kg, and before the x10 on everything, 1 unit of fluid was 1kg, so it's currently 1 unit of fluid being about 100g.

but since the base game steam engine produces 900kW of power, that basically means you want to be consuming around a quater of a unit of fluid a second.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Post Reply

Return to “Modding help”