Hi there,
is there a way to get an entity by its unit_number like:
local myentity = surface.entities[777]
or
local myentity = surface.find_entity(unit_number = 777)
Thanks in advance
Zephir
Get entity by unit_number
Re: Get entity by unit_number
Nope, and it wouldn't be any faster then doing it yourself with find_entities and checking for unit_numbers.
Best thing to do would be to store the entity in your global table indexed by its unit number.
Best thing to do would be to store the entity in your global table indexed by its unit number.
Re: Get entity by unit_number
Thanks for the answer, I did this now, I thought this would be easier and less storage consuming.