If you use a selection tool, you usually see icons of the selected entities. I've found that a selection tool I made will select a certain entity, but will not display its icon:
Directional Movement Vehicles. That mod changes data.raw["item-with-entity-data"].car.place_result to DMV's own prototype.
The prototype browser shows that "items to place this" (I suppose that would be entity.prototype.placed_by) is nil for the vanilla car:
Am I correct in supposing that no icon is shown for the selection because there is no item that can place the entity? Apparently, the car entity has an icon sprite -- why isn't that used instead? Is there anything I could do to get an icon of the vanilla car when it's selected with my tool? Having no visual feedback certainly is confusing, so I'd like to get it back.
The only solution I can think of is to make a copy of the item prototype (without a recipe to craft it, it should be hidden), and set its place_result to the vanilla entity. Is there a better way?
Both entities look like the vanilla car (data.raw.car.car), but only the one on the left really is -- the other one is a "spider-vehicle" under the hood, created by Selection tool shows no icon for selected entity
Selection tool shows no icon for selected entity
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Selection tool shows no icon for selected entity
That is indeed exactly what that is checked. (And if there are items to place it, it only takes the first item for the icon.)Pi-C wrote: Fri Jul 22, 2022 6:55 pm Am I correct in supposing that no icon is shown for the selection because there is no item that can place the entity?
I don't know the answer to this, but maybe a modding interface request could help.Pi-C wrote: Fri Jul 22, 2022 6:55 pm Apparently, the car entity has an icon sprite -- why isn't that used instead? Is there anything I could do to get an icon of the vanilla car when it's selected with my tool? Having no visual feedback certainly is confusing, so I'd like to get it back.
The only solution I can think of is to make a copy of the item prototype (without a recipe to craft it, it should be hidden), and set its place_result to the vanilla entity. Is there a better way?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Selection tool shows no icon for selected entity
Thanks for your answer! Currently, I use this workaround:Bilka wrote: Mon Aug 01, 2022 1:11 pmThat is indeed exactly what that is checked. (And if there are items to place it, it only takes the first item for the icon.)Pi-C wrote: Fri Jul 22, 2022 6:55 pm Am I correct in supposing that no icon is shown for the selection because there is no item that can place the entity?
Code: Select all
local items = data.raw["item-with-entity-data"]
for c, car in pairs(data.raw.car) do
placed_by = car.placeable_by and car.placeable_by.item or car.name
to_place = items[placed_by] and items[placed_by].place_result
if to_place and to_place ~= placed_by then
new_item = table.deepcopy(items[placed_by])
new_item.name = "GCKI-dummy-item_"..new_item.name
new_item.place_result = car.name
data:extend({new_item})
end
end
Thanks, we'll see about that. I've just made that request.I don't know the answer to this, but maybe a modding interface request could help.Pi-C wrote: Fri Jul 22, 2022 6:55 pm Apparently, the car entity has an icon sprite -- why isn't that used instead?

A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!