Fast way to find a spawner given an entire surface/force
Fast way to find a spawner given an entire surface/force
Any spawner will do. In all likellihood this would be similar to the internal code used by the artillery weaponry, which also find spawners - presumably without iterating across all entities on a surface.

Re: Fast way to find a spawner given an entire surface/force
art towers have a position and a radius so the area is clear - how you want to do that without position and radius though?
Re: Fast way to find a spawner given an entire surface/force
This prospective function could easily request that - though in my case, the radius would be infinity.dog80 wrote:art towers have a position and a radius so the area is clear - how you want to do that without position and radius though?
My point is that the artillery does not lag like a massive entity scan would, so they must use some internal game engine lookup that I would like exposed in the Scripting API.

Re: Fast way to find a spawner given an entire surface/force
The artillery scans 1 chunk per tick, slowly circling out from its own position, and searched the chunk for any targetsReika wrote:This prospective function could easily request that - though in my case, the radius would be infinity.dog80 wrote:art towers have a position and a radius so the area is clear - how you want to do that without position and radius though?
My point is that the artillery does not lag like a massive entity scan would, so they must use some internal game engine lookup that I would like exposed in the Scripting API.
I would say the fastest way is to just let the C++ do it, surface.find_entities_filtered{}
Re: Fast way to find a spawner given an entire surface/force
If you want to get ahold of me I'm almost always on Discord.
Re: Fast way to find a spawner given an entire surface/force
That is not useful to me, because I need to find a spawner specifically, not just any enemy (which in all likelihood is a unit).Rseding91 wrote:https://lua-api.factorio.com/latest/Lua ... rest_enemy

Re: Fast way to find a spawner given an entire surface/force
Then there's nothing that will do that. The closest is what the artillery does but it iterates chunks of entities at a time until it finds an entity in that chunk that's a spawner or turret.Reika wrote:That is not useful to me, because I need to find a spawner specifically, not just any enemy (which in all likelihood is a unit).Rseding91 wrote:https://lua-api.factorio.com/latest/Lua ... rest_enemy
If you want to get ahold of me I'm almost always on Discord.