Expose LuaWireConnector point or current sprite index
Posted: Sun Jul 27, 2025 1:41 pm
Would it be possible to add a LuaWireConnector::point -> MapPosition method that returns the point where a red/green/copper wire visually connects to the entity?
This isn't the first time this has been requested - though usually the focus is on power poles. To my understanding, power poles don't have a rotation that can be practically exposed via the api, so I suspect that's always made this request somewhat infeasible?
In my case, I’m interested in the connector points of all prototypes that support wire connections. Among those, only power poles lack rotation or don’t rely on a single sprite. So if LuaWireConnector::point were to follow the existing quasi-convention of assuming a power pole’s rotation is 0, you won’t hear me complaining!
For context, I'm trying to use the actual connector positions to visualize and prune wire networks. I initially tried scraping the prototypes and mapping connector points for each connectable entity based on rotation... only to find that sprite selection for several types isn't determined solely by rotation. I’ve spent far, far longer than I care to admit trying to map out the logic behind how transport belt sprites depend on their neighbors - and longer still trying to figure out how rail segments, rail locations, and layers affect rail signal sprites.
Failing that, is there any documentation I could use to help map an arbitrary non–power pole entity to its current sprite index? Or would exposing the current sprite index via the api be an option??
Thanks!
This isn't the first time this has been requested - though usually the focus is on power poles. To my understanding, power poles don't have a rotation that can be practically exposed via the api, so I suspect that's always made this request somewhat infeasible?
In my case, I’m interested in the connector points of all prototypes that support wire connections. Among those, only power poles lack rotation or don’t rely on a single sprite. So if LuaWireConnector::point were to follow the existing quasi-convention of assuming a power pole’s rotation is 0, you won’t hear me complaining!
For context, I'm trying to use the actual connector positions to visualize and prune wire networks. I initially tried scraping the prototypes and mapping connector points for each connectable entity based on rotation... only to find that sprite selection for several types isn't determined solely by rotation. I’ve spent far, far longer than I care to admit trying to map out the logic behind how transport belt sprites depend on their neighbors - and longer still trying to figure out how rail segments, rail locations, and layers affect rail signal sprites.
Failing that, is there any documentation I could use to help map an arbitrary non–power pole entity to its current sprite index? Or would exposing the current sprite index via the api be an option??
Thanks!