Page 1 of 1

Iterating through entities in the loaded map

Posted: Wed May 02, 2018 11:13 pm
by durodur
Hey, sorrry this probably seems simple, but how do you iterate through all entities in map of a certain name. Is that what game.get_entity_by_tag does? is tag an index?

Re: Iterating through entities in the loaded map

Posted: Wed May 02, 2018 11:31 pm
by betrok
Iterate over game.surfaces and use find_entities_filtered

Re: Iterating through entities in the loaded map

Posted: Thu May 03, 2018 8:22 am
by bobingabout
yeah, this one isn't exactly as straight forward as you would expect it to be.

the command to do what you want only exists as it does because I requested it, before that, you had to define which area you wanted to search too, so the easiest way was to search chunk by chunk, so there would have been an extra step to it.