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)
runtime access to fusion reactor/generator properties
Re: runtime access to fusion reactor/generator properties
I stand corrected, https://lua-api.factorio.com/latest/pro ... ower_input is already available via https://lua-api.factorio.com/latest/cla ... ergy_usage
Re: runtime access to fusion reactor/generator properties
I've added the missing ones for the next release.
If you want to get ahold of me I'm almost always on Discord.
Re: runtime access to fusion reactor/generator properties
I still can't find these properties:
- FusionReactorPrototype.neighbour_connectable
- FusionReactorPrototype.max_fluid_usage
Re: runtime access to fusion reactor/generator properties
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?
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.
Re: runtime access to fusion reactor/generator properties
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)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?
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
Re: runtime access to fusion reactor/generator properties
Ok, I added it for the next release.
If you want to get ahold of me I'm almost always on Discord.
Re: runtime access to fusion reactor/generator properties
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?
Re: runtime access to fusion reactor/generator properties
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.
Correction, it will be there for the next release.
If you want to get ahold of me I'm almost always on Discord.