runtime access to fusion reactor/generator properties

SWeini
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Mon Apr 04, 2022 6:43 am
Contact:

runtime access to fusion reactor/generator properties

Post by SWeini »

I'd like to have access to these properties in runtime stage:

Fusion Reactor:
https://lua-api.factorio.com/latest/pro ... onnectable
https://lua-api.factorio.com/latest/pro ... bour_bonus (can probably use the existing reactor-only property)
https://lua-api.factorio.com/latest/pro ... ower_input
https://lua-api.factorio.com/latest/pro ... luid_usage (probably as get_...(quality) method)

Fusion Generator:
https://lua-api.factorio.com/latest/pro ... luid_usage (probably as get_...(quality) method)

these are needed to calculate the production rates of fusion reactors and fusion generators (I think that is all, but I might be missing something)
Rseding91
Factorio Staff
Factorio Staff
Posts: 15867
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: runtime access to fusion reactor/generator properties

Post by Rseding91 »

I've added the missing ones for the next release.
If you want to get ahold of me I'm almost always on Discord.
SWeini
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Mon Apr 04, 2022 6:43 am
Contact:

Re: runtime access to fusion reactor/generator properties

Post by SWeini »

Rseding91 wrote: Wed Jun 11, 2025 1:44 pm I've added the missing ones for the next release.
I still can't find these properties:
- FusionReactorPrototype.neighbour_connectable
- FusionReactorPrototype.max_fluid_usage
Rseding91
Factorio Staff
Factorio Staff
Posts: 15867
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: runtime access to fusion reactor/generator properties

Post by Rseding91 »

Fluid usage is here: https://lua-api.factorio.com/latest/cla ... e_per_tick

Neighbor connectable I didn't include - what's the point in having it?
If you want to get ahold of me I'm almost always on Discord.
SWeini
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Mon Apr 04, 2022 6:43 am
Contact:

Re: runtime access to fusion reactor/generator properties

Post by SWeini »

Rseding91 wrote: Fri Jun 20, 2025 12:38 am Fluid usage is here: https://lua-api.factorio.com/latest/cla ... e_per_tick

Neighbor connectable I didn't include - what's the point in having it?
Fluid usage works for fusion generator (even though the documentation doesn't say so) but always returns nil for fusion reactor (even though the documentation says it is available)

The connectables are needed to calculate max neighbour bonus (especially for ghosts and entities marked for upgrade)
LuaEntity::neighbours does not work for those cases, and LuaEntity::neighbour_bonus would not help, even if it did work for fusion reactors

It's actually quite a lot of code to calculate whether two entities connect. I could also use a function like this if it existed:
are_connected(prototype_a, position_a, orientation_a, prototype_b, position_b, orientation_b) → boolean
but I doubt you want to add such a function
Rseding91
Factorio Staff
Factorio Staff
Posts: 15867
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: runtime access to fusion reactor/generator properties

Post by Rseding91 »

Ok, I added it for the next release.
If you want to get ahold of me I'm almost always on Discord.
SWeini
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Mon Apr 04, 2022 6:43 am
Contact:

Re: runtime access to fusion reactor/generator properties

Post by SWeini »

Rseding91 wrote: Sun Jun 22, 2025 7:28 pm Ok, I added it for the next release.
Thanks for adding neighbour_connectable. Unfortunately I still don't have access to fluid usage of fusion reactors, see my last post. Bug or feature request?
Rseding91
Factorio Staff
Factorio Staff
Posts: 15867
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: runtime access to fusion reactor/generator properties

Post by Rseding91 »

https://lua-api.factorio.com/latest/cla ... e_per_tick It is there in the experimental version.

Correction, it will be there for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Implemented mod requests”