Skip to content

Commit

Permalink
Fixed SRBs failing during KRASH simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
severedsolo committed Dec 19, 2018
1 parent 0013bd0 commit ff15640
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 7 additions & 1 deletion GameData/Severedsolo/OhScrap/Changelog.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ KERBALCHANGELOG //Required to have this name
{
showChangelog = True //To show the changelog, this must be set to True
modName = OhScrap //Add your mod's name here
VERSION //Declares a version node
{
version = 1.4.1 //Version number, numbers only with no spaces!
change = Fixed SRBs being allowed to fail during KRASH simulations
}
VERSION //Declares a version node
{
version = 1.4 //Version number, numbers only with no spaces!
change = CKAN USERS ONLY: Kerbal Changelog by Benjamin Kerman is now a required dependency
change = MANUALLY INSTALLED USERS: Kerbal Changelog by Benjamin Kerman is bundled as an optional (but recommended) mod.
change = Recompile against KSP 1.5.1
change = Recompile against KSP 1.5.1
change = Failures will no longer be calculated per part. Instead, we'll take into account the overall reliability of the vessel, and use that to determine failure rates. (Ie, if you stick a bunch of really good parts on your rocket, and one really crappy one, the rocket will still be less prone to fail than one with all crappy parts). A really cool side effect of this, is that if you stage away your bad parts, your vessel will become more reliable overall (ie, you can have a bad launch vehicle, but a tried and tested payload, and once the launch vehicle is gone, the payload will be uber reliable).
change = Failures will be rolled for constantly (but rate limited) instead of just on loading the vessel. At the moment, it's every 10 seconds in atmosphere for the first two minutes, every 2.5 minutes after that while in atmosphere (known as "plane mode") and every 30 kerbal minutes out of the atmosphere - to simulate the fact that things are much more likely to go wrong on launch.
change = All of the above parameters can be edited in DefaultSettings.cfg which is located at OhScrap/PluginData
Expand Down
6 changes: 3 additions & 3 deletions GameData/Severedsolo/OhScrap/OhScrap.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
{
"MAJOR" : 1,
"MINOR" : 4,
"PATCH" : 0,
"PATCH" : 1,
"BUILD" : 0
},
"KSP_VERSION" :
{
"MAJOR" : 1,
"MINOR" : 4,
"PATCH" : 3
"MINOR" : 5,
"PATCH" : 1
},
"KSP_VERSION_MIN" :
{
Expand Down
3 changes: 1 addition & 2 deletions OhScrap/BaseFailureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ public void Initialise()
else safetyRating = 1;
if (hasFailed) part.FindModuleImplementing<ModuleUPFMEvents>().SetFailedHighlight();
ready = true;
if(HighLogic.LoadedScene == GameScenes.FLIGHT && isSRB && UPFMUtils.instance._randomiser.NextDouble() < chanceOfFailure) InvokeRepeating("FailPart", 0.5f, 0.5f);

if(HighLogic.LoadedScene == GameScenes.FLIGHT && FailureAllowed() && isSRB && UPFMUtils.instance._randomiser.NextDouble() < chanceOfFailure) InvokeRepeating("FailPart", 0.5f, 0.5f);
}

private float CalculateInitialFailureRate()
Expand Down
3 changes: 3 additions & 0 deletions OhScrap/ModuleUPFMEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ public void RefreshPart()
{
if (!HighLogic.LoadedSceneIsEditor || refreshed) return;
SYP = part.FindModuleImplementing<ModuleSYPartTracker>();
Debug.Log("[OhScrap]: Attempting to refresh part " + SYP.ID);
if (SYP.TimesRecovered == 0)
{
SYP.MakeFresh();
Debug.Log("[OhScrap]: Refreshed. New ID is " + SYP.ID);
}
else Debug.Log("[OhScrap]: " + SYP.ID + " has been recovered " + SYP.TimesRecovered + " times. No need to refresh");
refreshed = true;
}

Expand Down

0 comments on commit ff15640

Please sign in to comment.