Jump to content

[solved] The Orbital Scanner's mysterious science


Recommended Posts

When you scan a planet in stock with the orbital scanner, it gives you a science bonus. I would like to replicate that behavior. I've been looking into transmitting science experiments and such, but I can't really tell how the orbital scanner module is doing it. There is no experiment definition for it, and as far as I can tell you can't create and hand a transmitter ScienceData without having an ID to go with it, which you get from the ScienceSubject class, which you get from the ScienceExperiment class, which comes ultimately from the science definitions.

How is the orbital scanner transmitting science without a science definition? Is it OK to build an instance of ScienceData from scratch and throw an ID in it that hasn't been defined? I suppose there could be a lot of manual overriding going on with the whole transmission process and science gaining process, but seeing as how it works with any antenna (and requires an antenna in the first place), I doubt it.

Edited by Wheffle
Link to comment
Share on other sites

Was able to find a little bit of info on this and figure out the rest. For anyone who is interested, DMagic explains it a bit here.

I'll explain what I discovered as well in case it's important to anyone:

Having an antenna transmit an instance of ScienceData that has the "triggered" boolean parameter set to 'true' will trigger a callback method upon transmission completion (or failure). You can use GameEvents.OnTriggeredDataTransmission to add your method to the list of methods that will receive the callback. The callback hands you the instance of ScienceData that was sent, the vessel it was sent from and a bool that is true if the transmission failed. As far as I can tell, the R&D system will ignore a triggered ScienceData altogether, so the actual parameters of the ScienceData (amount, ID, title, etc.) don't matter, and any science added and completion messages have to be done 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...