I'd just like a way to return if a pump is connected to a rail. Preferably it would return the rail it's connected to.
Use case: I count neighbours on fluidboxes for pumps and pipes. I have it so if the fluidboxes don't have at least two neighbours, it's considered an orphan. Problem being that the fluid box and rail are not neighbours so it thinks it's an orphan. I could do a bunch of directional position checking, but a way to just pull the rail as a method would be far more efficient.
A way to see if a pump is connected to a rail
-
- Long Handed Inserter
- Posts: 96
- Joined: Sun Mar 25, 2018 5:34 am
- Contact:
Re: A way to see if a pump is connected to a rail
Okay, I added LuaEntity::pump_rail_target (returns the rail) for 0.17.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Long Handed Inserter
- Posts: 96
- Joined: Sun Mar 25, 2018 5:34 am
- Contact:
Re: A way to see if a pump is connected to a rail
Nice! This is great
-
- Long Handed Inserter
- Posts: 96
- Joined: Sun Mar 25, 2018 5:34 am
- Contact:
Re: A way to see if a pump is connected to a rail
This is what I've got right now. Just does a positional check. Being able to check this property you added will make it more accurate.