Page 1 of 1

Game find entities

Posted: Fri Feb 26, 2016 6:42 pm
by KaraUL!
In previous versions of Factorio we had lua.game methods "game.findentities" and "game.findentitiesfiltered". In current vers it doesnot work, and i didnt find this methods (or another methods, that can do the same) in Lua.Game docs. I used this e.g. this way:

Code: Select all

game.on_event(defines.events.on_chunk_generated, function(event)
	local tree = game.find_entities_filtered{area = event.area, type= "tree"}
How can i do this in new version?

Re: Game find entities

Posted: Fri Feb 26, 2016 7:09 pm
by prg
Those functions are now in Surface.

Re: Game find entities

Posted: Fri Feb 26, 2016 7:54 pm
by KaraUL!
prg wrote:Those functions are now in Surface.
Nice, thank you!