Page 1 of 1

Finding any entity at an exact location

Posted: Thu Jun 21, 2018 4:24 pm
by beefex
Hi, I am probably missing something and there is a function for this. I need to find an entity at an exact spot, exactly what LuaSurface.find_entity does. But I need to be able to find any entity, or entity of specific type. Is there a way to do this without having to use LuaSurface.find_entities_filtred?
Thanks
BeefEX

Re: Finding any entity at an exact location

Posted: Thu Jun 21, 2018 5:02 pm
by eradicator
beefex wrote:Is there a way to do this without having to use LuaSurface.find_entities_filtred?
Why do you need that?

Re: Finding any entity at an exact location

Posted: Thu Jun 21, 2018 5:47 pm
by beefex
Because I need to check if there is an object of a type at a certain position. And all I know is the prototype/type name, not the actual entity name.

Re: Finding any entity at an exact location

Posted: Thu Jun 21, 2018 5:49 pm
by eradicator

Code: Select all

LuaSurface.find_entities_filtered{position=your_position,type=your_type}
API Documentation on LuaSurface.find_entities_filtered

Re: Finding any entity at an exact location

Posted: Thu Jun 21, 2018 5:55 pm
by beefex
Okay, didn't realize I can use that one to search just one position. Thank you