Skip to content

Commit

Permalink
Merge pull request #56 from DMagic1/dev
Browse files Browse the repository at this point in the history
Version 1.2.3
  • Loading branch information
DMagic1 committed Apr 19, 2016
2 parents d842668 + 8b5757f commit fdf2f0f
Show file tree
Hide file tree
Showing 29 changed files with 288 additions and 149 deletions.
23 changes: 19 additions & 4 deletions GameData/DMagicOrbitalScience/Change Log.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
v1.2.3
- Updated for KSP 1.1 final release

v1.2.2
- Updated for KSP 1.1.1215

- Fix SIGINT size issues
- Add empty transforms in recon cameras for TST usage
- Fix some issues with science labs

v1.2.1
- Updated for KSP 1.1.1183

- Broken SIGINT dish no longer able to collect science

v1.2
- Added three new parts based on orbital recconnaisance satellites
- Added three new parts based on orbital reconnaissance satellites
- All parts have pseudo-biome support; northern and southern hemispheres
- Each part conducts an anomaly scan of the planet; used for anomaly contracts and the anomaly instrument

- Single-Camera small recon satellite
- 1.25m telescope
- Two film cannisters
- Two film canisters

- Two-camera stereo recon satellite
- 2.5m telescope
- Four film cannisters
- Four film canisters

- Radio signals intelligence dish
- 2.5m instrument; expands to 3m in the center
Expand All @@ -35,7 +50,7 @@ v1.2
- Seismic impact hammer no longer makes a minimum distance check
- Impact hammer collider removed; no longer a threat of catapulting your vessel
- Seismic sensor pod crash tolerance increased; decouple strength lowered
- Seismic sensor pod cose, mass and size reduced
- Seismic sensor pod cost, mass and size reduced
- Seismic settings found in GameData/DMagicOrbitalScience/Resources/DMSeismicSettings.cfg

- Fix scaling issues for all parts
Expand Down
18 changes: 9 additions & 9 deletions GameData/DMagicOrbitalScience/DMagicOrbitalScience.version
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"NAME":"DMagic Orbital Science",
"URL":"https://raw.githubusercontent.com/DMagic1/Orbital-Science/master/GameData/DMagicOrbitalScience/DMagicOrbitalScience.version",
"DOWNLOAD":"https://spacedock.info/mod/128/DMagic%20Orbital%20Science/download/1.2",
"URL":"https://raw.githubusercontent.com/DMagic1/Orbital-Science/dev/GameData/DMagicOrbitalScience/DMagicOrbitalScience.version",
"DOWNLOAD":"https://spacedock.info/mod/128/DMagic%20Orbital%20Science/download/1.2.3",
"GITHUB":{
"USERNAME":"DMagic1",
"REPOSITORY":"Orbital-Science",
Expand All @@ -10,22 +10,22 @@
"VERSION":{
"MAJOR":1,
"MINOR":2,
"PATCH":0,
"PATCH":3,
"BUILD":0
},
"KSP_VERSION":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
},
"KSP_VERSION_MIN":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":0,
"PATCH":5
"MINOR":1,
"PATCH":0
}
}
2 changes: 1 addition & 1 deletion GameData/DMagicOrbitalScience/Installation ReadMe.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version 1.2
Version 1.2.3
KSP Forum thread: http://forum.kerbalspaceprogram.com/index.php?/topic/59009-1
Installation:

Expand Down
2 changes: 2 additions & 0 deletions GameData/DMagicOrbitalScience/OversizeScience/LargeRecon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ MODULE

animationName = reconDeploy
loopingAnimName = scopes

openDoorsOnly = false

filmCannisterName = cannister

Expand Down
Binary file modified GameData/DMagicOrbitalScience/OversizeScience/LargeRecon.mu
Binary file not shown.
4 changes: 2 additions & 2 deletions GameData/DMagicOrbitalScience/OversizeScience/SIGINT.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ MODULE
startEventGUIName = Deploy Dish
showStartEvent = true
endEventGUIName = Retract Dish
showEndEvent = true
showEditorEvents = false
showEndEvent = false
showEditorEvents = true
showToggleEvent = false
toggleEventGUIName = Toggle Dish
Expand Down
Binary file modified GameData/DMagicOrbitalScience/OversizeScience/SIGINT.mu
Binary file not shown.
2 changes: 2 additions & 0 deletions GameData/DMagicOrbitalScience/OversizeScience/SmallRecon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ MODULE

animationName = reconDeploy
loopingAnimName = scope

openDoorsOnly = false

filmCannisterName = cannister

Expand Down
Binary file modified GameData/DMagicOrbitalScience/OversizeScience/SmallRecon.mu
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/Contracts/DMMagneticSurveyContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ protected override bool Generate()
this.agent = AgentList.Instance.GetAgentRandom();

base.SetExpiry(DMContractDefs.DMMagnetic.Expire.MinimumExpireDays, DMContractDefs.DMMagnetic.Expire.MaximumExpireDays);
base.SetDeadlineDays((float)(time / KSPUtil.KerbinDay) * DMContractDefs.DMMagnetic.Expire.DeadlineModifier * (this.GetDestinationWeight(body) / 1.8f) * primaryModifier, null);
base.SetDeadlineDays((float)(time / ((KSPUtil.DefaultDateTimeFormatter)KSPUtil.dateTimeFormatter).KerbinDay) * DMContractDefs.DMMagnetic.Expire.DeadlineModifier * (this.GetDestinationWeight(body) / 1.8f) * primaryModifier, null);
base.SetReputation(DMContractDefs.DMMagnetic.Reputation.BaseReward * Mod, DMContractDefs.DMMagnetic.Reputation.BaseFailure * Mod, null);
base.SetFunds(DMContractDefs.DMMagnetic.Funds.BaseAdvance * Mod, DMContractDefs.DMMagnetic.Funds.BaseReward * Mod, DMContractDefs.DMMagnetic.Funds.BaseFailure * Mod, body);
base.SetScience(DMContractDefs.DMMagnetic.Science.BaseReward * Mod, body);
Expand Down
2 changes: 1 addition & 1 deletion Source/Contracts/DMReconContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ protected override bool Generate()
this.agent = AgentList.Instance.GetAgentRandom();

base.SetExpiry(DMContractDefs.DMRecon.Expire.MinimumExpireDays, DMContractDefs.DMRecon.Expire.MaximumExpireDays);
base.SetDeadlineDays((float)(time / KSPUtil.KerbinDay) * DMContractDefs.DMRecon.Expire.DeadlineModifier * (this.GetDestinationWeight(body) / 1.4f) * primaryModifier, null);
base.SetDeadlineDays((float)(time / ((KSPUtil.DefaultDateTimeFormatter)KSPUtil.dateTimeFormatter).KerbinDay) * DMContractDefs.DMRecon.Expire.DeadlineModifier * (this.GetDestinationWeight(body) / 1.4f) * primaryModifier, null);
base.SetReputation(DMContractDefs.DMRecon.Reputation.BaseReward * Mod, DMContractDefs.DMRecon.Reputation.BaseFailure * Mod, null);
base.SetFunds(DMContractDefs.DMRecon.Funds.BaseAdvance * Mod, DMContractDefs.DMRecon.Funds.BaseReward * Mod, DMContractDefs.DMRecon.Funds.BaseFailure * Mod, body);
base.SetScience(DMContractDefs.DMRecon.Science.BaseReward * Mod, body);
Expand Down
1 change: 0 additions & 1 deletion Source/DMConfigLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ private void Start()
seismicLoad();
configLoad();
hackWaypointIcons();
fixPartIcons();
loaded = true;
}

Expand Down
3 changes: 1 addition & 2 deletions Source/DMSeismicHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public static DMSeismicHandler Instance
private Dictionary<uint, DMSeismometerValues> hammers = new Dictionary<uint, DMSeismometerValues>();

private static string bodyNameFixed = "Eeloo";
private const string potato = "PotatoRoid";

private void Start()
{
Expand Down Expand Up @@ -403,7 +402,7 @@ public static ScienceData makeData(DMSeismometerValues sensor, float score, Scie
sub.title = exp.experimentTitle + string.Format(" from {0}'s {1}", body.theName, biome);
}

return new ScienceData(science, 1f, 1f, sub.id, sub.title, false, sensor.ID);
return new ScienceData(science, 1f, v.VesselValues.ScienceReturn.value, sub.id, sub.title, false, sensor.ID);
}

private static void registerDMScience(DMAsteroidScience newAst, ScienceExperiment exp, ScienceSubject sub)
Expand Down
4 changes: 2 additions & 2 deletions Source/DMUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ internal static double bearing(double lat1, double lon1, double lat2, double lon
internal static double timeInDays(double D)
{
if (GameSettings.KERBIN_TIME)
D /= KSPUtil.KerbinDay;
D /= ((KSPUtil.DefaultDateTimeFormatter)KSPUtil.dateTimeFormatter).KerbinDay;
else
D /= KSPUtil.EarthDay;
D /= ((KSPUtil.DefaultDateTimeFormatter)KSPUtil.dateTimeFormatter).EarthDay;
return D;
}

Expand Down
16 changes: 14 additions & 2 deletions Source/DMagicOrbital.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,24 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\KSP Dev\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="KSPUtil">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPUtil.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine">
<HintPath>..\..\KSP Dev\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/Parameters/DMPartRequestParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private Waypoint setupNewWaypoint(Vessel v)
wp.altitude = 0;
wp.index = 0;
wp.id = "dmVessel";
wp.size = new Vector2(32, 32);
wp.iconSize = 32;
wp.seed = SystemUtilities.SuperSeed(this.Root);
wp.isOnSurface = false;
wp.isNavigatable = false;
Expand Down
57 changes: 33 additions & 24 deletions Source/Parameters/DMSpecificOrbitParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class DMSpecificOrbitParameter : SpecificOrbitParameter
private bool orbitLoaded;
private bool orbitTested;
private DMLongOrbitParameter root;
private Orbit KSCOrbit = null;

public DMSpecificOrbitParameter() { }

Expand All @@ -66,23 +67,14 @@ public DMSpecificOrbitParameter(OrbitType orbitType, double inclination, double
deviation = deviationWindow;
root = r;
disableOnStateChange = false;
setupOrbit();
testOrbit();
}

private void setupOrbit()
private void setupOrbit(bool ksc)
{
orbitDriver = new OrbitDriver();
orbitDriver.orbit = new Orbit();
orbitDriver.orbit.referenceBody = body;
orbitDriver.orbit.inclination = inc;
orbitDriver.orbit.eccentricity = ecc;
orbitDriver.orbit.argumentOfPeriapsis = aop;
orbitDriver.orbit.semiMajorAxis = sma;
orbitDriver.orbit.LAN = lan;
orbitDriver.orbit.meanAnomalyAtEpoch = mae;
orbitDriver.orbit.epoch = epo;
orbitDriver.orbit.Init();
if (ksc)
KSCOrbit = new Orbit(inc, ecc, sma, lan, aop, mae, epo, body);
else
orbitRenderer = ContractOrbitRenderer.Setup(Root, new Orbit(inc, ecc, sma, lan, aop, mae, epo, body));

orbitLoaded = true;
}
Expand All @@ -97,17 +89,29 @@ protected override void OnUpdate()

if (!orbitTested)
{
orbitLoaded = testOrbit();
setupOrbit(HighLogic.LoadedScene == GameScenes.SPACECENTER);
orbitLoaded = testOrbit(HighLogic.LoadedScene == GameScenes.SPACECENTER);
orbitTested = true;
}

if (!orbitLoaded)
return;

if (orbitDriver.orbit == null)
if (HighLogic.LoadedScene != GameScenes.SPACECENTER)
{
this.SetIncomplete();
return;
if (orbitRenderer == null)
return;

if (orbitRenderer.driver == null)
return;

if (orbitRenderer.driver.orbit == null)
return;
}
else
{
if (KSCOrbit == null)
return;
}

if (root == null)
Expand All @@ -123,7 +127,7 @@ protected override void OnUpdate()
if (v == null)
continue;

if (VesselUtilities.VesselAtOrbit(orbitDriver.orbit, deviationWindow, v))
if (VesselUtilities.VesselAtOrbit(HighLogic.LoadedScene == GameScenes.SPACECENTER ? KSCOrbit : orbitRenderer.driver.orbit, deviationWindow, v))
{
this.SetComplete();
return;
Expand Down Expand Up @@ -172,25 +176,30 @@ protected override void OnLoad(ConfigNode node)
epo = node.parse("epoch", (double)0);
lan = node.parse("lan", (double)0);
deviation = node.parse("deviationWindow", (double)10);
setupOrbit();
setupOrbit(true);
}

if (this.Root.ContractState == Contract.State.Active)
orbitLoaded = testOrbit();
orbitLoaded = testOrbit(HighLogic.LoadedScene == GameScenes.SPACECENTER);
}

private bool testOrbit()
private bool testOrbit(bool ksc)
{
try
{
double d = orbitDriver.orbit.inclination;
double d = 0;
if (ksc)
d = KSCOrbit.inclination;
else
d = orbitRenderer.driver.orbit.inclination;
orbitTested = true;
DMUtils.DebugLog("Orbit Checks Out...");
return true;
}
catch (Exception e)
{
Debug.LogError("[DM] Error detected in setting up long term recon orbit parameter; deactivating\n" + e.StackTrace);
if (!HighLogic.LoadedSceneIsEditor)
Debug.LogError("[DM] Error detected in setting up long term recon orbit parameter; deactivating\n" + e.StackTrace);
return false;
}
}
Expand Down
5 changes: 3 additions & 2 deletions Source/Part Modules/DMAsteroidScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using System.Linq;
using UnityEngine;
using DMagic.Scenario;
using KSP.UI.Screens.Flight.Dialogs;

namespace DMagic.Part_Modules
{
Expand Down Expand Up @@ -773,7 +774,7 @@ private ScienceData makeScience(float dist, ModuleAsteroid m)
registerDMScience(ast, sub);
body.bodyName = asteroidBodyNameFixed;

data = new ScienceData(multiplier * exp.baseValue * sub.dataScale, transmitValue, 0f, sub.id, dataTitle, false, part.flightID);
data = new ScienceData(multiplier * exp.baseValue * sub.dataScale, transmitValue, vessel.VesselValues.ScienceReturn.value, sub.id, dataTitle, false, part.flightID);

return data;
}
Expand Down Expand Up @@ -810,7 +811,7 @@ private void experimentResultsPage(ScienceData data)
{
if (scienceReports.Count > 0)
{
ExperimentResultDialogPage page = new ExperimentResultDialogPage(part, data, transmitValue, 0f, false, "", true, ModuleScienceLab.IsLabData(vessel, data), new Callback<ScienceData>(onDiscardData), new Callback<ScienceData>(onKeepData), new Callback<ScienceData>(onTransmitData), new Callback<ScienceData>(onSendToLab));
ExperimentResultDialogPage page = new ExperimentResultDialogPage(part, data, transmitValue, 0f, false, "", true, new ScienceLabSearch(vessel, data), new Callback<ScienceData>(onDiscardData), new Callback<ScienceData>(onKeepData), new Callback<ScienceData>(onTransmitData), new Callback<ScienceData>(onSendToLab));
ExperimentsResultDialog.DisplayResult(page);
}
}
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 @@ -33,6 +33,7 @@
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using KSP.UI.Screens.Flight.Dialogs;

namespace DMagic.Part_Modules
{
Expand Down Expand Up @@ -355,7 +356,7 @@ private void experimentResultsPage(ScienceData data)
{
if (scienceReports.Count > 0)
{
ExperimentResultDialogPage page = new ExperimentResultDialogPage(part, data, transmitValue, 0f, false, "", true, ModuleScienceLab.IsLabData(vessel, data), new Callback<ScienceData>(onDiscardData), new Callback<ScienceData>(onKeepData), new Callback<ScienceData>(onTransmitData), new Callback<ScienceData>(onSendToLab));
ExperimentResultDialogPage page = new ExperimentResultDialogPage(part, data, transmitValue, 0f, false, "", true, new ScienceLabSearch(vessel, data), new Callback<ScienceData>(onDiscardData), new Callback<ScienceData>(onKeepData), new Callback<ScienceData>(onTransmitData), new Callback<ScienceData>(onSendToLab));
ExperimentsResultDialog.DisplayResult(page);
}
}
Expand Down
11 changes: 7 additions & 4 deletions Source/Part Modules/DMBathymetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ public override void OnStart(PartModule.StartState state)
Transform redLightT = part.FindModelTransform(redLightMaterial);
Transform blueLightT = part.FindModelTransform(blueLightMaterial);

if (redLightT != null && redLightT.renderer != null)
redLightMat = redLightT.renderer.material;
if (blueLightT != null && blueLightT.renderer != null)
blueLightMat = blueLightT.renderer.material;
Renderer redLightR = redLightT.GetComponent<Renderer>();
Renderer blueLightR = blueLightT.GetComponent<Renderer>();

if (redLightT != null && redLightR != null)
redLightMat = redLightR.material;
if (blueLightT != null && blueLightR != null)
blueLightMat = blueLightR.material;

if (redLight != null)
redLight.enabled = false;
Expand Down
Loading

0 comments on commit fdf2f0f

Please sign in to comment.