Jump to content

Getting parts of vessels which are out of range.


Recommended Posts

When going through FlightGlobals.Vessels i do get all the general vessel information, but i can't loop through the parts of vessels which are more than a few klicks away. I'm assuming its because these vessels are not yet loaded. There is probably a way to get and edit the part info of these vessels, and I suspect I have to work with confignodes, but I haven't worked with that yet. I could find surprisingly little documentation on it. Could someone direct me to it or give me a few pointers on how to edit parts on far away vessels?

Link to comment
Share on other sites

Can you edit parts on unloaded vessels?

This might be a limitation of our API.

From the API docs:

    /// <summary>
/// The protoVessel can be used to get some saved information about unloaded vessels.
/// </summary>
public ProtoVessel protoVessel;

That is the Vessel.ProtoVessel method, specifically says some.

Maybe look at loading the vessel, making your changes and then unloading it? The API indicates there is a Vessel.Load and Vessel.Unload method?

Not something I've tried myself, but it is where I would start.

D.

Link to comment
Share on other sites

Away from desktop at the moment, but you can grab alll protovessels. They have protopartsnapshots that have some info; the rest is indeed stored in confignodes under the snapshots.

For resources you can get the proto resource defines and edit the amounts in the resource data config node(s).

Or you can look at how I handle recycling in MCE. Other than already having been handed a protovessel reference, it's all there in MissionControllerEvents.cs for OnDestroyed()

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