Jump to content

Killing kerbals softly


Recommended Posts

I asked this question in the other thread, but got no answer, so asking here.

I need to be able to kill a kerbal (I have an instance of ProtoCrewMember), which can be loaded or unloaded.

Using ProtoCrewMember.Die() causes an NRE in flight scene and doesn't remove the portrait. For now, I've been using this code (PCM is an instance of ProtoCrewMember):

if (PCM.seat != null) PCM.seat.part.RemoveCrewmember(PCM);
PCM.rosterStatus = ProtoCrewMember.RosterStatus.Dead;

However, this doesn't always work well. Sometimes, I have a portrait replaced with white noise but the box still displayed and the kerbal visible in IVA. What's worse, this code doesn't seem to work from KSC at all. In any case, even if it kinda works, the deceased kerbals simply disappear from the roster and are not seen in the Lost tab.

So, what is the best way to kill a kerbal?

Edited by garwel
Link to comment
Share on other sites

13 hours ago, wasml said:

I can only suggest you look at the code for some mod that does this - I think a few of the life support mods can kill a Kerbal - like Kerbalism, TAC-Life Support, and possibly USI-Life Support(configurable?).

I've looked at USI-LS and they basically do the same thing (plus mark vessel crew as dirty). Tried to emulate that, but it didn't help. Will try what JPLRepo has suggested and see. But the problem is usually with non-loaded vessels.

Link to comment
Share on other sites

2 hours ago, garwel said:

I've looked at USI-LS and they basically do the same thing (plus mark vessel crew as dirty). Tried to emulate that, but it didn't help. Will try what JPLRepo has suggested and see. But the problem is usually with non-loaded vessels.

You could just wait until you visit the ship and then kill them

Link to comment
Share on other sites

On 6/11/2017 at 2:13 AM, JPLRepo said:

I already answered this where the same question was posted in this thread.

 

I hate that thread!  lol.   There's so much great stuff buried so deep in it!  I wish all those issues were in their own threads so they were easier to find! 

Link to comment
Share on other sites

 
Tapping the board with your fingers.
Playing with life by key strokes.
Killing them softly with your code;
Killing them softly, with your code;
Playing their whole life by key strokes
Killing them softly with your code.
 
I saw them only proto, I saw them in C sharp,
And sent them up in rockets, keys were played like a harp,
And there they were, these kerbals, light beams sent to my eyes...

I'll see myself out then.

Link to comment
Share on other sites

On 6/11/2017 at 7:15 PM, TheRagingIrishman said:

You could just wait until you visit the ship and then kill them

In some edge cases (the kerbal is in a vessel landed on Kerbin) it can make "dead" kerbals recoverable, with unpredictable consequences. Plus, having an apparently dead kerbal marked as alive and assigned in the roster can affect other mods, e.g. life support. I'll see if I can find a way around it.

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