-
Notifications
You must be signed in to change notification settings - Fork 241
Description
I'm writing a script to undock and deorbit a vessel after its crew / passengers have been transferred to the vessel it's docked with. In order to avoid colliding after undocking, I want to keep track of the position of the other vessel after undocking. In order to get a reference to that vessel, I'm pretty sure I first need a reference to a part or element on the "other side" of the docking port before undocking, then simply get its parent vessel after undocking. The most straightforward thing to do, I think, would be (assuming PORT holds a reference to the DockingPort in the same Element as the CPU which will be told to UNDOCK) to write something like LOCAL OTHER IS PORT:PARTNER, where :PARTNER would be a new suffix of DockingPort returning the other DockingPort that it's docked to (if applicable).
Also possibly helpful, though perhaps almost redundant if DockingPort:PARTNER is implemented, would be DockingPort:OTHERELEMENT, returning the element containing the other DockingPort — essentially equivalent to DockingPort:PARTNER:ELEMENT.
As it is, it seems I have to check whether DockingPort:PARENT is also a DockingPort, else look through DockingPort:CHILDREN to find the other DockingPort. I find it a bit messy.