Jump to content

[1.11.x] KSP Rescue Contract Fix v1.1.0 (2021-01-22)


AgmMaverick
 Share

Recommended Posts

Description

KSPRescueContractFix fixes the following issues with KSP's stock rescue contract when using mods:

  • Kerbals spawning in crewed parts without EVA hatches
  • Rescue Contract orbits are sometimes spawned inside the atmosphere when using a rescaled planet pack

Kerbals spawning in crewed parts without EVA hatches

Anytime a Kerbal rescue contract is offered, the part will be checked against an allowed parts list and replaced with a random allowed part if it's not on the list.  For contracts where you have to recover both the Kerbal and the part, the mod will attempt to choose an allowed part that is close in mass.  Contracts where you have to recover just a part are not effected by the allowed parts list.  Also, as this only works when the contract is first offered, it will not fix any existing offered or accepted contracts.

The list of allowed parts is configured through the config file RescueContract.cfg and additional parts can be added through a Module Manager patch or manually editing the file.   Out of the box, parts from Stock, Making History, and the following mods are supported:

  • Airplane Plus
  • Bluedog Design Bureau
  • HabTech 2
  • Mark IV Spaceplane System
  • Nearfuture Spacecraft
  • reDIRECT
  • SOCK
  • Station Parts Expansion Redux
  • Tantares
  • Tundra Exploration

Rescue Contract orbits are sometimes spawned inside the atmosphere when using a rescaled planet pack

Anytime an orbital rescue contract is accepted, the spawned vessel's orbit is checked to see if the periapsis falls inside the planet's atmosphere and if it does, raises the periapsis above the atmosphere.  The apoapsis is also  raised in order maintain the original orbit's eccentricity.  More specifically, only the semi-major axis of the orbit is changed; all other orbital parameters are left alone (eccentricity, inclination, argument of the periapsis, longitude of the ascending node, and mean anomaly at epoch).   As this fix happens on contract acceptance, it will not work on any already accepted contracts.

Configuration

For additional details on the configuration file format, see the README on Github.

Downloads

Dependencies

Acknowledgements

The rescue contract part replacement is based off of @Shadowmage KSP Rescue Pod Validator

License

KSPRescueContractFix is licensed under the GPLv3.

Edited by AgmMaverick
Link to comment
Share on other sites

I know that the people who use JNSQ may be very interested to hear about the latter feature...

On 2/20/2020 at 9:00 AM, JadeOfMaar said:

Never accept rescue contracts in scaled games. KSP does not adjust the altitude range when the bodies are changed and resized. If you know of a mod that fixes this, do let us know, and start using that mod.

Link to comment
Share on other sites

The original mod from @Shadowmage has a great spirit to control how Kerbals are spawned when they are distressed, I also enjoy seeing this is kept alive by this follow up. Regardless of that is is essential to rescue Kerbals from space I'm trying to focus on other things in my career game so I've limited the allowed pods to easy MK1-sized via this script:

Spoiler
// insert only specific parts for stock
// KSPRescuePodFix
@RESCUE_POD_TYPES:NEEDS[KSPRescuePodFix]:FINAL
{
	// remove all parts
	-part = dummy

	part = mk1pod
	part = Mk1Pod_v2
	part = cupola
}

// KSPRescueContractFix
@RESCUE_CONTRACT_FIX_CONFIG:NEEDS[KSPRescueContractFix]:FINAL
{
	@ALLOWED_PARTS
	{
		// remove all parts
		-part = dummy

		part = mk1pod
		part = Mk1Pod_v2
		part = cupola
	}
}

// insert only specific parts for SquadExpansion
// KSPRescuePodFix
@RESCUE_POD_TYPES:NEEDS[SquadExpansion&KSPRescuePodFix]:FINAL
{
	part = MEMLander
}

// insert only specific parts for SquadExpansion
@RESCUE_POD_TYPES:NEEDS[SquadExpansion&KSPRescueContractFix]:FINAL
{
	@ALLOWED_PARTS
	{
		part = MEMLander
	}
}

 

On a side-note diversity in pods that can be rescued can be fun too! (it's yet a hassle IMHO)

Edited by LatiMacciato
Link to comment
Share on other sites

Just released a new version:

KSP Rescue Contract Fix 1.1.0

  • Fixed the Mk4 BFS-4200 Cargo Pod being whitelisted instead of the Mk4 BFS-4200 Command Pod from Tundra Exploration.
  • Added in-game difficulty settings to allow turning on/off the following:
    • Part restrictions for Kerbal only rescues
    • Part restrictions for Kerbal and Pod recoveries
    • Orbit Fix
    • Individual parts on the allow list
Link to comment
Share on other sites

  • 2 weeks later...
On 1/17/2021 at 8:11 PM, AgmMaverick said:

Anytime an orbital rescue contract is accepted, the spawned vessel's orbit is checked to see if the periapsis falls inside the planet's atmosphere and if it does, raises the periapsis above the atmosphere.  The apoapsis is also  raised in order maintain the original orbit's eccentricity.  More specifically, only the semi-major axis of the orbit is changed; all other orbital parameters are left alone (eccentricity, inclination, argument of the periapsis, longitude of the ascending node, and mean anomaly at epoch).   As this fix happens on contract acceptance, it will not work on any already accepted contracts.

Does this also check to to see if a rescuee in low orbit around an airless body is at risk of crashing into the surface? In JNSQ I've lost a couple of orbital Mun rescues this way, and many of my Minmus rescues. They spawn in an extremely low, unsafe orbit (Pe < 5000) and collide with a mountain before I can rendezvous with them.

Link to comment
Share on other sites

1 hour ago, PocketBrotector said:

Does this also check to to see if a rescuee in low orbit around an airless body is at risk of crashing into the surface? In JNSQ I've lost a couple of orbital Mun rescues this way, and many of my Minmus rescues. They spawn in an extremely low, unsafe orbit (Pe < 5000) and collide with a mountain before I can rendezvous with them.

It does! By default, it will make sure the periapsis is at least 10000 m on atmosphere-less bodies.  If that is still too low for some bodies, you can override that on a per body basis in the config using a module manager patch like the following:

@RESCUE_CONTRACT_FIX_CONFIG
{
	BODY
	{
		name = Mun
		minPeriapsis = 15000
	}
}

 

Link to comment
Share on other sites

8 hours ago, matts73 said:

Somehow the Kerbals to rescue seems to be not equiped with jetbackpack

 

I haven't been to able to reproduce this in my own testing even with a command pod that doesn't have any cargo slots defined.  What other mods do you have installed?

Link to comment
Share on other sites

6 Crew Science Lab (SixCrewScienceLab 1.2)
6 Seat Mk3 Cockpit (SixSeatMk3cockpit 1.2)
Animated Decouplers (AnimatedDecouplers v1.4.2.2)
Astrogator (Astrogator v0.10.2)
AtmosphereAutopilot (Fly-By-Wire) (AtmosphereAutopilot v1.5.16)
Automatic Fuel Cells (AutomaticFuelCells 1.0.1.0)
B9 Part Switch (B9PartSwitch v2.17.0)
Background Resources (BackgroundResources 1:V0.17.0.0)
Better Early Tree (BetterEarlyTree 1.0.1)
Better Load Save Game Renewed (BetterLoadSaveGame 2.5.2.1)
BonVoyage (BonVoyage 1:1.3.0)
BreakingGround-DLC (BreakingGround-DLC (unmanaged))
ClickThrough Blocker (ClickThroughBlocker 1:0.1.10.15)
Community Category Kit (CommunityCategoryKit v5.2.0.0)
Community Parts Titles (CommunityPartsTitles 0.6.9)
Community Parts Titles Extras: Categories (CommunityPartsTitlesExtrasCategory 0.6.9)
Community Parts Titles Extras: CCK - No Duplicates (CommunityPartsTitlesExtrasNoCCKDup 0.6.9)
Community Resource Pack (CommunityResourcePack 1.4.2)
Community Tech Tree (CommunityTechTree 1:3.4.3)
Contract Configurator (ContractConfigurator 1.30.5)
Contract Pack: Bases and Stations Reborn (ContractConfigurator-KerbinSpaceStation 2:3.7.2.3)
Contract Pack: Clever Sats (ContractConfigurator-CleverSats 1.4)
Crew R&R (CrewQueueTwo 1.1.11)
Custom Barn Kit (CustomBarnKit 1.1.21.0)
Dock Rotate (DockRotate v1.11.0.53)
Docking Cam (DockingCamKURS 1.3.8)
Docking Port Alignment Indicator (DockingPortAlignmentIndicator 6.9.2.2)
Dynamic Battery Storage (DynamicBatteryStorage 2:2.2.1.0)
Editor Extensions Redux (EditorExtensionsRedux 3.4.2)
Environmental Visual Enhancements - Stock Planet Config files (EnvironmentalVisualEnhancements-HR 2:EVE-1.2.2-1)
Environmental Visual Enhancements Redux (EnvironmentalVisualEnhancements 3:1.11.2.1)
EVA Handrails Continued (EVAHandrailsPackContinued 0.3.0.3)
Field Training Facility (FieldTrainingFacility 1.2.0.0)
Hide Empty Tech Tree Nodes (HideEmptyTechNodes 1.3.0)
IndicatorLights (IndicatorLights 1.7)
IndicatorLights Community Extensions (IndicatorLightsCommunityExtensions 1.6.2)
Kerbal Alarm Clock (KerbalAlarmClock v3.13.0.0)
Kerbal Joint Reinforcement - Next (KerbalJointReinforcementNext v4.1.15)
Kerbal Krash System (KerbalKrashSystem 2:0.5.1)
Kerbal Launch Failure (KerbalLaunchFailure 0.4.11)
KSP Rescue Contract Fix (KSPRescueContractFix 1.1.0)
Making History (MakingHistory-DLC 1.11.0)
MechJeb 2 (MechJeb2 2.12.0.0)
Missing Robotics (MissingRobotics 1)
Module Manager (ModuleManager 4.1.4)
Near Future Construction (NearFutureConstruction 1.3.1)
Near Future Electrical (NearFutureElectrical 1.2.1)
Near Future Electrical - Decaying RTGs (NearFutureElectrical-DecayingRTGs 1.2.1)
Near Future Electrical Core (NearFutureElectrical-Core 1.2.1)
Near Future IVA Props (NearFutureProps 1:0.6.4)
Near Future Solar (NearFutureSolar 1.3.1)
Near Future Solar Core (NearFutureSolar-Core 1.3.1)
Near Future Spacecraft (NearFutureSpacecraft 1.4.1)
Project Manager (ProjectManager v2.4)
ReStock (ReStock 1.3.1)
ReStock+ (ReStockPlus 1.3.1)
Rocket Sound Enhancement (RocketSoundEnhancement 0.5.4)
Rocket Sound Enhancment - Default Configs (RocketSoundEnhancement-Config-Default 0.5.3)
scatterer (Scatterer 3:v0.0723)
Scatterer Default Config (Scatterer-config 3:v0.0723)
Scatterer Sunflare (Scatterer-sunflare 3:v0.0723)
Science - Full Reward! (Continued) (Science-Full-Reward v5.2)
Science - Full Transmit! (Science-Full-Transmit v1.1)
ScienceAlert ReAlerted (ScienceAlert 1.9.8.9)
SpaceTux Library (SpaceTuxLibrary 0.0.5)
Stockalike Station Parts Expansion Redux (StationPartsExpansionRedux 1.4.0)
Strategia (Strategia 1.8.0)
TAC Life Support (TACLS) (TACLS 1:V0.17.0.0)
Toolbar (Toolbar 1:1.8.0.5)
Toolbar Controller (ToolbarController 1:0.1.9.4)
TweakScale - Rescale Everything! (TweakScale v2.4.4.5)
TweakScale Companion for ReStockPlus (TweakScaleCompanion-ReStockPlus v1.1.0.0)
Zero MiniAVC (ZeroMiniAVC 1:1.1.0.1

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...