Page 1 of 1

Priority of selecting

Posted: Thu Aug 21, 2014 11:34 am
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

Re: Priority of selecting

Posted: Fri Oct 12, 2018 7:59 am
by ownlyme
you can add selection_priority = 255 to your entity, then it should be always selectable

Re: Priority of selecting

Posted: Fri Oct 12, 2018 8:08 am
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: .