Jump to content

How to get biome & science descriptions for a celestial body? [Answered]


Recommended Posts

How do I get biome definitions and science descriptions for a celestial body?

I can see where I get the biome map, on CelestialBody.BiomeMap.  That allows me to get at, for example, the name of a biome for a given lat/long, or the color displayed on the debug biome map overlay.

But how do I get the following?

  • A list of all the biome names for a body
  • What color on the biome map a given biome is set to
  • A list of all the text descriptions for all the science experiments for a given biome (e.g. what's the text for gravioli detector landed in Mun Farside Crater)

I've been hunting around in this forum, can't find anything about this, with no success.  Rummaging around in the API, I've seen various classes that looked promising (ScienceExperiment, ScienceSubject, others), but none of them are quite what I need.

Anyone have any idea?

Edited by Snark
Link to comment
Share on other sites

55 minutes ago, Thomas P. said:

is how you get the biomes. Not sure about the science experiments, maybe someone else can help here. :)

Excellent, thank you!  Staring me right in the face, somehow missed it.

Link to comment
Share on other sites

1 hour ago, Snark said:

But how do I get the following?

  • A list of all the biome names for a body
  • What color on the biome map a given biome is set to
  • A list of all the text descriptions for all the science experiments for a given biome (e.g. what's the text for gravioli detector landed in Mun Farside Crater)

Iterating through the MapAttributes works fine for the most part, with the only wrinkle being that it'll miss any "special" biomes that are hard-coded and not on the biome map like the KSC. If you're generating possible subjectids, you'll want to use ResearchAndDevelopment.GetBiomeTags() to include those as well

The results are stored in the ScienceExperiment itself as a dictionary with (half of) the subjectid as key

foreach (var experiment in ResearchAndDevelopment.GetExperimentIDs().Select(ResearchAndDevelopment.GetExperiment))
  foreach (var result in experiment.Results)
  {
    // [subjectid] : [result text]
    print(result.Key + " : " + result.Value);
  }

// crew report
default : You record the crew's assessment of the situation.
KerbinSrfLandedLaunchpad : We don't seem to be moving very fast right now.
KerbinSrfLandedRunway : Reporting in at the Runway. Good thing there's not a lot of air traffic, because I don't think we ever got clearance from the tower to be here.
KerbinSrfLandedKSC : This is our Space Center here. We're home.
KerbinFlyingLowGrasslands : Hey I can see my house from here, I think.
KerbinFlyingLowGrasslands* : It's very comforting to see that much green below you.
// snip you get the idea

Edit: I just realized the asterisk is for marking results for subjectids that don't exactly match, for instance "BopSrfLanded*" will match any subjectid that contains BopSrfLanded in it. Multiple asterisk-marked entries are randomly selected by ResearchAndDevelopment.GetResults()

Edited by xEvilReeperx
Link to comment
Share on other sites

19 minutes ago, xEvilReeperx said:

If you're generating possible subjectids, you'll want to use ResearchAndDevelopment.GetBiomeTags() to include those as well

The results are stored in the ScienceExperiment itself as a dictionary with (half of) the subjectid as key

Thank you, that was the one remaining missing piece.  Exactly what I needed.

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