find_entities_filtered question

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1456
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

find_entities_filtered question

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15965
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: find_entities_filtered question

Post 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.
If you want to get ahold of me I'm almost always on Discord.
kinnom
Filter Inserter
Filter Inserter
Posts: 706
Joined: Fri Dec 26, 2014 4:20 pm
Contact:

Re: find_entities_filtered question

Post by kinnom »

Rseding91 wrote:No, Factorio has no concept of circles.
cough cough turret range cough
no yes yes no yes no yes yes
Rseding91
Factorio Staff
Factorio Staff
Posts: 15965
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: find_entities_filtered question

Post 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 :)
If you want to get ahold of me I'm almost always on Discord.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1456
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: find_entities_filtered question

Post by TheSAguy »

Thanks for the response.
Post Reply

Return to “Modding help”