Jump to content

Looking for event/callback


Recommended Posts

Hello!

Does anybody know how I would log an event or receive a callback upon a Kerbal being killed? Either during an EVA or in a crashed ship, but preferably both.

Any and all information regarding the conditions of the death would be greatly useful also (but really interested in location of death and speed of the Kerbal on EVA or the module it was sitting in at the time of death). Would ideally by able to get the event whether the death occurred in a focused or non-focused vessel.

So far, I've looked through Anatid's Documentation for the KSP API haven't found anything I could make use of...

Link to comment
Share on other sites

GameEvents.onCrewKilled.

It should give you a name of the Kerbal you can use to find its ProtoCrewMember and might additional infos. There isn't any easier way i know of... you could ofc subscribe to a lot of other events...

Edited by Faark
Link to comment
Share on other sites

So far, I've looked through Anatid's Documentation for the KSP API haven't found anything I could make use of...

Although they're occasionally useful, I personally find using an object browser (VS's built-in one works great, MonoDevelop is also capable) to be much better than the XML docs. Most events you might be interested in are located in GameEvents

Link to comment
Share on other sites

Although they're occasionally useful, I personally find using an object browser (VS's built-in one works great, MonoDevelop is also capable) to be much better than the XML docs. Most events you might be interested in are located in GameEvents

Wow, that sounds promising, though I'm still too inexperienced to use what you've told me.

I'm trying to figure out how to do this object browsing in Mono. Am I supposed to be looking in a specific namespace or assembly to see what you had in your picture?

Link to comment
Share on other sites

Well, it does work in the version of MonoDevelop I have (4.0.1) but for some reason you can't expand results you get from a search. Still, if you're set on using it over VS express then you can make it work. Assuming you've added references to the right KSP Mono DLLs, you can open the object browser in MonoDevelop by using the menu View->Assembly Browser. Most of what you're be looking for will be in the Assembly-CSharp assembly.

If you're looking for something in Unity, a quick google to find the wiki page on it is more informative than looking into the UnityEngine assembly yourself

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