Skip to content

Commit

Permalink
Fix problem with station contracts in systems which don't have Gilly
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxgurugamer committed May 15, 2018
1 parent 4f6a45f commit 7f16350
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 16 deletions.
7 changes: 6 additions & 1 deletion BaseMissions/BasePopulation.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ CONTRACT_TYPE
type = Vessel
requiredValue = true
uniquenessCheck = CONTRACT_ACTIVE
targetVessel1 = AllVessels().Where(v => (v.VesselType() == Base && v.IsLanded()) || (v.VesselType() == Station) && v.CrewCount()<1 && v.EmptyCrewSpace()>0).SelectUnique()

// following fix from this post: https://forum.kerbalspaceprogram.com/index.php?/topic/162133-13-contract-pack-bases-and-stations-continued-6700-240617/&do=findComment&comment=3167131
//targetVessel1 = AllVessels().Where(v => (v.VesselType() == Base && v.IsLanded()) || (v.VesselType() == Station) && v.CrewCount()<1 && v.EmptyCrewSpace()>0).SelectUnique()
targetVessel1 = AllVessels().Where(v => ((v.VesselType() == Base && v.IsLanded()) || (v.VesselType() == Station)) && v.CrewCount()<1 && v.EmptyCrewSpace()>0).SelectUnique()


title = Must have an uncrewed base or station with seats to fill
}
DATA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ CONTRACT_TYPE
type = Vessel
requiredValue = true
uniquenessCheck = CONTRACT_ACTIVE
targetVessel1 = AllVessels().Where(v => (v.VesselType() == Base && v.IsLanded()) || (v.VesselType() == Station) && v.CrewCount()<1 && v.EmptyCrewSpace()>0).SelectUnique()

// following fix from this post: https://forum.kerbalspaceprogram.com/index.php?/topic/162133-13-contract-pack-bases-and-stations-continued-6700-240617/&do=findComment&comment=3167131
//targetVessel1 = AllVessels().Where(v => (v.VesselType() == Base && v.IsLanded()) || (v.VesselType() == Station) && v.CrewCount()<1 && v.EmptyCrewSpace()>0).SelectUnique()
targetVessel1 = AllVessels().Where(v => ((v.VesselType() == Base && v.IsLanded()) || (v.VesselType() == Station)) && v.CrewCount()<1 && v.EmptyCrewSpace()>0).SelectUnique()


title = Must have an uncrewed base or station with seats to fill
}
DATA
Expand Down Expand Up @@ -64,7 +69,7 @@ CONTRACT_TYPE
type = HasCrew
disableOnStateChange = true
minCrew = 1
maxCrew = @/CrewSpace
maxCrew = Max(1,@/CrewSpace)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,73 @@ CONTRACT_TYPE:NEEDS[TACLifeSupport|USILifeSupport]
PARAMETER:NEEDS[USILifeSupport]
{
name = Self-Sufficiency
type = PartValidation
type = Any

title = Have at least one life support recycler, cultivator, or agroponics unit

FILTER
PARAMETER
{
MODULE
name = usi-converter
type = PartValidation

FILTER
{
name = ModuleResourceConverter

INPUT_RESOURCE
MODULE
{
ResourceName = Mulch
name = ModuleResourceConverter_USI

// don't restrict inputs to allow different types of recycler/greenhouse modules
OUTPUT_RESOURCE
{
ResourceName = Supplies
}
}
OUTPUT_RESOURCE
}
}
PARAMETER
{
// legacy is still used by some mods with outdated USI-LS compatibility patches
name = legacy-converter
type = PartValidation
FILTER
{
MODULE
{
ResourceName = Supplies
}
}
name = ModuleResourceConverter
INPUT_RESOURCE
{
ResourceName = Mulch
}
OUTPUT_RESOURCE
{
ResourceName = Supplies
}
}
}
}
PARAMETER
{
name = kpbs-converter
type = PartValidation
FILTER
{
MODULE
{
name = ModuleKPBSConverter
// don't restrict inputs to allow different types of recycler/greenhouse modules
OUTPUT_RESOURCE
{
ResourceName = Supplies
}
}
}
}
}
PARAMETER
{
Expand Down Expand Up @@ -122,4 +171,4 @@ REQUIREMENT:NEEDS[TACLifeSupport]
title = Base must not be on the homeworld
}
}


12 changes: 11 additions & 1 deletion StationMissions/StationCore.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
@CONTRACT_TYPE[StationCore]:NEEDS[Kopernicus]
{
@PARAMETER[NewStation]
{
@PARAMETER[LKO]
{
%maxAltitude = @/targetBody1.IsSun() ? 113549713200 : @/targetBody1.SpaceAltitudeThreshold()
}
}
}
CONTRACT_TYPE
{
name = StationCore
Expand Down Expand Up @@ -59,7 +69,7 @@ CONTRACT_TYPE

targetBody = @/targetBody1
situation = ORBITING
maxAltitude = @/targetBody1.IsSun() ? 113549713200 : @/targetBody1 == Gilly ? 16000 : @/targetBody1.SpaceAltitudeThreshold()
maxAltitude = @/targetBody1.IsSun() ? 113549713200 : @/targetBody1 == Gilly ? 16000 : @/targetBody1.SpaceAltitudeThreshold()
}

//Check for a Docking Port
Expand Down

0 comments on commit 7f16350

Please sign in to comment.