Game find entities

Place to get help with not working mods / modding interface.
Post Reply
KaraUL!
Inserter
Inserter
Posts: 23
Joined: Sat Mar 21, 2015 7:59 pm
Contact:

Game find entities

Post 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?

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Game find entities

Post by prg »

Those functions are now in Surface.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

KaraUL!
Inserter
Inserter
Posts: 23
Joined: Sat Mar 21, 2015 7:59 pm
Contact:

Re: Game find entities

Post by KaraUL! »

prg wrote:Those functions are now in Surface.
Nice, thank you!

Post Reply

Return to “Modding help”