Jump to content

Ragdoll = Science???


MonkeyCan'tDock

Recommended Posts

Stupid question (I'm not from a coding background), would it be possible to code an addon so that I generate one science point for every time I ragdoll a kerbal (i.e. they fall, or crash without dying)? Been watching all the ridiculous contraptions of SWDennis, Martincitopants, and Nexter's Lab too much. Looking for technical answers ideally, thoughts also welcome.

Best I can think of so far is an if then statement (again not a coder).

-If ragdoll animation triggered + if get up animation triggered

-then generate one science point

-If ragdoll animation triggered + kerbal destroyed

-then generate no science point

Did I just write nonsense or am I getting somewhere?

Edited by MonkeyCan'tDock
clarification
Link to comment
Share on other sites

On 9/17/2021 at 2:58 PM, MonkeyCan'tDock said:

Stupid question (I'm not from a coding background), would it be possible to code an addon so that I generate one science point for every time I ragdoll a kerbal (i.e. they fall, or crash without dying)? Been watching all the ridiculous contraptions of SWDennis, Martincitopants, and Nexter's Lab too much. Looking for technical answers ideally, thoughts also welcome.

Best I can think of so far is an if then statement (again not a coder).

-If ragdoll animation triggered + if get up animation triggered

-then generate one science point

-If ragdoll animation triggered + kerbal destroyed

-then generate no science point

Did I just write nonsense or am I getting somewhere?

Actually pretty simple.

You would look at KerbalEVA.isRagdoll and just check to see if it's set, and then if it is cleared.

If you want to get fancier ( and reduce cpu), then you can work with the ragdoll_OnEnter() and  ragdoll_OnLeave() methods

Link to comment
Share on other sites

So if I am getting this right:

If ragdoll_OnEnter()

Then Science 1

If ragdoll_OnLeave()

Then Science 0

I look at the KSP API and I am at a loss on how to incorporate science. Ideally I don’t want the experiment to be repeated over and over again, just to gather one science point per rag doll activation and deactivation cycle.

Also what is the () for?

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