Skip to content

Commit

Permalink
Update to 1.1.2
Browse files Browse the repository at this point in the history
v1.1.2
Update to 1.1.3:
- Recompiled plugin dll
Enhancements:
- The Cupola, Central Hub and the ScienceLab now also satisfy station
contracts (only applies to new contract)
- Improved plugin performance (removed all 'foreach'loops)
- Increased steering performance of the wheels
Mod Support:
- Rebalanced the support for USI-LS (thanks to ibanix, DStaal and
tsaven)
Bug Fixes:
- The IVA of the cupola now works correctly when RPM is installed
- The container for the Surface Experiment Pack now works as a central
station
- The Science-Lab in the Central Station now works properly
- The Craft now does not accidentally disassemble when the flexible KAS
tube is linked
  • Loading branch information
Nils277 committed Jul 8, 2016
1 parent 2e3623f commit 91c84c7
Show file tree
Hide file tree
Showing 15 changed files with 168 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ PART
MODULE
{
name = ModuleScienceLab
containerModuleIndex = 1
containerModuleIndex = 2
dataStorage = 300
crewsRequired = 2
canResetConnectedModules = True
canResetNearbyModules = False
interactionRange = 5
SurfaceBonus = 0.05
ContextBonus = 0.175
homeworldMultiplier = 0.08
SurfaceBonus = 0.035
ContextBonus = 0.09
homeworldMultiplier = 0.06
RESOURCE_PROCESS
{
name = ElectricCharge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ PART
steeringResponse = 2
steeringCurve
{
key = 0 7.0
key = 10 4.0
key = 0 12.0
key = 10 7.0
}
}
MODULE
Expand Down
Binary file not shown.
Binary file modified GameData/PlanetaryBaseInc/BaseSystem/Plugins/_src.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,21 @@
{
Part = KKAOSS_Science_g
}
@CREW_REQUEST[#Part[Large_Crewed_Lab]]
{
Part = KKAOSS_Science_g
}
}
@Station
{
@PART_REQUEST:HAS[#Part[Large_Crewed_Lab]]
{
Part = KKAOSS_Science_g
}
@CREW_REQUEST[#Part[Large_Crewed_Lab]]
{
Part = KKAOSS_Science_g
}
}
}

Expand All @@ -132,6 +147,21 @@
{
Part = KKAOSS_Central_Hub
}
@CREW_REQUEST[#Part[Large_Crewed_Lab]]
{
Part = KKAOSS_Central_Hub
}
}
@Station
{
@PART_REQUEST:HAS[#Part[Large_Crewed_Lab]]
{
Part = KKAOSS_Central_Hub
}
@CREW_REQUEST[#Part[Large_Crewed_Lab]]
{
Part = KKAOSS_Central_Hub
}
}
}

Expand All @@ -144,6 +174,21 @@
{
Part = KKAOSS_Cupola_g
}
@CREW_REQUEST[#Part[cupola]]
{
Part = KKAOSS_Cupola_g
}
}
@Station
{
@PART_REQUEST:HAS[#Part[cupola]]
{
Part = KKAOSS_Cupola_g
}
@CREW_REQUEST[#Part[cupola]]
{
Part = KKAOSS_Cupola_g
}
}
}

Expand All @@ -158,7 +203,7 @@
}
@CREW_REQUEST[#Part[ISRU]]
{
Part = KKAOSS_ISRU_g
Part = KKAOSS_ISRU_g
}
}
@Station
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,4 @@
{
name = RasterPropMonitorComputer
}

@INTERNAL {
@name = KKAOSS_Cupola_g_internal_RPM
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ PART:NEEDS[KAS]
nodeTransform = tube_node
type = TubeSize1
maxLenght = 20
maxAngle = 90
breakForce = 10
maxAngle = 100
breakForce = 600
allowDock = true
allowPumpFuel = true
hasCollider = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ PART:NEEDS[SurfaceExperimentPackage]
actionGUIName = Toggle Antenna
allowAnimationWhileShielded = False
}
MODULE
{
name = ModuleSEPCentralStation
}
MODULE
{
name = ModuleDataTransmitter
Expand All @@ -85,10 +89,9 @@ PART:NEEDS[SurfaceExperimentPackage]
name = ModuleScienceExperiment

experimentID = SEP_StationTest

experimentActionName = Run Central Station Tests
resetActionName = Delete Data

useStaging = False
useActionGroups = True
hideUIwhenUnavailable = False
Expand Down
4 changes: 2 additions & 2 deletions GameData/PlanetaryBaseInc/PlanetaryBaseInc.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"VERSION": {
"MAJOR": 1,
"MINOR": 1,
"PATCH": 0
"PATCH": 2
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 1,
"PATCH": 2
"PATCH": 3
},
"KSP_VERSION_MIN":
{
Expand Down
33 changes: 16 additions & 17 deletions Sources/PlanetarySurfaceStructures/ModuleKPBSConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,34 @@ protected override ConversionRecipe PrepareRecipe(double deltatime)
newRecipe.TakeAmount = 1;// (float)rate;

//add the inputs to the recipe
foreach (ResourceRatio res in inputList)
for (int i = 0; i < inputList.Count; i++)
{
ResourceRatio newRes = new ResourceRatio();
newRes.ResourceName = res.ResourceName;
newRes.FlowMode = res.FlowMode;
newRes.Ratio = res.Ratio * rate;
newRes.DumpExcess = res.DumpExcess;
newRes.ResourceName = inputList[i].ResourceName;
newRes.FlowMode = inputList[i].FlowMode;
newRes.Ratio = inputList[i].Ratio * rate;
newRes.DumpExcess = inputList[i].DumpExcess;
newRecipe.Inputs.Add(newRes);
}
//add the outputs to the recipe
foreach (ResourceRatio res in outputList)
for (int i = 0; i < outputList.Count; i++)
{
ResourceRatio newRes = new ResourceRatio();
newRes.ResourceName = res.ResourceName;
newRes.FlowMode = res.FlowMode;
newRes.DumpExcess = res.DumpExcess;
newRes.Ratio = res.Ratio * rate;
newRes.ResourceName = outputList[i].ResourceName;
newRes.FlowMode = outputList[i].FlowMode;
newRes.Ratio = outputList[i].Ratio * rate;
newRes.DumpExcess = outputList[i].DumpExcess;
newRecipe.Outputs.Add(newRes);
}

//only add the fertilizer as a requirement when it is used
foreach (ResourceRatio res in reqList)
for (int i = 0; i < reqList.Count; i++)
{
ResourceRatio newRes = new ResourceRatio();
newRes.ResourceName = res.ResourceName;
newRes.FlowMode = res.FlowMode;
newRes.DumpExcess = res.DumpExcess;
newRes.Ratio = res.Ratio * rate;
newRecipe.Outputs.Add(newRes);
newRes.ResourceName = reqList[i].ResourceName;
newRes.FlowMode = reqList[i].FlowMode;
newRes.Ratio = reqList[i].Ratio * rate;
newRes.DumpExcess = outputList[i].DumpExcess;
newRecipe.Requirements.Add(newRes);
}
return newRecipe;
}
Expand Down
79 changes: 45 additions & 34 deletions Sources/PlanetarySurfaceStructures/ModuleKPBSCorridorNodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class ModuleKPBSCorridorNodes : PartModule
public override void OnStart(StartState state)
{
base.OnStart(state);
Debug.Log("[KPBS] Corridor OnStart");

if (HighLogic.LoadedSceneIsEditor)
{
Expand Down Expand Up @@ -106,12 +107,14 @@ public override void OnStart(StartState state)
}

int num = 0;
foreach (string nodeName in nodenames)
{
AttachNode node = part.findAttachNode(nodeName);

for (int i = 0; i < nodenames.Length; i++)
{
Debug.Log("[KPBS] DD 1");
AttachNode node = part.findAttachNode(nodenames[i]);
List<Transform> transforms = new List<Transform>();
for (int k = 0; k < transformnames[num].Length; k++) {
Debug.Log("[KPBS] DD 2");
transforms.AddRange(part.FindModelTransforms(transformnames[num][k]));
}

Expand All @@ -123,7 +126,7 @@ public override void OnStart(StartState state)
corridor.node = node;
corridor.transforms = transforms;

if ((allowSurfaceAttach) && (surfaceAttachNode == nodeName) && (part.srfAttachNode != null))
if ((allowSurfaceAttach) && (surfaceAttachNode == nodenames[i]) && (part.srfAttachNode != null))
{
corridor.isSurfaceAttachPoint = true;
}
Expand Down Expand Up @@ -151,10 +154,8 @@ public override void OnStart(StartState state)
replaceTransformGroupNames = replaceTransformNames.Split(',');
replaceNodeGroupNames = replaceNodeNames.Split(',');


if (replaceNodeGroupNames.Length == replaceTransformGroupNames.Length)
{

//split up all the name for the groups
for (int i = 0; i < replaceNodeGroupNames.Length; i++)
{
Expand All @@ -177,22 +178,23 @@ public override void OnStart(StartState state)

//for all transform groups
num = 0;
foreach (string[] tNames in replacetransformnames)
//foreach (string[] tNames in replacetransformnames)
for (int i = 0; i < replacetransformnames.Count; i++)
{


List<Transform> rTransforms = new List<Transform>();
List<AttachNode> rAttachnodes = new List<AttachNode>();

foreach (string tName in tNames)
//foreach (string tName in replacetransformnames[i])
for (int j = 0; j < replacetransformnames[i].Length; j++)
{
Debug.Log("[KPBS] Replace Tranform Name: " + tName);
rTransforms.AddRange(part.FindModelTransforms(tName));
Debug.Log("[KPBS] Replace Tranform Name: " + replacetransformnames[i][j]);
rTransforms.AddRange(part.FindModelTransforms(replacetransformnames[i][j]));
}
foreach (string nName in replacenodenames[num])
//foreach (string nName in replacenodenames[num])
for (int j = 0; j < replacenodenames[num].Length; j++)
{
Debug.Log("[KPBS] Replace Node Name: " + nName);
rAttachnodes.Add(part.findAttachNode(nName));
Debug.Log("[KPBS] Replace Node Name: " + replacenodenames[num][j]);
rAttachnodes.Add(part.findAttachNode(replacenodenames[num][j]));
}

if ((rTransforms.Count > 0) && (rAttachnodes.Count > 0))
Expand Down Expand Up @@ -250,48 +252,53 @@ private void updateAllCorridors()
bool attachmentChanged = false;

//check all the corridors for changes
foreach (CorridorPart p in corridors)
//foreach (CorridorPart p in corridors)
for (int i = 0; i < corridors.Count; i++)
{
//when the attachment situation has changed
bool attached = (p.node.attachedPart != null);
bool attached = (corridors[i].node.attachedPart != null);

noAttachment = noAttachment && !attached;

if (p.isSurfaceAttachPoint)
if (corridors[i].isSurfaceAttachPoint)
{
attached |= (part.srfAttachNode.attachedPart != null);
noAttachment = noAttachment && (part.srfAttachNode.attachedPart == null);
}

if (attached != p.lastAttached)
if (attached != corridors[i].lastAttached)
{
attachmentChanged = true;

foreach (Transform t in p.transforms)
//foreach (Transform t in p.transforms)
for (int j = 0; j < corridors[i].transforms.Count; j++)
{
t.gameObject.SetActive(attached);
corridors[i].transforms[j].gameObject.SetActive(attached);
}
p.lastAttached = attached;
corridors[i].lastAttached = attached;
}
}

if (attachmentChanged)
{

foreach (ReplacedPart rp in replaceParts)
//foreach (ReplacedPart rp in replaceParts)
for (int i = 0; i < replaceParts.Count; i++)
{
bool attached = false;

//check all nodes for attachments
foreach (AttachNode an in rp.nodes)
//foreach (AttachNode an in replaceParts[i].nodes)
for (int j = 0; j < replaceParts[i].nodes.Count; j++)
{
attached = attached | (an.attachedPart != null);
attached = attached | (replaceParts[i].nodes[j].attachedPart != null);
}

//apply state to all transforms
foreach (Transform tf in rp.transforms)
//foreach (Transform tf in rp.transforms)
for (int j = 0; j < replaceParts[i].transforms.Count; j++)
{
tf.gameObject.SetActive(!attached);
replaceParts[i].transforms[j].gameObject.SetActive(!attached);
}
}
}
Expand All @@ -300,21 +307,25 @@ private void updateAllCorridors()
if ((showAllWithNoAttachment) && (noAttachment))
{
//show all the attach parts
foreach (CorridorPart p in corridors)
//foreach (CorridorPart p in corridors)
for (int i = 0; i < corridors.Count; i++)
{
foreach (Transform t in p.transforms)
//foreach (Transform t in p.transforms)
for (int j = 0; j < corridors[i].transforms.Count; j++)
{
t.gameObject.SetActive(true);
corridors[i].transforms[j].gameObject.SetActive(true);
}
p.lastAttached = true;
corridors[i].lastAttached = true;
}

//hide all the replace parts
foreach (ReplacedPart p in replaceParts)
//foreach (ReplacedPart p in replaceParts)
for (int i = 0; i < replaceParts.Count; i++)
{
foreach (Transform t in p.transforms)
//foreach (Transform t in p.transforms)
for (int j = 0; j < replaceParts[i].transforms.Count; j++)
{
t.gameObject.SetActive(false);
replaceParts[i].transforms[j].gameObject.SetActive(false);
}
}
}
Expand Down
Loading

0 comments on commit 91c84c7

Please sign in to comment.