I pretty much designed the thing. It's all based on how the steam engine works.
There's 2 modes: Fuel value mode or Temperature mode.
The amount of fuel consumed (Like burner) is determined by the power consumption of the entity.
Lets start with an example:
Code: Select all
energy_source =
{
type = "fluid",
emissions = 0.1 / 6.5,
fluid_box =
{
base_area = 1,
height = 2,
base_level = -1,
pipe_connections =
{
{type = "input", position = {0, 1.5}}
},
pipe_covers = pipecoverspictures(),
pipe_picture = assembler2pipepictures(),
production_type = "input",
},
burns_fluid = true,
scale_fluid_usage = true,
smoke =
{
{
name = "smoke",
north_position = util.by_pixel(-38, -47.5),
south_position = util.by_pixel(38.5, -32),
east_position = util.by_pixel(20, -70),
west_position = util.by_pixel(-19, -8.5),
frequency = 15,
starting_vertical_speed = 0.0,
starting_frame_deviation = 60
}
}
}
Lets run through this line by line.
is optional, that's basically just to make smoke come out of the chimney of the boiler I borrowed this code from.
is pollution, same as burner.
is the standard fuel usage multiplier for efficiency.
needs to be defined, because that's how the fluid gets in. You can define it either as an input, or input-output if you want the fluid to flow through like on the steam engine. production_type and pipe_connections.type should match, but I've not done full testing what happens when they don't. Otherwise it's pretty much defined how else you'd do it on other entities.
set it to true to set fuel_value mode, false if you want steam mode.
... situational, if you define fluid_usage_per_tick to a value, and the fuel value of the fluid would result in more power than the entity demands, it uses less fluid. this also works with steam power in the same way but is also dependant on maximum_temperature
sets the maximum fluid usage per tick. if scale_fluid_usage is false, it always consumes this amount if needed or not.
must be present if burns_fluid = false, and just like on a steam engine, this is the temperature of steam the entity is designed to consume. if using colder steam, it will run at a slower speed, if using hotter steam and scale_fluid_usage = true, it will use less steam.
So a steam usage example would be...
Code: Select all
energy_source =
{
type = "fluid",
emissions = 0,
fluid_box =
{
base_area = 1,
height = 2,
base_level = -1,
pipe_connections =
{
{type = "input", position = {0, 1.5}}
},
pipe_covers = pipecoverspictures(),
pipe_picture = assembler2pipepictures(),
production_type = "input",
filter = "steam",
minimum_temperature = 100.0,
},
burns_fluid = false,
scale_fluid_usage = true,
maximum_temperature = 165,
smoke =
{
{
name = "light-smoke",
north_position = util.by_pixel(-38, -47.5),
south_position = util.by_pixel(38.5, -32),
east_position = util.by_pixel(20, -70),
west_position = util.by_pixel(-19, -8.5),
frequency = 10 / 32,
starting_vertical_speed = 0.08,
slow_down_factor = 1,
starting_frame_deviation = 60
}
},
}
The 2 unmentioned tags on the fluid_box as follows
filter = "steam",
minimum_temperature = 100.0
are taken basically just standard fluid box tags that you can use on any fluid box. in this case they're taken from the steam engine's input, and work fine on the energy source fluid box too.
For smoke, I've included steam as defined on the steam engine, but with the offsets of a boiler, so this would be suitable for the laughably silly steam powered boiler.
Hopefully these 2 examples explain everything you need to know.
Basically, the energy source needs a fluid box with an input, can use effectivity and emissions, defaults to burns_fluid = false, can use scale_fluid_usage which defaults to false and fluid_usage_per_tick that defaults to unlimited and needs maximum_temperature if burns_fluid is false.
Yeah, scale_fluid_usage which defaults to false and fluid_usage_per_tick that defaults to unlimited, so if you don't set either of them, it will destroy fluids. Personally, I set scale_fluid_usage to true, but if you want it to function like a steam engine and consume the right amount of steam for the job, you'd need to manually set fluid_usage_per_tick to give the amount of power required for the expected fuel source. for steam you have 200W per degree, so, 165 degree steam is (165 - 15) * 200 to give 30kW per unit of steam. if for example you're powering a 90kW machine, you want to use 3 units of steam PER SECOND, so it's fluid_usage_per_tick = 3/60, because the tag wants per tick, not per second. or you could define it as fluid_usage_per_tick = 0.05 (3/60 = 0.05)