Code: Select all
/c
local TypesWithHealth = {}
for _,prot in pairs(game.entity_prototypes) do
if prot.max_health ~= 0 then
TypesWithHealth[prot.type] = true
end
end
print(serpent.block(TypesWithHealth))
That list is longer than the one of entities without health though. So i wouldn't take any bets on that actually being faster than not filtering. Probably worth comparing with an inverted no-health filter too.
WithHealth:
Code: Select all
{
accumulator = true,
["ammo-turret"] = true,
["arithmetic-combinator"] = true,
["artillery-turret"] = true,
["artillery-wagon"] = true,
["assembling-machine"] = true,
beacon = true,
boiler = true,
["burner-generator"] = true,
car = true,
["cargo-wagon"] = true,
character = true,
["combat-robot"] = true,
["constant-combinator"] = true,
["construction-robot"] = true,
container = true,
["curved-rail"] = true,
["decider-combinator"] = true,
["electric-energy-interface"] = true,
["electric-pole"] = true,
["electric-turret"] = true,
fish = true,
["fluid-turret"] = true,
["fluid-wagon"] = true,
furnace = true,
gate = true,
generator = true,
["heat-interface"] = true,
["heat-pipe"] = true,
["infinity-container"] = true,
["infinity-pipe"] = true,
inserter = true,
lab = true,
lamp = true,
["land-mine"] = true,
["linked-container"] = true,
loader = true,
["loader-1x1"] = true,
locomotive = true,
["logistic-container"] = true,
["logistic-robot"] = true,
market = true,
["mining-drill"] = true,
["offshore-pump"] = true,
pipe = true,
["pipe-to-ground"] = true,
["player-port"] = true,
["power-switch"] = true,
["programmable-speaker"] = true,
pump = true,
radar = true,
["rail-chain-signal"] = true,
["rail-signal"] = true,
reactor = true,
roboport = true,
["rocket-silo"] = true,
["simple-entity"] = true,
["simple-entity-with-force"] = true,
["simple-entity-with-owner"] = true,
["solar-panel"] = true,
["spider-leg"] = true,
["spider-vehicle"] = true,
splitter = true,
["storage-tank"] = true,
["straight-rail"] = true,
["train-stop"] = true,
["transport-belt"] = true,
tree = true,
turret = true,
["underground-belt"] = true,
unit = true,
["unit-spawner"] = true,
wall = true
}
WithoutHealth:
Code: Select all
arrow = true,
["artillery-flare"] = true,
["artillery-projectile"] = true,
beam = true,
["character-corpse"] = true,
cliff = true,
corpse = true,
["deconstructible-tile-proxy"] = true,
["entity-ghost"] = true,
explosion = true,
fire = true,
["flame-thrower-explosion"] = true,
["flying-text"] = true,
["highlight-box"] = true,
["item-entity"] = true,
["item-request-proxy"] = true,
["leaf-particle"] = true,
particle = true,
["particle-source"] = true,
projectile = true,
["rail-remnants"] = true,
resource = true,
["rocket-silo-rocket"] = true,
["rocket-silo-rocket-shadow"] = true,
smoke = true,
["smoke-with-trigger"] = true,
["speech-bubble"] = true,
sticker = true,
stream = true,
["tile-ghost"] = true