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
Finding any entity at an exact location
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Finding any entity at an exact location
Why do you need that?beefex wrote:Is there a way to do this without having to use LuaSurface.find_entities_filtred?
Re: Finding any entity at an exact location
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.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Finding any entity at an exact location
Code: Select all
LuaSurface.find_entities_filtered{position=your_position,type=your_type}
Re: Finding any entity at an exact location
Okay, didn't realize I can use that one to search just one position. Thank you