Cargo bay reverse relation to connected platform hub/landing pad

HermanyAI
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Dec 16, 2016 11:35 pm
Contact:

Cargo bay reverse relation to connected platform hub/landing pad

Post by HermanyAI »

There is LuaEntity#get_cargo_bays for relating space platform hub / cargo landing pad to its cargo bays, but no clean way to go in reverse.

Workaround for when connected to platform hub is cargo bay entity's .surface.platform.hub. When it's connected to landing pad, mod has to either keep track of all existing, or do naive full surface searches for all landing pads, to then call LuaEntity#get_cargo_bays until the same bay was found in it.

My use case is for Item Cam 2, which after following a cargo pod to its destination cargo bay, switches to related platform hub/landing pad because next interaction is there
Rseding91
Factorio Staff
Factorio Staff
Posts: 15707
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Cargo bay reverse relation to connected platform hub/landing pad

Post by Rseding91 »

I've added LuaEntity::cargo_bay_connection_owner read for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Implemented mod requests”