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

Place to get help with not working mods / modding interface.
Post Reply
boonleboon
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Jul 19, 2019 1:47 am
Contact:

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

Post 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

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

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

Post by Koub »

[Koub] Moved to Modding help
Koub - Please consider English is not my native language.

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

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

Post 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

Post Reply

Return to “Modding help”