Selection tool mode/filter for selecting only ghost entities

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
ceresward
Inserter
Inserter
Posts: 21
Joined: Mon Dec 18, 2017 8:45 pm
Contact:

Selection tool mode/filter for selecting only ghost entities

Post 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!

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

ceresward
Inserter
Inserter
Posts: 21
Joined: Mon Dec 18, 2017 8:45 pm
Contact:

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

Post 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.

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 450
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

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

Post 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.
Don't forget, you're here forever.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

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

Post by PFQNiet »

Just encountered this while trying to make a "cheat tool" to revive ghosts in a selected area. Current workaround is to select anything and then test whether the entity is actually a ghost before reviving, which is obviously suboptimal.

+1

Post Reply

Return to “Modding interface requests”