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!
Add ability to get the leg entities of a spider-vehicle
Re: Add ability to get the leg entities of a spider-vehicle
Can you provide some insight on your usecase for such an interface?
Re: Add ability to get the leg entities of a spider-vehicle
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
Re: Add ability to get the leg entities of a spider-vehicle
1.1.51 wrote:Added LuaEntity::get_spider_legs()
Re: Add ability to get the leg entities of a spider-vehicle
Amazing! Thank you :D