Page 1 of 1

[solved] "position" parameter of find_entities_filtered

Posted: Wed Oct 26, 2016 10:32 pm
by TheEdenCrazy
I would like to ask what does the "position" parameter of the LuaSurface::find_entities_filtered method actually does in the following cases:
-There is a position AND an area present in the table
-There is ONLY a position present in the table (this is the most important as I need to find all entities that cover a certain tile/position).
since on the documentation (http://lua-api.factorio.com/latest/LuaS ... s_filtered) it doesn't actually say.

Note that find_entity will not work since that requires a specific type of entity.

Re: "position" parameter of LuaSurface::find_entities_filtered

Posted: Thu Oct 27, 2016 1:55 am
by Rseding91
If both a position and an area are defined it uses the position.

If just the position is defined it returns anything that collides with that position.

Re: "position" parameter of LuaSurface::find_entities_filtered

Posted: Thu Oct 27, 2016 5:46 pm
by TheEdenCrazy
Thanks. That's how I was going to use it, so it does follow the behaviour I expected :) (as well as making the code for the mod much simpler.)