Page 1 of 1

Selection tool mode/filter for selecting only ghost entities

Posted: Thu Feb 27, 2020 4:42 am
by ceresward
Hi, I'm trying to make a custom selection-tool that only selects ghost entities, but it doesn't seem to be possible. There doesn't seem to be any sort of "ghost-entity" selection mode, so instead I tried using the "any-entity" selection mode combined with an entity type of "entity-ghost" in the entity type filters for my prototype. Unfortunately, this didn't work - the tool wouldn't select anything (and I did confirm it was in 'whitelist' mode!)

After experimenting some more, it seems to me like when the entity is a ghost entity, the selection-tool entity type filter matches against the ghost_type instead of the regular type, does this sound correct? Matching against the ghost_type makes sense for blueprint-like tools, but it doesn't work so well for what I'm trying to do...

I can think of two ways the API could be changed to solve my problem:
  1. Make the selection-tool entity type filter match against both the regular type and the ghost_type when considering ghost entities (i.e. make it so "entity-ghost" actually works as an entity type filter)
  2. Add a "ghost-entity" selection mode that I could use in place of "any-entity". I think this solution makes more sense, because the new selection mode could be further combined with an entity type filter if desired, e.g. to make a selection tool that selects only Roboport ghost entities.
Would it be possible to get one of these added to the mod API? Thank you for your consideration!

Re: Selection tool mode/filter for selecting only ghost entities

Posted: Thu Feb 27, 2020 1:08 pm
by Rseding91
I'm ok with adding a new filter for that, but how should it work with tile-ghosts? They are entities, but strictly related to tiles.

Re: Selection tool mode/filter for selecting only ghost entities

Posted: Thu Feb 27, 2020 4:07 pm
by ceresward
Hmm, I hadn't considered that. I guess for my purposes I'd want to include tile-ghost entities, I'm trying to select all the things that are awaiting construction by construction bots, which would include tile-ghosts.

Re: Selection tool mode/filter for selecting only ghost entities

Posted: Tue Nov 16, 2021 2:30 am
by Raiguard
+1 on this. I have a usecase for selecting ghosts. I propose three new selection modes: entity-ghost, tile-ghost, and any-ghost.