Jump to content

Determining the experience of the Kerbal on EVA


Recommended Posts

Hi all, I am working on a feature that needs to know the skill type (Pilot, Scientist, Engineer) and experience level of the kerbal on EVA. I'm Not sure how to go about this, but I think I'd need to first determine if the active vessel is a kerbal, then get the skill type from somewhere.. Does that make sense? Will a kerbal on EVA be the active vessel?

thanks for the help. :)

Link to comment
Share on other sites


if (FlightGloals.ActiveVessel.isEVA)
{
Vessel vessel = FlightGlobals.ActiveVessel;
var experience = vessel.GetVesselCrew()[0].experienceTrait;

//TODO: add more stuff that does things
}

Beyond that, it's pretty self explanatory. Just don't use vessel.GetVesselCrew() in every update loop, as it is a very expensive operation. Cache the return value, and update it every time FlightGlobal.ActiveVessel changes.

Edited by MrHappyFace
i am bad at using words
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...