Iterating through entities in the loaded map

Place to get help with not working mods / modding interface.
Post Reply
User avatar
durodur
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed May 02, 2018 10:34 pm
Contact:

Iterating through entities in the loaded map

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

betrok
Fast Inserter
Fast Inserter
Posts: 101
Joined: Wed Feb 28, 2018 12:08 pm
Contact:

Re: Iterating through entities in the loaded map

Post by betrok »

Iterate over game.surfaces and use find_entities_filtered

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Iterating through entities in the loaded map

Post 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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Post Reply

Return to “Modding help”