Jump to content

partModule.moduleName not correct


Recommended Posts

I'm iterating through the parts of a vessel, and for each part, listing all the modules there.  I've run into a bit of a problem.

I noticed that the engines on the rocket all have ModuleEngineFX as the engine module, but the moduleName is coming back as ModuleEngines.  I know that ModuleEnginesFX inherits from ModuleEngines

I'm using the stock GDLV3 vessel for my tests.

void ScanVessel(Vessel v)
{
    for (int partNum = 0; partNum < v.Parts.Count; partNum++)
    {
        Part part = v.Parts[partNum];
        Debug.Log(part.partInfo.name + ":" + partNum.ToString());

        for (int moduleNum = 0; moduleNum < part.Modules.Count; moduleNum++)
        {
            PartModule module = part.Modules[moduleNum];                    
            Debug.Log(module.moduleName +":"+ module.ClassName +"::" + moduleNum.ToString());
        }
    }
}

 

and what I'm getting is:

engineLargeSkipper:6
ModuleEngines:ModuleEngines::0
solidBooster1-1:8
ModuleEngines:ModuleEngines::0

While not critical to what I'm doing, this bothers me because I know that some other mods actually do depend on this value being correct.

As you can see, I've also tried the ClassName, GetModuleDisplayName() and GUIName with no success

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