Skip to content

[feature] DockingPort suffix(es) to find other DockingPort in docked pair or Element thereof #2613

@mdpkh

Description

@mdpkh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions