Priority of selecting

Place to get help with not working mods / modding interface.
Post Reply
Kalumniatoris
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Aug 21, 2014 11:08 am
Contact:

Priority of selecting

Post by Kalumniatoris »

Hello.

I would like to ask if there is way to set selecting priority of objects that are on the same tile (as example bot can be on same tile as Assembling Machine.)

I'd like to force that my object would be always selected before any other stationary object under.

I suppose that if there are problems with that in main game then it's probably impossible to achieve it in mod, at least in current version.
Thanks

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Priority of selecting

Post by ownlyme »

you can add selection_priority = 255 to your entity, then it should be always selectable
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Priority of selecting

Post by eradicator »

ownlyme wrote:
Fri Oct 12, 2018 7:59 am
got the same problem, i have a base entity and some entities placed on top of it, but both need to be selectable..
only the bottom entities can be selected, but not the ones in the middle or top
Nice necro. Four years is pretty impressive. :mrgreen:

You can specify LuaEntityPrototype.selection_priority in data stage if you want to force a single entity to the top like the OP wants. (see the wiki entry) Can also be used to push something down. Default value is 50, larger is up, smaller is down.

Selecting one of several overlapping entities isn't possible (if they have the same collision box size). You have to make them different sizes so that each has a point where it is on top.

Edit: I see you replaced your post while i wrote mine. 255 is a bit overboard, 51 would be sufficient, 55 or 60 if you have a number fetish :ugeek: .
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”