Skip to content

Commit

Permalink
Merge pull request #82 from DMagic1/dev
Browse files Browse the repository at this point in the history
Version 1.3.12
  • Loading branch information
DMagic1 authored Mar 15, 2018
2 parents 95fe3df + c529f3b commit 3ccf69b
Show file tree
Hide file tree
Showing 16 changed files with 261 additions and 64 deletions.
13 changes: 12 additions & 1 deletion GameData/DMagicOrbitalScience/Change Log.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions GameData/DMagicOrbitalScience/DMagicOrbitalScience.version
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
5 changes: 5 additions & 0 deletions GameData/DMagicOrbitalScience/OversizeScience/LargeRecon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions GameData/DMagicOrbitalScience/OversizeScience/SIGINT.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions GameData/DMagicOrbitalScience/OversizeScience/SIGINT_End.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions GameData/DMagicOrbitalScience/OversizeScience/SmallRecon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions GameData/DMagicOrbitalScience/Resources/DMagicSCANsatScanner.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ Universal Storage Magnetometer Ore Scanner
rate = 1.5
}
}

MODULE
{
name = SCANexperiment
experimentType = SCANsatBiomeAnomaly
}
}

@PART[dmImagingPlatform]:FOR[DMagic]:NEEDS[CommunityResourcePack]
Expand Down Expand Up @@ -139,6 +145,12 @@ Universal Storage Magnetometer Ore Scanner
rate = 1.5
}
}

MODULE
{
name = SCANexperiment
experimentType = SCANsatBiomeAnomaly
}
}

@PART[dmUSImagingPlatform]:FOR[DMagic]:NEEDS[UniversalStorage,CommunityResourcePack]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Source/Parameters/DMPartRequestParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 16 additions & 4 deletions Source/Parameters/DMSpecificOrbitParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion Source/Part Modules/DMAsteroidScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion Source/Part Modules/DMBasicScienceModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
128 changes: 99 additions & 29 deletions Source/Part Modules/DMBreakablePart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand All @@ -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)
{
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -414,6 +482,8 @@ protected virtual void onBreak()

broken = true;

SetDragWeight(0);

if (fixable)
Events["fixPart"].active = true;
}
Expand Down
Loading

0 comments on commit 3ccf69b

Please sign in to comment.