Page 1 of 1
More info for fluid generators
Posted: Mon Mar 16, 2020 3:29 am
by vamaelo
The new fluid_energy_source_prototype API is ideal for most entities. Unfortunately, it doesn't seem to work for generators because generators always have an electric energy source. The entity prototype already has fluid_usage_per_tick, maximum_temperature, and effectivity for generators, but it's lacking burns_fluid, scale_fluid_usage, and max_power_output. Would it be possible to expose this information somehow?
This information is useful for mods that want to calculate a generator's actual or theoretical fluid consumption and power output. The simplest example is a mod like MaxRateCalculator where you drag a box around a group of entities, and it lists the input rates, output rates, and power consumed/produced.
Re: More info for fluid generators
Posted: Sun Aug 15, 2021 2:40 pm
by pyrether
Hello,
I find myself in need of the same information mentioned by vamaelo (burns_fluid, scale_fluid_usage) on the LuaEntityPrototype; planners like Helmod (tyvm Helfima, btw) lack this for correct fluid usage calculations on the generator entity prototypes.
First idea would be to introduces the mentioned properties on the LuaEntityPrototype; naturally, this increases the complexity of the interface (for this need, which is rather specific).
Second idea would be to take the same approach as for the burner_prototype; introduce a new class LuaGeneratorPrototype which would contain the above-mentioned properties, accessible through LuaEntityPrototype via a generator_prototype property.
Do let us know if there's another way to access the needed information - we thank you kindly, in advance.
Re: More info for fluid generators
Posted: Sun Jan 02, 2022 6:50 am
by KiwiHawk
Is it possible for a
LuaEntityPrototype to have a
fluid_energy_source_prototype as well as an
electric_energy_source_prototype? If so, then there would be no addition to the API.
I'm working on a PR for Helmod and am a bit stuck without being able to access this information.
This is a request for an expansion on an implemented request:
viewtopic.php?f=65&t=78211
Re: More info for fluid generators
Posted: Tue Mar 15, 2022 8:01 am
by KiwiHawk
Another option would be to add burns_fluid to LuaEntityPrototype. Currently there is no way to differentiate at control stage between a steam engine and a fluid burning generator.
Re: More info for fluid generators
Posted: Tue Mar 15, 2022 10:58 am
by curiosity
Nexela told me the other day that he PRed it.
Re: More info for fluid generators
Posted: Tue Mar 15, 2022 8:45 pm
by KiwiHawk
curiosity wrote: ↑Tue Mar 15, 2022 10:58 am
Nexela told me the other day that he PRed it.
Really? That would be great!
Fingers crossed that it gets accepted
Re: More info for fluid generators
Posted: Tue Mar 15, 2022 9:08 pm
by Bilka
This has been added in the next release (1.1.57).
Re: More info for fluid generators
Posted: Tue Mar 29, 2022 11:04 pm
by KiwiHawk
Bilka wrote: ↑Tue Mar 15, 2022 9:08 pm
This has been added in the next release (1.1.57).
Seems that this was missed from the changelog
Re: More info for fluid generators
Posted: Wed Mar 30, 2022 7:07 pm
by curiosity
KiwiHawk wrote: ↑Tue Mar 29, 2022 11:04 pm
Seems that this was missed from the changelog
A lot of Nexela's PRs didn't make it to the changelog, AFAICT.
Re: More info for fluid generators
Posted: Thu Mar 31, 2022 3:56 pm
by Bilka
curiosity wrote: ↑Wed Mar 30, 2022 7:07 pm
A lot of Nexela's PRs didn't make it to the changelog, AFAICT.
That is incorrect, only the changelog for this forum thread was forgotten. The changelog line would have been:
Added LuaEntityPrototoype::burns_fluid, scale_fluid_usage, destroy_non_fuel_fluid, and max_power_output read.