Add ability to get the leg entities of a spider-vehicle

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

Add ability to get the leg entities of a spider-vehicle

Post by asher_sky »

It would be really nice if you could add a .legs (array of spider legs) to spider-vehicles, and even a .spider (LuaEntity of spider-vehicle controlling this leg) to the leg entities.

It could also be something like entity.linked_entities or entity.grouped_entities.

Thank you!

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Add ability to get the leg entities of a spider-vehicle

Post by Klonan »

Can you provide some insight on your usecase for such an interface?

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

Re: Add ability to get the leg entities of a spider-vehicle

Post by asher_sky »

Klonan wrote:
Thu Jan 13, 2022 12:07 pm
Can you provide some insight on your usecase for such an interface?
Yes, I’ve been working recently with renderings, and want to make a mod that adds glowing colored trails wherever the spidertron walks. I can make it work pretty well at the moment using a generic rainbow cycle for the colors, but I would really like to have the color trails sync their color to the spidertron the legs belong to.

However this has proven difficult so far because I’m having trouble finding and keeping track of the correct spidertron, when many spidertrons are in close proximity to eachother.

Here you can see I got it kind of working, but the legs keep forgetting their spidertron owner and searching for nearby spiders to get a color from: https://youtu.be/w6st6LT2l0A

It would be much more convenient to be able to keep track of the spidertrons and then `for _,leg in pairs(spidertron.legs) do …` instead of trying to search and associate them myself

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

Re: Add ability to get the leg entities of a spider-vehicle

Post by boskid »

1.1.51 wrote:Added LuaEntity::get_spider_legs()

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

Re: Add ability to get the leg entities of a spider-vehicle

Post by asher_sky »

Amazing! Thank you :D

Post Reply

Return to “Implemented mod requests”