Optera wrote:You're very welcome.kyranzor wrote:Thanks Optera! That's handy info. Now I might be able to replace droids killed "unofficially" by the game cleanup script.Optera wrote: on_entity_died returns the entity which should hold a unique unit_number.
Using a metatable SquadsByUnitID = {[entity.unit_number], squadID} could give you instant access to the squad without iterating over every entity in every squad.
I hope modded biters have a unit_number. If not now seems to be a good time to ask for api enhancements.
unit entities have a unit_number
however I don't know if de-spawning units raise on_entity_died