Jump to content

How do I create a custom science experiment?


Recommended Posts

I wanna create a new science experiment but not sure where to start for the code.

there is a slight catch; the experiment data isn't available immediately, it has to be computed over time and consume EC while it's being computed.

Link to comment
Share on other sites

yeah, that didn't help any.

there's no documentation in the source so it's not feasible to learn from @DMagic's code.

Inheriting IScienceContainer I understand, but there's no info on how to use the inherited methods.

Edited by Xyphos
Link to comment
Share on other sites

@Xyphos so I don't really know anything about interfacing with the science system, however I do know a thing or two about depleting resources

Here's a link to the Active Camouflage in DCK FutureTech ... check line 188 down (resources region), it should help you along your way with depleting ec as the scan is running

https://github.com/DoctorDavinci/DCK-Future-Tech/blob/master/DCK_FutureTech_Plugin/Modules/ModuleDCKACS.cs

You can also look at the shields as they use EC over time and also are setup to auto shutdown if ec gets too low

https://github.com/DoctorDavinci/DCK-Future-Tech/blob/master/DCK_FutureTech_Plugin/Modules/ModuleDCKShields.cs

Hope this helps :)

Edited by DoctorDavinci
Link to comment
Share on other sites

nah, I don't need resources consumed, the PartModule is actually inherited from ModuleScienceExperiment which is what my mod is currently implementing.

 


I just need some guidance on how to create a science report properly and transmit it back to Kerbin for some science, and to enable a feature after transmitting.
the lack of documentation for the API and no general information given is frustrating. I looked at @DMagic's code and found myself saying 'what' more than I usually do.

Edited by Xyphos
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...