diff --git a/GameData/DMagicOrbitalScience/Change Log.txt b/GameData/DMagicOrbitalScience/Change Log.txt index 811d82b..9f85545 100644 --- a/GameData/DMagicOrbitalScience/Change Log.txt +++ b/GameData/DMagicOrbitalScience/Change Log.txt @@ -1,4 +1,15 @@ -v1.3.11 +v1.3.12 +- Update for KSP 1.4 + +- Fix drag cubes for oversized science parts; recon and SIGINT +- Set drag cubes for deployed SIGINT dishes + - Makes them essentially unusable in an atmosphere +- Fix some errors when initializing parts in the editor +- Increase seismic pod crash tolerance +- Fix an error with specific orbit contracts +- Update SCANsat MM patches + +v1.3.11 - Fix some Module Manager related problems with Universal Storage and Community Tech Tree experiments - Fix some potential errors in detecting orbit for magnetic field and reconnaissance survey contracts - Fix agency title diff --git a/GameData/DMagicOrbitalScience/DMagicOrbitalScience.version b/GameData/DMagicOrbitalScience/DMagicOrbitalScience.version index d7954af..ebcc9a4 100644 --- a/GameData/DMagicOrbitalScience/DMagicOrbitalScience.version +++ b/GameData/DMagicOrbitalScience/DMagicOrbitalScience.version @@ -11,21 +11,21 @@ "MAJOR":1, "MINOR":3, "PATCH":0, - "BUILD":11 + "BUILD":12 }, "KSP_VERSION":{ "MAJOR":1, - "MINOR":3, - "PATCH":0 + "MINOR":4, + "PATCH":1 }, "KSP_VERSION_MIN":{ "MAJOR":1, - "MINOR":3, + "MINOR":4, "PATCH":0 }, "KSP_VERSION_MAX":{ "MAJOR":1, - "MINOR":3, + "MINOR":4, "PATCH":8 } } diff --git a/GameData/DMagicOrbitalScience/OversizeScience/LargeRecon.cfg b/GameData/DMagicOrbitalScience/OversizeScience/LargeRecon.cfg index 52ba709..74a4c33 100644 --- a/GameData/DMagicOrbitalScience/OversizeScience/LargeRecon.cfg +++ b/GameData/DMagicOrbitalScience/OversizeScience/LargeRecon.cfg @@ -53,6 +53,11 @@ dragModelType = default maximum_drag = 0.2 minimum_drag = 0.2 +DRAG_CUBE +{ + cube = Default, 12.1,0.7469,1.313, 12.09,0.7496,1.313, 4.87,0.9844,0.2447, 4.87,0.9841,0.2447, 12.5,0.7961,1.281, 12.5,0.7828,1.556, -1.192E-05,0.0001442,0.0005844, 2.5,5,2.5 +} + MODULE { name = ModuleKerbNetAccess diff --git a/GameData/DMagicOrbitalScience/OversizeScience/SIGINT.cfg b/GameData/DMagicOrbitalScience/OversizeScience/SIGINT.cfg index 5f78985..cf310bc 100644 --- a/GameData/DMagicOrbitalScience/OversizeScience/SIGINT.cfg +++ b/GameData/DMagicOrbitalScience/OversizeScience/SIGINT.cfg @@ -51,9 +51,10 @@ dragModelType = default maximum_drag = 0.2 minimum_drag = 0.2 -DRAG_CUBE + DRAG_CUBE { - cube = Default, 23.05664,0.7841103,1.35199, 23.05664,0.7814144,1.35199, 6.811737,0.7811469,1.07, 6.811737,0.7801012,1.07, 23.05664,0.7838199,1.351992, 23.05664,0.7872239,1.351992, -0.01584899,0.001224995,0.01347995, 2.93416,8.068184,2.934163 + cube = Clean, 23.06,0.7841,1.352, 23.06,0.7814,1.352, 6.812,0.7811,1.07, 6.812,0.7801,1.07, 23.06,0.7838,1.352, 23.06,0.7872,1.352, -0.01585,0.001225,0.01348, 2.934,8.068,2.934 + cube = Deployed, 750,0.2485,53.82, 750,0.2545,52.99, 750,0.2467,102.2, 750,0.261,53.78, 3500,0.4111,40.13, 3500,0.4163,36.17, 7.629E-06,0.5486,-30, 105.4,105.3,62.97 } MODULE diff --git a/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_End.cfg b/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_End.cfg index bc42805..53256e5 100644 --- a/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_End.cfg +++ b/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_End.cfg @@ -49,9 +49,10 @@ minimum_drag = 0.2 DRAG_CUBE { cube = Fairing, 20.38,0.7591,1.558, 20.38,0.7593,1.558, 6.665,0.4144,4.341, 6.665,0.7975,1.029, 20.33,0.7648,1.558, 20.33,0.763,1.558, -1.192E-07,-4.768E-07,1.192E-07, 2.929,8,2.929 - cube = Clean, 13.58,0.7449,1.546, 13.58,0.7452,1.546, 6.665,0.9836,5.636, 6.665,0.7975,1.049, 13.58,0.7247,1.546, 13.58,0.7213,1.546, 2.384E-07,-0.7577,4.768E-07, 2.929,6.485,2.929 + cube = Clean, 13.58,0.7449,1.546, 13.58,0.7452,1.546, 6.665,0.999,5.636, 6.665,0.7975,1.049, 13.58,0.7247,1.546, 13.58,0.7213,1.546, 2.384E-07,-0.7577,4.768E-07, 2.929,6.485,2.929 + cube = Deployed, 750,0.2181,53.82, 750,0.2161,53.4, 3500,0.4084,40.28, 3500,0.4106,17.12, 750,0.218,53.82, 750,0.2236,53.82, -3.815E-06,16.69,-0.06113, 105.4,41.38,105.4 } - + MODULE { name = DMSIGINT diff --git a/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_Small.cfg b/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_Small.cfg index 5c114c1..889b978 100644 --- a/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_Small.cfg +++ b/GameData/DMagicOrbitalScience/OversizeScience/SIGINT_Small.cfg @@ -53,11 +53,14 @@ dragModelType = default maximum_drag = 0.2 minimum_drag = 0.2 -DRAG_CUBE + + DRAG_CUBE { - cube = Default, 5.76416,0.39205515,0.675995, 5.76416,0.39205515,0.675995, 1.702934,0.39057,0.535, 1.702934,0.39057,0.535, 5.76416,0.39205515,0.675995, 5.76416,0.39205515,0.675995, -0.01584899,0.001224995,0.01347995, 1.46708,4.034092,1.46708 + cube = Clean, 5.764,0.5921,0.676, 5.764,0.5921,0.676, 1.503,0.3906,0.535, 1.503,0.3906,0.535, 5.764,0.5921,0.676, 5.764,0.5921,0.676, -0.01585,0.001225,0.01348, 1.467,4.034,1.467 + cube = Deployed, 250,0.2485,26.96, 250,0.2545,26.54, 250,0.2467,51.19, 250,0.261,26.94, 1000,0.4111,20.13, 1000,0.4163,18.14, 3.815E-06,0.2743,-15, 52.68,52.65,31.48 } - + + MODULE { name = DMSIGINT diff --git a/GameData/DMagicOrbitalScience/OversizeScience/SmallRecon.cfg b/GameData/DMagicOrbitalScience/OversizeScience/SmallRecon.cfg index 4c11aa8..86f6237 100644 --- a/GameData/DMagicOrbitalScience/OversizeScience/SmallRecon.cfg +++ b/GameData/DMagicOrbitalScience/OversizeScience/SmallRecon.cfg @@ -53,6 +53,11 @@ dragModelType = default maximum_drag = 0.2 minimum_drag = 0.2 +DRAG_CUBE +{ + cube = Default, 4.238,0.7378,0.7295, 4.238,0.737,0.7295, 1.247,0.9896,0.1453, 1.247,0.9913,0.1453, 4.418,0.7985,0.6663, 4.418,0.7783,0.7755, 5.698E-05,0.002962,9.716E-06, 1.265,3.506,1.265 +} + MODULE { name = ModuleKerbNetAccess diff --git a/GameData/DMagicOrbitalScience/Resources/DMagicSCANsatScanner.cfg b/GameData/DMagicOrbitalScience/Resources/DMagicSCANsatScanner.cfg index bce5ab5..e2bacb0 100644 --- a/GameData/DMagicOrbitalScience/Resources/DMagicSCANsatScanner.cfg +++ b/GameData/DMagicOrbitalScience/Resources/DMagicSCANsatScanner.cfg @@ -78,6 +78,12 @@ Universal Storage Magnetometer Ore Scanner rate = 1.5 } } + + MODULE + { + name = SCANexperiment + experimentType = SCANsatBiomeAnomaly + } } @PART[dmImagingPlatform]:FOR[DMagic]:NEEDS[CommunityResourcePack] @@ -139,6 +145,12 @@ Universal Storage Magnetometer Ore Scanner rate = 1.5 } } + + MODULE + { + name = SCANexperiment + experimentType = SCANsatBiomeAnomaly + } } @PART[dmUSImagingPlatform]:FOR[DMagic]:NEEDS[UniversalStorage,CommunityResourcePack] diff --git a/GameData/DMagicOrbitalScience/RoverScience/Seismic/seismic.cfg b/GameData/DMagicOrbitalScience/RoverScience/Seismic/seismic.cfg index 703738f..7cf9fd3 100644 --- a/GameData/DMagicOrbitalScience/RoverScience/Seismic/seismic.cfg +++ b/GameData/DMagicOrbitalScience/RoverScience/Seismic/seismic.cfg @@ -29,7 +29,7 @@ attachRules = 0,1,0,0,0 // --- standard part parameters --- mass = 0.0075 bulkheadProfiles = srf -crashTolerance = 150 +crashTolerance = 400 maxTemp = 2600 emissiveConstant = 0.85 thermalMassModifier = 4.0 diff --git a/Source/Parameters/DMPartRequestParameter.cs b/Source/Parameters/DMPartRequestParameter.cs index d399e23..6b9dc95 100644 --- a/Source/Parameters/DMPartRequestParameter.cs +++ b/Source/Parameters/DMPartRequestParameter.cs @@ -332,7 +332,7 @@ private Waypoint setupNewWaypoint(Vessel v) wp.altitude = 0; wp.index = 0; wp.id = "dmVessel"; - wp.iconSize = 32; + wp.iconSize = 48; wp.blocksInput = false; wp.seed = SystemUtilities.SuperSeed(this.Root); wp.isOnSurface = false; diff --git a/Source/Parameters/DMSpecificOrbitParameter.cs b/Source/Parameters/DMSpecificOrbitParameter.cs index 7fadb34..1b3aee8 100644 --- a/Source/Parameters/DMSpecificOrbitParameter.cs +++ b/Source/Parameters/DMSpecificOrbitParameter.cs @@ -72,10 +72,22 @@ public DMSpecificOrbitParameter(OrbitType orbitType, double inclination, double private void setupOrbit(bool ksc) { - if (ksc) - KSCOrbit = new Orbit(inc, ecc, sma, lan, aop, mae, epo, body); - else - SetupRenderer(); + if (ksc) + { + //KSCOrbit = new Orbit(inc, ecc, sma, lan, aop, mae, epo, body); + KSCOrbit = new Orbit(); + + KSCOrbit.inclination = inc; + KSCOrbit.eccentricity = ecc; + KSCOrbit.semiMajorAxis = sma; + KSCOrbit.LAN = lan; + KSCOrbit.argumentOfPeriapsis = aop; + KSCOrbit.meanAnomalyAtEpoch = mae; + KSCOrbit.epoch = epo; + KSCOrbit.referenceBody = body; + } + else + SetupRenderer(); //orbitRenderer = ContractOrbitRenderer.Setup(Root, new Orbit(inc, ecc, sma, lan, aop, mae, epo, body)); orbitLoaded = true; diff --git a/Source/Part Modules/DMAsteroidScanner.cs b/Source/Part Modules/DMAsteroidScanner.cs index 139d4f8..12217b8 100644 --- a/Source/Part Modules/DMAsteroidScanner.cs +++ b/Source/Part Modules/DMAsteroidScanner.cs @@ -142,7 +142,9 @@ public override void OnStart(PartModule.StartState state) if (FlightGlobals.Bodies.Count >= 17) asteroidBodyNameFixed = FlightGlobals.Bodies[16].bodyName; - findContainers(); + + if (!HighLogic.LoadedSceneIsEditor) + findContainers(); } public override void OnSave(ConfigNode node) diff --git a/Source/Part Modules/DMBasicScienceModule.cs b/Source/Part Modules/DMBasicScienceModule.cs index db6a0f3..00c4444 100644 --- a/Source/Part Modules/DMBasicScienceModule.cs +++ b/Source/Part Modules/DMBasicScienceModule.cs @@ -148,9 +148,10 @@ public override void OnStart(PartModule.StartState state) setup(); if (IsDeployed) primaryAnimator(1f, 1f, WrapMode.Default, animationName, anim); + + findContainers(); } - findContainers(); } public override void OnSave(ConfigNode node) diff --git a/Source/Part Modules/DMBreakablePart.cs b/Source/Part Modules/DMBreakablePart.cs index 1f9da59..5feee17 100644 --- a/Source/Part Modules/DMBreakablePart.cs +++ b/Source/Part Modules/DMBreakablePart.cs @@ -66,7 +66,10 @@ public class DMBreakablePart : DMModuleScienceAnimate [KSPField] public float componentMass = 0.1f; - public override void OnStart(PartModule.StartState state) + private bool dragDeploying; + private bool dragRetracting; + + public override void OnStart(PartModule.StartState state) { base.OnStart(state); @@ -76,12 +79,12 @@ public override void OnStart(PartModule.StartState state) if (!string.IsNullOrEmpty(forwardTransformName)) forwardTransform = part.FindModelTransform(forwardTransformName); - if (broken) - { - setTransformState(false); - base.Events["retractEvent"].active = base.IsDeployed && showEndEvent; - base.Events["deployEvent"].active = false; - } + if (broken) + { + setTransformState(false); + base.Events["retractEvent"].active = base.IsDeployed && showEndEvent; + base.Events["deployEvent"].active = false; + } Events["fixPart"].active = fixable && breakable && broken; Events["fixPart"].unfocusedRange = interactionRange; @@ -104,22 +107,78 @@ public override string GetInfo() return info; } - public override void OnFixedUpdate() - { - base.OnFixedUpdate(); + protected override void FixedUpdate() + { + base.FixedUpdate(); - if (!breakable) - return; + if (!breakable) + return; - //BForce = breakingForce.ToString("F2"); + if (!IsDeployed) + return; - if (broken) - return; + //BForce = breakingForce.ToString("F2"); - checkForces(); - } + if (broken) + return; + + checkForces(); + } + + // public override void OnFixedUpdate() + //{ + // base.OnFixedUpdate(); + + // if (!breakable) + // return; - public override bool canConduct() + // //BForce = breakingForce.ToString("F2"); + + // if (broken) + // return; + + // checkForces(); + //} + + protected override void Update() + { + base.Update(); + + if (dragDeploying) + { + float time = anim[animationName].normalizedTime; + + SetDragWeight(time); + + if (time >= 0.95f) + { + dragDeploying = false; + dragRetracting = false; + SetDragWeight(1); + } + } + else if (dragRetracting) + { + float time = anim[animationName].normalizedTime; + + SetDragWeight(time); + + if (time <= 0.05f) + { + dragDeploying = false; + dragRetracting = false; + SetDragWeight(0); + } + } + } + + private void SetDragWeight(float scalar) + { + part.DragCubes.SetCubeWeight("Deployed", scalar); + part.DragCubes.SetCubeWeight("Clean", 1f - scalar); + } + + public override bool canConduct() { if (broken) { @@ -134,11 +193,20 @@ public override void deployEvent() { base.deployEvent(); - if (broken && !oneWayAnimation) + dragDeploying = true; + + if (broken && !oneWayAnimation) base.Events["retractEvent"].active = true; } - protected virtual void setTransformState(bool on) + public override void retractEvent() + { + base.retractEvent(); + + dragRetracting = true; + } + + protected virtual void setTransformState(bool on) { if (!breakable) return; @@ -165,23 +233,23 @@ private void checkForces() if (!IsDeployed) return; - + if (forwardTransform == null) return; - - if (anim != null) + + if (anim != null) { if (anim.IsPlaying(animationName)) return; } - - if (vessel.HoldPhysics) + + if (vessel.HoldPhysics) return; - - if (shieldedState()) + + if (shieldedState()) return; - - float velocity = Mathf.Abs(Vector3.Dot(vessel.srf_velocity.normalized, forwardTransform.forward.normalized)); + + float velocity = Mathf.Abs(Vector3.Dot(vessel.srf_velocity.normalized, forwardTransform.forward.normalized)); if (velocity < 0.0001f) velocity = 0.0001f; float pressure = velocity * (float)(part.dynamicPressurekPa + part.submergedDynamicPressurekPa); @@ -414,6 +482,8 @@ protected virtual void onBreak() broken = true; + SetDragWeight(0); + if (fixable) Events["fixPart"].active = true; } diff --git a/Source/Part Modules/DMSIGINT.cs b/Source/Part Modules/DMSIGINT.cs index fde6b61..9fffd14 100644 --- a/Source/Part Modules/DMSIGINT.cs +++ b/Source/Part Modules/DMSIGINT.cs @@ -62,7 +62,7 @@ public class DMSIGINT : DMBreakablePart, IDMSurvey, IScalarModule private float scalar; private float scalarStep; private bool moving; - private float deployScalar; + private float deployScalar; private bool transformState = true; EventData onStop; @@ -75,7 +75,7 @@ public override void OnStart(PartModule.StartState state) assignTransforms(); assignObjects(); - + base.OnStart(state); if (scienceExp != null && !noScience) @@ -127,8 +127,8 @@ public override void OnStart(PartModule.StartState state) Events["jettison"].active = !IsDeployed; Actions["jettisonAction"].active = !IsDeployed; - } - } + } + } else { Events["jettison"].active = false; @@ -138,6 +138,8 @@ public override void OnStart(PartModule.StartState state) if (state == StartState.Editor) return; + StartCoroutine(WaitForDragCubes()); + if (IsDeployed) { deployScalar = 1; @@ -154,8 +156,12 @@ public override void OnStart(PartModule.StartState state) if (j == null) continue; - if (j.isJettisoned) - return; + if (j.isJettisoned) + { + part.stackIcon.SetIconColor(XKCDColors.SlateGrey); + + return; + } } } } @@ -163,6 +169,59 @@ public override void OnStart(PartModule.StartState state) setTransformState(false); } + private IEnumerator WaitForDragCubes() + { + yield return new WaitForEndOfFrame(); + + bool jettisoned = false; + + if (useFairings) + { + if (fairings.Count > 0) + { + foreach (ModuleJettison j in fairings) + { + if (j == null) + continue; + + if (j.isJettisoned) + { + jettisoned = true; + break; + } + } + } + } + + if (!IsDeployed) + { + if (jettisoned) + { + part.DragCubes.SetCubeWeight("Fairing", 0); + part.DragCubes.SetCubeWeight("Clean", 1); + part.DragCubes.SetCubeWeight("Deployed", 0); + } + else + { + part.DragCubes.SetCubeWeight("Fairing", useFairings ? 1 : 0); + part.DragCubes.SetCubeWeight("Clean", useFairings ? 0 : 1); + part.DragCubes.SetCubeWeight("Deployed", 0); + } + } + else if (breakable && broken) + { + part.DragCubes.SetCubeWeight("Fairing", 0); + part.DragCubes.SetCubeWeight("Clean", 1); + part.DragCubes.SetCubeWeight("Deployed", 0); + } + else + { + part.DragCubes.SetCubeWeight("Fairing", 0); + part.DragCubes.SetCubeWeight("Clean", 0); + part.DragCubes.SetCubeWeight("Deployed", 1); + } + } + private void assignTransforms() { for (int i = 0; i < dishTransformNames.Length; i++) @@ -253,7 +312,7 @@ public override void deployEvent() if (!transformState) setTransformState(true); - + if (useFairings) { if (HighLogic.LoadedSceneIsEditor) @@ -283,8 +342,8 @@ public override void retractEvent() { if (moving) return; - - deployScalar = 0; + + deployScalar = 0; scalar = 0; base.retractEvent(); @@ -300,6 +359,13 @@ public override void OnActive() return; } + if (IsDeployed) + { + Events["jettison"].active = false; + Actions["jettisonAction"].active = false; + return; + } + if (useFairings && stagingEnabled && !string.IsNullOrEmpty(part.stagingIcon)) { if (!transformState) @@ -458,13 +524,15 @@ public void SetScalar(float t) } } - anim[animationName].speed = 0f; + anim[animationName].speed = 0f; anim[animationName].enabled = true; moving = true; t = Mathf.MoveTowards(scalar, t, scalarStep * Time.deltaTime); + SetDragWeight(t); + anim[animationName].normalizedTime = t; anim.Blend(animationName); scalar = t; @@ -480,6 +548,12 @@ public void SetUIWrite(bool state) } + private void SetDragWeight(float scalar) + { + part.DragCubes.SetCubeWeight("Deployed", scalar); + part.DragCubes.SetCubeWeight("Clean", 1f - scalar); + } + public string ScalarModuleID { get { return "dmsigint"; } @@ -500,7 +574,7 @@ protected override void Update() Events["CleanUpExperimentExternal"].active = false; Deployed = true; } - + if (!moving) return; diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index 4e2b7d6..6f0a088 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -19,7 +19,7 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("5428988e-53a6-4d8e-8af4-014572513e22")] -[assembly: AssemblyVersion("1.3.0.11")] -[assembly: AssemblyFileVersion("1.3.0.11")] -[assembly: AssemblyInformationalVersion("v1.3.11")] +[assembly: AssemblyVersion("1.3.0.12")] +[assembly: AssemblyFileVersion("1.3.0.12")] +[assembly: AssemblyInformationalVersion("v1.3.12")] [assembly: KSPAssembly("DMagic", 1, 4)]