Page 1 of 1

find_entities_filtered question

Posted: Thu Jul 14, 2016 7:32 pm
by TheSAguy
Hi,

Does the "area" on find_entities_filtered have to be a square or can I make it a circle?
I currently have:

Code: Select all

items = collector.surface.find_entities_filtered({area = {{x = collector.position.x - artifactCollectorRadius, y = collector.position.y - artifactCollectorRadius}, {x = collector.position.x + artifactCollectorRadius, y = collector.position.y + artifactCollectorRadius}}, name = "item-on-ground"})
But would like to make the area just the circle radius of artifactCollectorRadius.

Is that possible?

Thanks.

Re: find_entities_filtered question

Posted: Thu Jul 14, 2016 8:45 pm
by Rseding91
No, Factorio has no concept of circles.

You'd need to get everything in the square and then check yourself if it's within a specific radius.

Re: find_entities_filtered question

Posted: Thu Jul 14, 2016 9:01 pm
by kinnom
Rseding91 wrote:No, Factorio has no concept of circles.
cough cough turret range cough

Re: find_entities_filtered question

Posted: Thu Jul 14, 2016 9:39 pm
by Rseding91
kinnom wrote:
Rseding91 wrote:No, Factorio has no concept of circles.
cough cough turret range cough
And internally they do just what I said :)

Re: find_entities_filtered question

Posted: Thu Jul 14, 2016 9:40 pm
by TheSAguy
Thanks for the response.