Page 1 of 1

Make LuaEntity::selection_priority modifiable at runtime

Posted: Wed Mar 05, 2025 1:54 pm
by braxbro
Currently, the selection priority of an entity is set in the prototype and cannot be changed at runtime. However, with the creation of elevated rails and the inability to interact directly with things underneath said elevated rails, there is now a base-game need for the ability to either ignore specific entity types when selecting entities or adjust selection priorities at runtime.

This would also enable mods with similar layered construction more easily.

I propose handling this through simply making the selection_priority modifiable at runtime. (or possibly giving players a list of ignored entity prototypes for selection?) This would allow for flexible custom solutions to these problems, among other ideas I'm sure mod developers would come up with.

Re: Make LuaEntity::selection_priority modifiable at runtime

Posted: Wed Mar 05, 2025 4:28 pm
by protocol_1903
Perhaps having a per-player property, modifiable by mods, to ignore selection boxes of a specified priority range, or of specific flags? That way you could just ignore the elevated rails, or just ignore belts, etc

Re: Make LuaEntity::selection_priority modifiable at runtime

Posted: Thu Mar 06, 2025 1:37 am
by curiosity
Yes, putting this into entity seems like a wrong approach to the problem.