Page 1 of 1

Add unit_number or other unique id to spider-legs

Posted: Thu Jan 13, 2022 4:21 am
by asher_sky
It would be nice if spider-vehicle legs could have a unique identifier like .unit_number or .id

Thanks :)

Re: Add unit_number or other unique id to spider-legs

Posted: Mon Jan 17, 2022 3:51 pm
by boskid
Unfortunately spider legs are not derived from EntityWithOwner so they cannot have unique id.

Re: Add unit_number or other unique id to spider-legs

Posted: Mon Jan 17, 2022 4:13 pm
by Bilka
As a workaround, you can somewhat misuse https://lua-api.factorio.com/latest/Lua ... _destroyed to obtain a unique ID for entities that don't have a unit number.

Re: Add unit_number or other unique id to spider-legs

Posted: Wed Jan 19, 2022 9:51 pm
by asher_sky
With the addition of entity.get_spider_legs(), using leg.name as a unique identifier is good enough, especially since it can be combined with the unit_number of the spider.
Thanks :)