[solved] "position" parameter of find_entities_filtered

Place to get help with not working mods / modding interface.
TheEdenCrazy
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Jul 22, 2016 7:27 am
Contact:

[solved] "position" parameter of find_entities_filtered

Post 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.
Last edited by TheEdenCrazy on Thu Oct 27, 2016 5:48 pm, edited 1 time in total.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14373
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: "position" parameter of LuaSurface::find_entities_filtered

Post 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.
If you want to get ahold of me I'm almost always on Discord.
TheEdenCrazy
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Jul 22, 2016 7:27 am
Contact:

Re: "position" parameter of LuaSurface::find_entities_filtered

Post 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.)
Post Reply

Return to “Modding help”