Jump to content

issue witg cfg


Recommended Posts

i need to get the list of all MODULE in a part cfg, but when i code this


public void test() {
List<Part> partsList = this.vessel.Parts;
for (int i = 0; i < partsList.Count; i++)
{
Part p = partsList[i];
ConfigNode[] c = p.partInfo.internalConfig.GetNodes("MODULE");
Debug.Log(c.Length);
}
}

it gives me 0. i can't figure this out

Link to comment
Share on other sites


PartModuleList pML = p.Modules;
foreach (PartModule pm in pML)
{
Debug.Log(pm.moduleName);
}

thanks. however i think i must explain myself better. i need to read the amount of a resource from a part.cfg file. i think that making a list of all parts, then find the part i can load the amount in a ConfigNode. but i can't

Edited by razorblade75
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...