Skip to content

Commit

Permalink
Merge pull request #82 from post-kerbin-mining-corporation/dev
Browse files Browse the repository at this point in the history
Release 0.5.2
  • Loading branch information
ChrisAdderley committed Aug 11, 2021
2 parents ed02152 + fd20c1e commit d089c79
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .mod_data.yml
Expand Up @@ -8,7 +8,7 @@ package:
- changelog.txt
dependencies: # Configure dependencies
ModuleManager:
version: 4.1.4
version: 4.2.1
location: s3
CommunityResourcePack:
version: 1.4.2
Expand Down
Expand Up @@ -15,7 +15,7 @@
!MODULE[ModuleActiveRadiator] {}
!MODULE[RadioactiveStorageContainer] {}

@MODULE[ModuleEngines*]
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
Expand Down
Expand Up @@ -8,7 +8,7 @@
!MODULE[ModuleActiveRadiator] {}
!MODULE[RadioactiveStorageContainer] {}

@MODULE[ModuleEngines*]
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
Expand Down
Expand Up @@ -15,7 +15,8 @@
!MODULE[ModuleActiveRadiator] {}
!MODULE[RadioactiveStorageContainer] {}

@MODULE[ModuleEnginesFX] {
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
RESOURCE
Expand Down
Expand Up @@ -15,7 +15,7 @@
!MODULE[ModuleActiveRadiator] {}
!MODULE[RadioactiveStorageContainer] {}

@MODULE[ModuleEngines*]
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
Expand Down
Expand Up @@ -4,10 +4,11 @@
!MODULE[ModuleSystemHeatEngine] {}
!MODULE[ModuleAlternator] {}
!MODULE[RadioactiveStorageContainer] {}
@MODULE[ModuleEngines*]

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
}

MODULE
{
Expand Down
2 changes: 1 addition & 1 deletion Extras/SystemHeatFissionEngines/Squad/nuclearEngine.cfg
Expand Up @@ -7,7 +7,7 @@
!MODULE[ModuleAlternator] {}
!MODULE[RadioactiveStorageContainer] {}

@MODULE[ModuleEngines*]
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
Expand Down
Expand Up @@ -8,7 +8,10 @@
moduleID = engine
iconName = Icon_Engine
}

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}

MODULE
{
Expand Down Expand Up @@ -44,7 +47,10 @@
moduleID = engine
iconName = Icon_Engine
}

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}

MODULE
{
Expand Down Expand Up @@ -80,7 +86,10 @@
moduleID = engine
iconName = Icon_Engine
}

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}

MODULE
{
Expand Down
Expand Up @@ -9,7 +9,10 @@
iconName = Icon_Engine
}


@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
MODULE
{
name = ModuleSystemHeatEngine
Expand Down Expand Up @@ -43,7 +46,10 @@
moduleID = engine
iconName = Icon_Engine
}

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}

MODULE
{
Expand Down Expand Up @@ -80,7 +86,10 @@
iconName = Icon_Engine
}


@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
MODULE
{
name = ModuleSystemHeatEngine
Expand Down
Expand Up @@ -9,7 +9,10 @@
iconName = Icon_Engine
}


@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}
MODULE
{
name = ModuleSystemHeatEngine
Expand Down Expand Up @@ -43,7 +46,10 @@
moduleID = engine
iconName = Icon_Engine
}

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}

MODULE
{
Expand Down Expand Up @@ -79,7 +85,10 @@
moduleID = engine
iconName = Icon_Engine
}

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}

MODULE
{
Expand Down
Expand Up @@ -8,7 +8,10 @@
moduleID = engine
iconName = Icon_Engine
}

@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}

MODULE
{
Expand Down Expand Up @@ -43,6 +46,10 @@
moduleID = engine
iconName = Icon_Engine
}
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}


MODULE
Expand Down Expand Up @@ -79,6 +86,10 @@
moduleID = engine
iconName = Icon_Engine
}
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}


MODULE
Expand Down
Expand Up @@ -8,6 +8,10 @@
moduleID = engine
iconName = Icon_Engine
}
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}


MODULE
Expand Down Expand Up @@ -67,6 +71,10 @@
moduleID = engine
iconName = Icon_Engine
}
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}


MODULE
Expand Down Expand Up @@ -127,6 +135,10 @@
moduleID = engine
iconName = Icon_Engine
}
@MODULE[ModuleEngines*],*
{
@heatProduction = 0
}


MODULE
Expand Down
Binary file modified GameData/SystemHeat/Plugin/SystemHeat.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions GameData/SystemHeat/Versioning/SystemHeat.version
Expand Up @@ -6,14 +6,14 @@
{
"MAJOR":0,
"MINOR":5,
"PATCH":1,
"PATCH":2,
"BUILD":0
},
"KSP_VERSION":
{
"MAJOR":1,
"MINOR":12,
"PATCH":1
"PATCH":2
},
"KSP_VERSION_MIN":{
"MAJOR":1,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -38,7 +38,7 @@ Your job, as the spacecraft engineer, is to construct Heat Loops such that they

### Required
These components are required for the mod to function and are bundled as part of any download:
* [ModuleManager (4.1.4)](https://github.com/sarbian/ModuleManager)
* [ModuleManager (4.2.1)](https://github.com/sarbian/ModuleManager)
* [Community Resource Pack (1.4.2)](https://github.com/BobPalmer/CommunityResourcePack)


Expand Down
27 changes: 24 additions & 3 deletions SystemHeat/SystemHeat/Modules/ModuleSystemHeat.cs
Expand Up @@ -270,7 +270,7 @@ public void AddFlux(string id, float sourceTemperature, float flux, bool useForN
{
fluxes[id] = flux;

// If the flux is > 0, heat is being added to the system and we should track the temperature
// Add if used for nominal
if (useForNominal)
{
temperatures[id] = sourceTemperature;
Expand All @@ -281,13 +281,25 @@ public void AddFlux(string id, float sourceTemperature, float flux, bool useForN
}

totalSystemFlux = fluxes.Sum(x => x.Value) * (float)(PhysicsGlobals.InternalHeatProductionFactor / 0.025d);

totalSystemTemperature = temperatures.Sum(x => x.Value);

float denom = (temperatures.Values.ToList().Where(x => x > 0f).Count());

if (denom > 0)
systemNominalTemperature = totalSystemTemperature / denom;
else
systemNominalTemperature = 0f;

totalSystemTemperature = systemNominalTemperature;
if (totalSystemTemperature == 0f)
{
ignoreTemperature = true;
}
else
{
ignoreTemperature = false;
}
}
}

Expand All @@ -314,8 +326,17 @@ public void UpdateSimulationValues(float nominalTemp, float currentTemp, float c
protected void FixedUpdate()
{
SystemFluxUI = String.Format("{0:F0} kW", totalSystemFlux);
SystemTemperatureUI = String.Format("{0:F0} / {1:F0} K", LoopTemperature, nominalLoopTemperature);

if (totalSystemFlux > 0f)
{
Fields["SystemTemperatureUI"].guiActive = true;
Fields["SystemTemperatureUI"].guiActiveEditor = true;
SystemTemperatureUI = String.Format("{0:F0} / {1:F0} K", totalSystemTemperature, nominalLoopTemperature);
}
else
{
Fields["SystemTemperatureUI"].guiActive = false;
Fields["SystemTemperatureUI"].guiActiveEditor = false;
}
if (simulator == null)
{
if (HighLogic.LoadedSceneIsFlight)
Expand Down
6 changes: 4 additions & 2 deletions SystemHeat/SystemHeat/Modules/ModuleSystemHeatExchanger.cs
Expand Up @@ -212,6 +212,7 @@ protected void GenerateHeatEditor()
{
if (Enabled)
{

Fields["PowerStatus"].guiActive = true;
Fields["PowerStatus"].guiActiveEditor = true;
float outputHeat = HeatRate;
Expand Down Expand Up @@ -252,8 +253,9 @@ protected void GenerateHeatEditor()
Fields["PowerStatus"].guiActive = false;
Fields["PowerStatus"].guiActiveEditor = false;
Status = Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatExchanger_Field_Status_Disabled");
destModule.AddFlux(moduleID, 0f, 0f, false);
sourceModule.AddFlux(moduleID, 0f, 0f, false);

destModule.ignoreTemperature = true;
sourceModule.ignoreTemperature = true;
}
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ public override string GetInfo()
if (inputs[i].ResourceName == FuelName)
baseRate = inputs[i].Ratio;
}
if (HeatGeneration.Evaluate(0f) == 0)
if (HeatGeneration.Evaluate(100f) == 0)
{
return
Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatFissionEngine_PartInfo_Basic",
Expand Down
9 changes: 9 additions & 0 deletions changelog.txt
@@ -1,3 +1,12 @@
v0.5.2
------
- Updated ModuleManager to 4.2.1
- Fixed NTR configs not removing stock heat generation from all engine mode
- Ion engine configs now also remove all excess heat generation
- Fixed System Temperature PAW field actually displaying loop temperature
- System Temperature PAW field is now hidden if system flux <= 0 kW as it is meaningless
- Fixed loop integrator to handle cases with producers that are off better

v0.5.1
------
- Hotfix reactor configs
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
@@ -1,5 +1,5 @@
================
SystemHeat 0.5.1
SystemHeat 0.5.2
================

A mod for Kerbal Space Program, intended to provide a better experience for heat management, particularly geared towards resource extraction, high energy engines, and nuclear reactors.
Expand All @@ -11,7 +11,7 @@ DEPENDENCIES

Required:
- Community Resource Pack (1.4.2)
- ModuleManager (4.1.4)
- ModuleManager (4.2.1)

============
INSTALLATION
Expand Down

0 comments on commit d089c79

Please sign in to comment.