Add unit_number or other unique id to spider-legs

Things that we aren't going to implement
Post Reply
asher_sky
Inserter
Inserter
Posts: 44
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

Add unit_number or other unique id to spider-legs

Post by asher_sky »

It would be nice if spider-vehicle legs could have a unique identifier like .unit_number or .id

Thanks :)

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2227
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post by boskid »

Unfortunately spider legs are not derived from EntityWithOwner so they cannot have unique id.

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

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

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

asher_sky
Inserter
Inserter
Posts: 44
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

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

Post 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 :)

Post Reply

Return to “Won't implement”