Page 1 of 1

How do you check for certain entities in certain co-ordinates?

Posted: Fri Jul 19, 2019 1:51 am
by boonleboon
I'm trying to create a mod that uses tileable entities but I don't know how you can check to see if another entity is next to it or not.
Does anyone know how to do this?

Thanks

Re: How do you check for certain entities in certain co-ordinates?

Posted: Fri Jul 19, 2019 5:11 am
by Koub
[Koub] Moved to Modding help

Re: How do you check for certain entities in certain co-ordinates?

Posted: Fri Jul 19, 2019 6:49 pm
by slippycheeze
boonleboon wrote: Fri Jul 19, 2019 1:51 am I'm trying to create a mod that uses tileable entities but I don't know how you can check to see if another entity is next to it or not.
Does anyone know how to do this?

Thanks
You almost certainly want one of the "find_*" methods on the surface; please do consider if you can use the "find_non_colliding_position*" rather than finding the exact entities and implementing it in lua every time you use these tools.

https://lua-api.factorio.com/latest/LuaSurface.html