Jump to content

[Solved] Get the part that is docked to a Docking Port


Recommended Posts

Simple question?

I am writing a small plugin and I need to to get the part that is docked to a docking port. I have figured out how to get part that is Attached to the port in the VAB but if it has been Docked later the part doesn't show up (I think because "docked" is not the same as "attached", ...right?).
 

This is my code to get the attached part:

        public List<Part> GetPartsAlreadyAttached()
        {
            cp.Clear();
            AttachNode DockingAttachNode = DockingPortA.topNode;

            if (DockingAttachNode.attachedPart != null)
            {
                cp.Add(DockingAttachNode.attachedPart);
                return cp;
            }

            return cp;
        }


I see there is dockedPartUId but how do I go from UId number to getting the actual part?

ModuleDockingNode dockingNode = KIS_Shared.GetDockingNode(DockingPortA);
uint PartID = dockingNode.dockedPartUId;

 

Thank you!

Edited by Aahz88
Put code in
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...