[0.18.8] find_enemy_units doesn't seem to work on other forces?
Posted: Tue Feb 25, 2020 4:06 am
I did the following to test:
Loaded up a vanilla game and ran this command:
/c game.player.print(serpent.block(game.player.surface.find_enemy_units(game.player.position, 1000)))
It found 2 entities.
Then I ran this command:
/c game.player.print(serpent.block(game.player.surface.find_enemy_units(game.player.position, 1000, "enemy")))
My expectation is that it would return 1 entity, the player character. But it returns nothing?
I found this while trying to switch from using find_nearest_enemy to find_enemy_units.
My use case is trying to find player-related units that are targets of the "enemy" force.
Loaded up a vanilla game and ran this command:
/c game.player.print(serpent.block(game.player.surface.find_enemy_units(game.player.position, 1000)))
It found 2 entities.
Then I ran this command:
/c game.player.print(serpent.block(game.player.surface.find_enemy_units(game.player.position, 1000, "enemy")))
My expectation is that it would return 1 entity, the player character. But it returns nothing?
I found this while trying to switch from using find_nearest_enemy to find_enemy_units.
My use case is trying to find player-related units that are targets of the "enemy" force.