More info for fluid generators

Post Reply
vamaelo
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Aug 06, 2019 11:10 am
Contact:

More info for fluid generators

Post 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.

pyrether
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Aug 15, 2021 2:14 pm
Contact:

Re: More info for fluid generators

Post 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.

User avatar
KiwiHawk
Filter Inserter
Filter Inserter
Posts: 254
Joined: Thu Jul 05, 2018 9:48 am
Contact:

Re: More info for fluid generators

Post 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
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.

Buy me a coffee

User avatar
KiwiHawk
Filter Inserter
Filter Inserter
Posts: 254
Joined: Thu Jul 05, 2018 9:48 am
Contact:

Re: More info for fluid generators

Post 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.
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.

Buy me a coffee

curiosity
Filter Inserter
Filter Inserter
Posts: 324
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: More info for fluid generators

Post by curiosity »

Nexela told me the other day that he PRed it.

User avatar
KiwiHawk
Filter Inserter
Filter Inserter
Posts: 254
Joined: Thu Jul 05, 2018 9:48 am
Contact:

Re: More info for fluid generators

Post 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
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.

Buy me a coffee

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

Re: More info for fluid generators

Post by Bilka »

This has been added in the next release (1.1.57).
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
KiwiHawk
Filter Inserter
Filter Inserter
Posts: 254
Joined: Thu Jul 05, 2018 9:48 am
Contact:

Re: More info for fluid generators

Post 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
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.

Buy me a coffee

curiosity
Filter Inserter
Filter Inserter
Posts: 324
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: More info for fluid generators

Post 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.

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

Re: More info for fluid generators

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”