Field to indicate entity is powered

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Field to indicate entity is powered

Post by Afforess »

I've not seen a field so far that will detect if an entity has access to power or not. I am trying to detect if a laser turret is currently powered or unpowered, but I imagine the usefulness is much more broad than that.

Maybe it should be a float instead of a boolean to indicate the percentage powered, as I know the grid can fluctuate and partially power some items. Not sure exactly how that is handled.

Thoughts?

Edit:

Based on IRC conversation with Rseding91, a field to indicate if the entity is connected to a power grid capable of producing energy would also suffice.
curiosity
Filter Inserter
Filter Inserter
Posts: 476
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Field to indicate entity is powered

Post by curiosity »

This seems to be exactly what LuaEntity::is_connected_to_electric_network does. The thread can be moved to implemented requests.
Post Reply

Return to “Implemented mod requests”