Jump to content

Science and mods!


DYJ

Recommended Posts

  • 2 weeks later...
Is there a way right now to limit which planet is applicable to an experiment?

Trying to think of ideas to make unique probes/sensors. If this would possible it might be interesting.

Biome and Surface mask determine when and where your experiments can be used. You just need to figure out the combination of numbers...

Link to comment
Share on other sites

Biome and Surface mask determine when and where your experiments can be used. You just need to figure out the combination of numbers...

Those masks deals with biomes & altitude. I'm talking about celestial body.

Edited by MedievalNerd
Link to comment
Share on other sites

Where as is in biome/altitude. I'm talking about celestial body.

Read the OP...

Altitude has no specific say, there's just InSpaceHigh/Low and FlyingHigh/Low.

Look at how the Temperature experiment is set up (both in the thermometer part.cfg and the ScienceDef.cfg. You can't use it while in interstellar space but once you get close to some planets or on their surface, it becomes available. Same thing for Cabana Corp.'s Surface Exploration for probes...

You just need the right biomeMask/situationMask combination...

Link to comment
Share on other sites

Those masks deals with biomes & altitude. I'm talking about celestial body.

The default ModuleScienceExperiment doesn't support limiting by celestial body.

But, you could make your own module that inherits ModuleScienceExperiment, something like this, if you wanted a Duna-only experiment:


public class DunaExperiment : ModuleScienceExperiment

public bool checkBody() {
if(vessel.mainBody == "Duna")
return true;
ScreenMessages.PostScreenMessage("This experiment only operates at Duna!", 3, ScreenMessageStyle.UPPER_CENTER);
return false;
}

new public void DeployExperiment() {
if(checkBody())
base.DeployExperiment();
}

new public void DeployAction(KSPActionParam p) {
if(checkBody())
base.DeployExperiment(p);
}

}

Then just use your module instead of ModuleScienceExperiment.

Link to comment
Share on other sites

The default ModuleScienceExperiment doesn't support limiting by celestial body.

But, you could make your own module that inherits ModuleScienceExperiment, something like this, if you wanted a Duna-only experiment:


public class DunaExperiment : ModuleScienceExperiment

public bool checkBody() {
if(vessel.mainBody == "Duna")
return true;
ScreenMessages.PostScreenMessage("This experiment only operates at Duna!", 3, ScreenMessageStyle.UPPER_CENTER);
return false;
}

new public void DeployExperiment() {
if(checkBody())
base.DeployExperiment();
}

new public void DeployAction(KSPActionParam p) {
if(checkBody())
base.DeployExperiment(p);
}

}

Then just use your module instead of ModuleScienceExperiment.

I don't think you need to make your own module...

Cabana Corp's own Surface Exploration only works on the surface of set planets... So does the stock Surface Sample experiment available to Kerbals on EVA. As long as the experiment is set up properly he should be able to exclude specific planets/environments, just like with the stock temperature reading, gravity scan (or whatever it was) etc, which simply show "you can't do that here" if it's not on say the surface or in orbit of valid planets...

Link to comment
Share on other sites

I don't think you need to make your own module...

Cabana Corp's own Surface Exploration only works on the surface of set planets... So does the stock Surface Sample experiment available to Kerbals on EVA. As long as the experiment is set up properly he should be able to exclude specific planets/environments, just like with the stock temperature reading, gravity scan (or whatever it was) etc, which simply show "you can't do that here" if it's not on say the surface or in orbit of valid planets...

Surface Sample works on every celestial body, it just requires you to be landed or splashed-down.

Temperature reading is only limited to not work at high orbit; it works the same at every celestial body.

Seismic scan requires you to be landed, but works the same at every celestial body.

Gravity detector requires you to be landed, splashed-down, or in orbit, but works the same at every celestial body.

Crew Reports, EVA reports, Mystery Goo, and Materials Bay all work everywhere.

Only the Atmospheric probe is limited to a subset of celestial bodies, but that's based on the "requireAtmosphere" flag. If you want a different set of bodies, that won't work.

If your Surface Exploration only works on certain planets of your choosing, and not others, I'm curious to know how you did it, as none of the stock experiments do that. I can't seem to download your mod from SpacePort. Says the ZIP is corrupted.

Link to comment
Share on other sites

Surface Sample works on every celestial body, it just requires you to be landed or splashed-down.

Temperature reading is only limited to not work at high orbit; it works the same at every celestial body.

Seismic scan requires you to be landed, but works the same at every celestial body.

Gravity detector requires you to be landed, splashed-down, or in orbit, but works the same at every celestial body.

Crew Reports, EVA reports, Mystery Goo, and Materials Bay all work everywhere.

Only the Atmospheric probe is limited to a subset of celestial bodies, but that's based on the "requireAtmosphere" flag. If you want a different set of bodies, that won't work.

If your Surface Exploration only works on certain planets of your choosing, and not others, I'm curious to know how you did it, as none of the stock experiments do that. I can't seem to download your mod from SpacePort. Says the ZIP is corrupted.

As I said in the mod's thread- SpacePort is being a real pain in the ass. Use Dropbox or Mediafire links. The SpacePort download is outdated anyways, it doesn't include most of the scientific stuff...

The Surface Exploration works on every planet since I've added it as an option in the ScienceDef (where you add responses for different planets/biomes). I have both biome and situation masks set to 3 so it's only available as an option to perform when on the surface. Otherwise it simply doesn't appear on the probe's right-click GUI and shows "you can't do that here" if you use action groups.

Before I added text for all planets, it showed the "you can't do that here" line when I was on a planet not featured in the list, I also didn't have a "default" response. This leads me to assume exceptions can be made...

Link to comment
Share on other sites

As I said in the mod's thread- SpacePort is being a real pain in the ass. Use Dropbox or Mediafire links. The SpacePort download is outdated anyways, it doesn't include most of the scientific stuff...

The Surface Exploration works on every planet since I've added it as an option in the ScienceDef (where you add responses for different planets/biomes). I have both biome and situation masks set to 3 so it's only available as an option to perform when on the surface. Otherwise it simply doesn't appear on the probe's right-click GUI and shows "you can't do that here" if you use action groups.

Before I added text for all planets, it showed the "you can't do that here" line when I was on a planet not featured in the list, I also didn't have a "default" response. This leads me to assume exceptions can be made...

OK, that's the key then. All the Stock experiments have a default response. Sounds like if you want to have an experiment for only certain bodies, you need to exclude the default response, then put individual responses for the specific celestial bodies you want.

That's tangential to setting the biomeMask/situationMask as you were suggesting initially. Neither of those have any control over what specific celstial bodies an experiment will work on, just what situations at each body are permitted, and in which of those situations the biome matters.

Link to comment
Share on other sites

@BananaDealer, I read the OP, please let's not get into semantics. I'm pretty sure you understood what I meant about 'altitude' since we were already talking about the masks, moving on. Also, I'm specifically talking about making unique planet experiments. Not restricting where it can be executed, I've already done that with an experiment I created for probes. Now that part about what you said about not having default response, that sounds like a winner.

@ethernet, Thanks for understanding my madness. It was planet specific, not surface only. Perhaps BananaDealer is on to something with not having a 'default response'.

Cheers,

Link to comment
Share on other sites

Darn,

Seems that it probably needs to be linked to biomes. Because I have an experiment that isn't biome sensitive. And when I do experiments which aren't defined the game makes a generic reponse, even though none is listed. (I removed it)

Do planets who do not have biome diversity, have '1' biome applied for the entire planet?

So I might actually need to give your module a go ethernet!

Link to comment
Share on other sites

Darn,

Seems that it probably needs to be linked to biomes. Because I have an experiment that isn't biome sensitive. And when I do experiments which aren't defined the game makes a generic reponse, even though none is listed. (I removed it)

Do planets who do not have biome diversity, have '1' biome applied for the entire planet?

So I might actually need to give your module a go ethernet!

Planets without biomes are set as one big biome per planet (making my recent Duna Polar mission absolutely redundant but hey)...

You still need to set a biomeMask however...

Link to comment
Share on other sites

The default ModuleScienceExperiment doesn't support limiting by celestial body.

But, you could make your own module that inherits ModuleScienceExperiment, something like this, if you wanted a Duna-only experiment:


public class DunaExperiment : ModuleScienceExperiment

public bool checkBody() {
if(vessel.mainBody == "Duna")
return true;
ScreenMessages.PostScreenMessage("This experiment only operates at Duna!", 3, ScreenMessageStyle.UPPER_CENTER);
return false;
}

new public void DeployExperiment() {
if(checkBody())
base.DeployExperiment();
}

new public void DeployAction(KSPActionParam p) {
if(checkBody())
base.DeployExperiment(p);
}

}

Then just use your module instead of ModuleScienceExperiment.

Thanks again for this. But I think i'm missing a reference somewhere, it does not want to use the Duna string. And there it's stating a missing parameter:

Error 1 Operator '==' cannot be applied to operands of type 'CelestialBody' and 'string' e:\migrate documents\visual studio 2010\Projects\Project1\Project1\Class1.cs 6 6 Project1

Error 2 No overload for method 'DeployExperiment' takes 1 arguments e:\migrate documents\visual studio 2010\Projects\Project1\Project1\Class1.cs 19 5 Project1

Link to comment
Share on other sites

Thanks again for this. But I think i'm missing a reference somewhere, it does not want to use the Duna string. And there it's stating a missing parameter:

Error 1 Operator '==' cannot be applied to operands of type 'CelestialBody' and 'string' e:\migrate documents\visual studio 2010\Projects\Project1\Project1\Class1.cs 6 6 Project1

Error 2 No overload for method 'DeployExperiment' takes 1 arguments e:\migrate documents\visual studio 2010\Projects\Project1\Project1\Class1.cs 19 5 Project1

Sorry, should be "vessel.mainBody.name" instead of "vessel.mainBody", and the function call inside DeployAction should be "base.DeployAction(p)", not "base.DeployExperiment(p)"

Link to comment
Share on other sites

Sorry, should be "vessel.mainBody.name" instead of "vessel.mainBody", and the function call inside DeployAction should be "base.DeployAction(p)", not "base.DeployExperiment(p)"

Do not be sorry! It works and it's amazing!

Now I can work in some unique planet specific experiments! You rock good sir!

Link to comment
Share on other sites

  • 3 months later...

Could we get an update to this post regarding the changes in .23, please - specifically how to set the "un-transmittable" portion of the total science points to be gained by an experiment?

(Not the transmission efficency, but I read that some science points are only ever obtainable by a return mission, or am I wrong?)

Link to comment
Share on other sites

  • 1 month later...

As best as I can see they didn't make any changes to the science system in 23.5. The only addition is ModuleAsteroid which has a KSPEvent that generates science reports for EVA Kerbals.

ModuleScienceExperiment appears to be unchanged and there are no additional experimental or vessel situations to account for the presence of an asteroid.

Link to comment
Share on other sites

  • 1 month later...

uhm i read the op but it didn't say anything about science labs and how they are done... or how they are put together (as in .cfg not moddeling :P) i'm trying to make a robotic (like a small sas sized module) that cleans out experiments but i'm stuck on that... i was looking trough the stock lab but i got stuck and gave up.

Link to comment
Share on other sites

Hi. I'm trying to make a new experiment via MM patch for a space station lab part. I want it to:

- Generate a tiny amount of science/day.

- Work while timewarping and while other vessels are selected.

- The gathered science should be possible to be transmitted always, i.e. you shouldn't have to reach the cap for the given biome before you can transmit.

I think I got the rest figured out. However, I'm not sure where I should begin. Does anyone know of a plugin that can handle this?

Thanks!

Link to comment
Share on other sites

  • 3 months later...

Additional researchnodes.

A few extra empty nodes have been added to allow easy endgame tie-in by mods. As shown here: http://i.imgur.com/OkwRzka.png

Names are as follows:

experimentalRocketry

nanolathing

experimentalAerodynamics

aerospaceTech

experimentalElectrics

experimentalScience

automation

experimentalsMotors

If you have something that feels relevant please post it in this thread.

Looks like only experimentalAerodynamics has been added yet to the stock tech tree ! Anyone can confirm ?

On 0.23.5, it's the only extra node I got.

Link to comment
Share on other sites

My understanding is that they all exist in the code, but they become visible if you assign a part to them.

That's supposed to be this way, but even with parts assigned to experimentalsMotors node, it doesn't appears.

But in the same condition, experimentalAerodynamics is there. And it's the only one to be in the persitent save file for what it's worth.

I just see it has a 's' whereas other don't: experimentalsMotors, could be a spelling mistake from the author :huh: !

CONFIRMED: op's mistake, the 's' is exceeding ! (it was not on the pic by the way, but here there is a space instead !)

Edited by Justin Kerbice
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...