Jump to content

Indentify a "probe" part


Recommended Posts

Hi,

I would like to be able to identify all the parts that when separated can be considered as a controllable ship.

I can identify command modules with the following routine:

foreach (Part part in vessel.Parts)
                    {
                        if (part.CrewCapacity > 0)
                        {
                            controllableParts.Add(part);
                            controllablePartsNames.Add(part.partInfo.title);
                        }
                    }

but i also want to be able to identify unmanned probes. What attribute of the "Part" object can i use to check if it's a probe ?

Thank you for your help

 

Edited by SPD13
Link to comment
Share on other sites

Works Great !

i just check " if (part.HasModule<ModuleCommand>()) "

The only problem is that MechJeb part has a ModuleCommand. I filtered it : " if (part.HasModule<ModuleCommand>() && !part.name.Contains("mumech")) "

Thank you again for your help

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...