[1.1.70] sometimes not finding ghosts -> find_entities_filtered{area=search_area.bounds, type="entity-ghost"}
Posted: Wed Oct 19, 2022 8:32 pm
found bug on Factorio 1.1.69 (build 60061, win64, steam), also tested on Factorio 1.1.70 (build 60152, win64, steam)
Sometimes not all entities are found, the missing ones are always larger than 1x1.
complete command:
local entities = search_area.surface.find_entities_filtered{area=search_area.bounds, type="entity-ghost"}
search_area is defined by
search_area = {
bounds=bounds,
inner_bounds=inner_bounds,
force=force,
surface=cell.owner.surface
}
cell is part of a logistic-network:
logisticNetwork = ghostScanner.entity.surface.find_logistic_network_by_position(ghostScanner.entity.position, ghostScanner.entity.force )
for _,cell in pairs(logisticNetwork.cells) do
if the roboport is destroyed and a new one is placed, it often works, magically, all entities are found. but if you place a new roboport next to it, then replace the old one, nothing will change.
mod used:
https://mods.factorio.com/mod/GhostScanner -> in version 1.6.5 line 269 in control.lua
or the attached rework of it -> line 404 in control.lua
Savegame: tiny test save with two logistic network zones, on the northern one (current focus) there are 6 solar panel ghosts, which are detected and 3 assembly machine ghosts which aren't. these 3 ghosts can be replaced by any 3x3 ghost and still not be detected. on another save I could also place 2x2 on the spot to not be detected, but not here.
Sometimes not all entities are found, the missing ones are always larger than 1x1.
complete command:
local entities = search_area.surface.find_entities_filtered{area=search_area.bounds, type="entity-ghost"}
search_area is defined by
search_area = {
bounds=bounds,
inner_bounds=inner_bounds,
force=force,
surface=cell.owner.surface
}
cell is part of a logistic-network:
logisticNetwork = ghostScanner.entity.surface.find_logistic_network_by_position(ghostScanner.entity.position, ghostScanner.entity.force )
for _,cell in pairs(logisticNetwork.cells) do
if the roboport is destroyed and a new one is placed, it often works, magically, all entities are found. but if you place a new roboport next to it, then replace the old one, nothing will change.
mod used:
https://mods.factorio.com/mod/GhostScanner -> in version 1.6.5 line 269 in control.lua
or the attached rework of it -> line 404 in control.lua
Savegame: tiny test save with two logistic network zones, on the northern one (current focus) there are 6 solar panel ghosts, which are detected and 3 assembly machine ghosts which aren't. these 3 ghosts can be replaced by any 3x3 ghost and still not be detected. on another save I could also place 2x2 on the spot to not be detected, but not here.