Page 1 of 1

selection_priority does not always default to 50

Posted: Fri Feb 27, 2026 11:08 am
by Quezler
i ran into an issue working with loaders that their selection priority was 45 instead of the default/assumed 50.

we modders often use (entity.selection_priority or 50) + 1 to make sure something is above or below a certain entity, but there are a bunch of exceptions.

i found 3 of those that are documented, though one of which is an override:

https://lua-api.factorio.com/latest/pro ... n_priority
https://lua-api.factorio.com/latest/pro ... n_priority
https://lua-api.factorio.com/latest/pro ... n_priority

however as SelectionPriorities in EntityPrototype.hpp around line 513 suggests there are more exceptions, like 45 for belt stuff, 40 for ores, etc.

(and possibly mention that in entity-util.lua there's a premade list referencable by lua, i was not even aware it existed until the comment pointed it out)

Re: selection_priority does not always default to 50

Posted: Fri Feb 27, 2026 6:00 pm
by Osmo
entity-util.lua also says
editor_only = 20, -- entities not selectable by normal player (e.g. corpses, projectiles), but by editor in entity mode
It would be good if the treshold at which the entity becomes unselectable was documwnted as well

Re: selection_priority does not always default to 50

Posted: Fri Feb 27, 2026 9:38 pm
by Quezler
Osmo wrote: Fri Feb 27, 2026 6:00 pm entity-util.lua also says
editor_only = 20, -- entities not selectable by normal player (e.g. corpses, projectiles), but by editor in entity mode
It would be good if the treshold at which the entity becomes unselectable was documwnted as well
i was curious about that one too but from what i can find that treshold does not actually prevent an entity from being selected, they'd still need the `selectable_in_game = false` but it seems to be more of an internal convention to set those to selection priority 20.