Jump to content

How to access Kerbals stats?


Recommended Posts

Ok, so I'm pretty new to KSP modding, and I need a few pointers to get started.

First up, I'm really only interested in the programmatic aspects of modding. I have no intentions of adding new parts or anything like that to the game.

So as a starter project to get a decent overview of things, I was thinking of maybe modifying the stats of Kerbals based on in-game events and parameters.

Now, I've been glancing through the community API documentation, but so far I haven't been able to locate any direct way of accessing the Kerbals stats.

Google have been pretty unfruitful too.

If anyone could point me in the right direction on this, that would be really nice.

Ps: My main bulk of programming experience comes from C++, I haven't really used C# before. So if you know about any potential pitfalls I may run into in that regard I would also appreciate it if you mentioned those as well.

Link to comment
Share on other sites

List<ProtoCrewMember> crew = vessel.GetVesselCrew(); // a list of all kerbals on the vessel (for the active vessel, replace <vessel> with <FlightGlobals.ActiveVessel>)
Debug.Log(crew[0].courage); // print the courage value of the first crew member in the list

Is that what you were after?

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