Page 1 of 1

disabled_by_control_behavior inconsistency?

Posted: Mon Oct 06, 2025 10:41 pm
by Farzag
I am looking at a requester chest that has been disabled by a circuit condition, and I can tell that this is the case by checking whether chest.status == defines.entity_status.disabled_by_control_behavior. For the same chest, chest.disabled_by_control_behavior == false though, which seems inconsistent.

The docs say that the disabled_by_control_behavior field "Can only be used if this is UpdatableEntity", so maybe that is why? What is an UpdatableEntity?

Reference: https://lua-api.factorio.com/latest/cla ... l_behavior

Re: [2.0.69][Modding] disabled_by_control_behavior inconsistency?

Posted: Tue Oct 07, 2025 12:40 am
by Farzag
Why was this moved from bugs reports to modding help?

I think it’s a bug. If it’s not a bug, why does the behavior appear to be inconsistent?

Re: [2.0.69][Modding] disabled_by_control_behavior inconsistency?

Posted: Tue Oct 07, 2025 12:42 am
by Rseding91
The docs explain exactly why it works how it does except you don’t know what an UpdatableEntity is, so I moved it here for people to explain that modding concept.

Re: disabled_by_control_behavior inconsistency?

Posted: Tue Oct 07, 2025 8:50 am
by boskid
In short terms, an UpdatableEntity is an entity which returns `true` when reading LuaEntity::is_updatable.

LuaEntity::disabled_by_control_behavior is part of a bundle of reads (and one write) around UpdatableEntities so mods can query what is the exact reason that caused given updatable entity to not be active since there are 5 possible sources that force such entities to be inactive: disabling by script, disabling by behavior, being frozen, having an unresearched recipe set (used only by assemblers) or being marked to be deconstructed (some entities may opt out of this bit).

Since logistic containers are not updatable, reads of LuaEntity::disabled_by_control_behavior on them are meaningless.

Re: disabled_by_control_behavior inconsistency?

Posted: Tue Oct 07, 2025 5:24 pm
by Farzag
an UpdatableEntity is an entity which returns `true` when reading LuaEntity::is_updatable.
Thank you. It might be worth adding that to the docs, for example here: https://lua-api.factorio.com/latest/cla ... _updatable, since the term is used elsewhere in the docs.