Right now there doesn't seem a way to check if a specific deployed robot, either logistic or construction (not follower robots), is connected to a specific logistic network. I know this binding occurs as robots flying over other networks won't arbitrarily store or pick things from said isolated network, they seem to "remember" from where they were deployed.
The reason I say there's no way to check either is because LuaEntity.logistic_network for robots seems to always return nil, and even if it didn't, I can't see a way to compare logistic networks (I'm assuming =='ing the returned tables would fail, but please prove me wrong if so!). There's no way to change it either that I can find on the API, but that'd be for another thread, I'd be happy with right now just having a way to check.
Use case: I need to be able to skip over robots that belong to a specific logistic network when I'm iterating over them, and I don't seem to have a way to do so. I need to skip them because the script I'm doing to them changes the network they're connected to (resets them), which leads to some very annoying bugs.
I guess a LuaLogisticNetwork.belongs_to(entity) that worked with robots could do, or having LuaEntity.logistic_network work with robots too (but if so, I would need a way to check if two networks are the same). Thank you so much!
Checking if a robot belongs to a specific logistics network
Re: Checking if a robot belongs to a specific logistics network
I fixed logistic_network read for robots for the next version of 0.16. You can simply compare them with == - all LuaObjects can be compared with ==.
If you want to get ahold of me I'm almost always on Discord.
Re: Checking if a robot belongs to a specific logistics network
Awesome!! I wish I had known that earlier, and thank you so much for adding logistic_network too.Rseding91 wrote:I fixed logistic_network read for robots for the next version of 0.16. You can simply compare them with == - all LuaObjects can be compared with ==.