Jump to content

Need to find out how many science points of an experiment have been collected


Recommended Posts

Working on a an old mod, I find that I need the following information:

Given an idfor a science experiment (for example, modelRockets@KerbinInSpaceHigh)

  • Total science points possible
  • Total science points already researched

I can get the total possible, that is calculated from:

ScienceExperiment labExp = ResearchAndDevelopment.GetExperiment(activeExperiment.activeExpid);
ScienceSubject labSub = ResearchAndDevelopment.GetExperimentSubject(labExp, activeExperiment.expSit, vessel.mainBody, activeExperiment.biomeSit, displayBiome);

labSub.subjectValue *= labBoostScalar;
labSub.scienceCap = labExp.scienceCap * labSub.subjectValue;

but I haven't figured out yet how to get the amount already researched.

Suggestions?

 

Thanks in advance

Link to comment
Share on other sites

  • 2 weeks later...

Ohi, I've been on vacation and haven't checked the forum much, so you probably already found your answer :)

labSub.science looks like the field you want. This is how [x] Science does it:

 CompletedScience = ScienceSubject.science * HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier;
 TotalScience = ScienceSubject.scienceCap * HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier;

 

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