Page 1 of 1

Field to indicate entity is powered

Posted: Sun Oct 25, 2015 12:13 am
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.

Re: Field to indicate entity is powered

Posted: Fri Mar 11, 2022 11:15 pm
by curiosity
This seems to be exactly what LuaEntity::is_connected_to_electric_network does. The thread can be moved to implemented requests.