Cargo bay reverse relation to connected platform hub/landing pad
Posted: Sun May 04, 2025 12:07 am
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
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