Jump to content

Detecting if an EVA is using RCS?


Recommended Posts

I need to do a check to see if RCS thrusters are currently on for the active EVA.

I've tried checking vessel.IsControllable but it seems to stay true even when they're tumbling, and even if it did work, I would still need to know when they're controllable but not using thrusters.

Is there a way to check that? If not, maybe a way to check if the EVA's fuel is going lower?

Any assistance is appreciated. Thanks.

Link to comment
Share on other sites

Iterate through the components of the EVA Kerbal GameObject and it's children and you're likely to find the relevant objects that control EVA thrusters. I can't promise they've got public methods for what you want but it's where I'd start looking:

Example method (call as PrintTransform(kerbalsTopLevelTransform, "") ):

	private static void PrintTransform(Transform aTransform, String currentPath)
{
currentPath += "/" + aTransform.name;
print(currentPath);
foreach(Component aComponent in aTransform.gameObject.GetComponents<Component>())
{
if(aComponent.GetType().ToString() != "UnityEngine.Transform")
print(aComponent.GetType());
}
foreach(Transform childTransform in aTransform)
{
PrintTransform(childTransform, currentPath);
}
}

Link to comment
Share on other sites

Iterate through the components of the EVA Kerbal GameObject and it's children and you're likely to find the relevant objects that control EVA thrusters. I can't promise they've got public methods for what you want but it's where I'd start looking:

Example method (call as PrintTransform(kerbalsTopLevelTransform, "") ):

	private static void PrintTransform(Transform aTransform, String currentPath)
{
currentPath += "/" + aTransform.name;
print(currentPath);
foreach(Component aComponent in aTransform.gameObject.GetComponents<Component>())
{
if(aComponent.GetType().ToString() != "UnityEngine.Transform")
print(aComponent.GetType());
}
foreach(Transform childTransform in aTransform)
{
PrintTransform(childTransform, currentPath);
}
}

I actually found out later that I was going about it wrong, and I should have checked the kerbalEVA component for .isRagdoll

I'll keep this for reference. Thanks :)

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