Page 1 of 1

[0.15.12] Find_entities_filtered does not find fire or smoke

Posted: Sat May 20, 2017 5:59 am
by SilverB1rd
This code will return fire and smoke entities when they are within the search area

Code: Select all

local pos = entity.position
			local size = 5
			local area = {{pos.x -size, pos.y-size},{pos.x +size, pos.y+size}}
			local flames = entity.surface.find_entities(area)
			for _, f in pairs(flames) do
				log(f.type)
			end
This code does not return fire or smoke elements.

Code: Select all

local flames = surface.find_entities_filtered{position = entity.position, area = {{-5,-5}, {5,5}}}
			for _, f in pairs(flames) do
				log(f.type)
			end
Adding the type="fire" does not change the results.

Expected result:
find_entities_filtered should be able to find fire and smoke elements.

Re: [0.15.12] Find_entities_filtered does not find fire or smoke

Posted: Sat May 20, 2017 6:45 am
by Rseding91
You've defined position and area and the game uses position over area so it's searching the exact position.

Position based search doesn't find zero-bounding box sized entities so it doesn't show up.

Re: [0.15.12] Find_entities_filtered does not find fire or smoke

Posted: Sat May 20, 2017 9:30 am
by Nexela
You've defined position and area and the game uses position over area so it's searching the exact position.

Position based search doesn't find zero-bounding box sized entities so it doesn't show up.
Rseding Can you add that as a note on http://lua-api.factorio.com/latest/LuaS ... s_filtered?

Re: [0.15.12] Find_entities_filtered does not find fire or smoke

Posted: Sat May 20, 2017 5:06 pm
by Rseding91
Yeah I'll do that.