Jump to content

[HELP!] Need a list of Celestial Bodies and Gravity Constants


Recommended Posts

I want to get a list of all Solar Systems, including Mod Systems and their Celestial Bodies contained, and all the Gravity Constants for each body.

yes, I know about the foreach loop, just don't know where to iterate

Edited by Xyphos
Link to comment
Share on other sites

  • 2 weeks later...

okay, now I have a new problem; I want to list the bodies in order by distance from the Sun, but each FlightGlobals.Bodies has a NULL CelestialBody.Orbit property.

how can I get body distance/radius from inside the vessel editor?

Link to comment
Share on other sites

If you can excuse a bit of Linq this will get a list of all bodies (ignore the bit about the dictionary parameters, the values are just used to add white space in text fields), ordered by distance to the sun, with moons (and sub-moons, and sub-sub-moons) grouped together with their parent.

I'm not sure how it will work with multiple star systems, though. I have never gotten around to testing that. I believe the sun itself is excluded from this list, though you could easily add it to the end or beginning. This works fine in the VAB/SPH.

https://github.com/DMagic1/KSP_BasicDeltaV/blob/master/Source/BasicDeltaV/BasicDeltaV.cs#L1227-L1267

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