In order to allow a part to be an inventory cargo part that can be placed in inventories or allowing larger parts to be manipulated in EVA construction mode (but not placeable in inventories) the Part cfg file must have a ModuleCargoPart defined to it.
The following important KSPFields are available for configuration of this module:
packedVolume - The space this part occupies when packed inside an inventory container. If this is set to < 0 then the part can be manipulated in EVA construction mode but cannot be placed inside inventory containers.
kinematicDelay - This is the time delay used to wait for the part to settle on the ground.
placementMaxRivotVelocity - This is the velocity the part must be travelling less than before it will be rivoted to the ground.
inventoryTooltip - The tooltip for inventory cargo parts,shows up when mouse is over a part icon during flight.
stackableQuantity - The number of parts of the same kind and variant that can be stacked in a single inventory slot. Defaults to 1, so leave it out if you DON’T want the part to be stackable.
The Inventory system is now persisted as a list of protoparts instead of a comma-separated string of names. The old system is still there for compatibility, but the new one is preferred.
Parts that can hold cargo parts are known as Inventory Parts and must have the ModuleInventoryPartPartModule defined to them (as it did before).
The inventory system now has volume and mass limits on ModuleInventoryPart (inventory container) parts.
The following important KSPFields are available for configuration of this module: InventorySlots - This is the number of inventory slots this part has.
packedVolumeLimit - The volume capacity this container has.
massLimit - The mass capacity this container has.
Inventory system now has default inventories the use of a DEFAULTPARTS node defined within a ModuleInventoryPart MODULE node in the part.cfg files.
ModuleInventoryPart.allowedKerbalEvaDistance obsolete in preference to GameSetting.EVA_INVENTORY_RANGE.
Kerbal Inventories now have two slots per kerbal and their inventories have a default inventory which is defined via the kerbal part.cfg files. This default will be taken each time they are added as crew to a ship in the VAB/SPH unless the persist kerbal inventories difficulty/game setting is turned on. In which case the default inventory is given to them the very first time they go on a mission but then persists between missions from the first mission onwards. Kerbal inventories in the editor scene and when they are IVA are managed via a new scenario module: KerbalInventoryScenario.
As part of the inventory system changes, part icons for inventory slots are no longer 3D parts with render textures. That was dropped in favor of part snapshots. For stock parts, these are already pre-baked in the GameData/Squad(Expansions)/<expansionName>/Parts/@thumbs folder. If your mod has cargo parts, the first time you add them to an inventory slot, the snapshots will be created automatically and persisted to GameData/<modName>/Parts/@thumbs. If you’re not using a Parts folder (consider doing it) they will be stored in the thumbs folder in the KSP root. If you’re doing adjustments to your parts to take advantage of the new inventory system, please also consider distributing the pre-baked thumbnails for them.
A number of variables and methods related to ModuleInventoryPart and the previous inventory system have been marked as obsolete refer to the API documentation for more information.
For further details on code classes and variables refer to the API documentation.
EVA Construction Mode
The main classes involved running EVA construction mode are (refer to the API documents for details of each class):
Parts taken out of an inventory are completely disabled (The Part and all its PartModule instance MonoBehaviors are disabled) and re enabled when it is attached to a vessel in Construction Mode or dropped on the ground/in space around the active kerbal.
The following methods can be overridden/implemented by PartModules that will be called during construction mode.
OnPartCreatedFromInventory - This is called whenever the part is being created from an inventory (the user has dragged the part out from an inventory slot).
OnInventoryModeDisable - This is called after the part is created from an inventory whilst just before the Part and all its PartModules are disabled.
OnInventoryModeEnable - This is called just before the part is enabled again when it is either attached or dropped in construction mode.
OnConstructionModeUpdate - This is called every Update cycle for each Part and PartModule on an inactive Part that is currently attached to the mouse.
OnConstructionModeFixedUpdate - This is called every FixedUpdate cycle for each Part and PartModule on an inactive Part that is currently attached to the mouse.
Contracts - Prebuilt craft, locations.
Contracts can now use pre-generated craft in a contract. These are defined in CONTRACTCRAFT config nodes as follows:
One PREBUILTCRAFT config node for each prebuilt craft (contained within a CONTRACTCRAFT node).
url = <url for the craft file>
AllowGround = True/False // Whether craft can spawn on the ground
AllowOrbit = True/False // Whether craft can spawn in orbit
AllowWater = True/False // Whether craft can spawn in the ocean
UsePreBuiltPos = True/False //Whether to use a random prebuild position, or completely random position.
ContractType = <a string that the contract can use to identify which craft are for which contract>
There is also a config node structure for defining and storing pre-determined Lat/Lon locations on planets that contracts can now use.
These are defined in CONTRACTCRAFT config nodes as follows:
One PREBUILTPOSITIONS config node for each position (contained within a CONTRACTCRAFT node).
Body = <CB body name>
CenterLatitude = x.xxx //The center latitude that a random position will be generated from
CenterLongitude = x.xxx //The center longitude that a random position will be generated from
SearchRadius = xxxx //A radius in meters from the Lat/Lon that the position will be generated. So it’s never exactly in the same spot.
LightOn/Off events have been replaced with a toggle event on the PAW to reduce PAW redraw. The events still exist and can be triggered, but are hidden from the PAW.
ModuleLight no longer uses animations to control color and brightness of the lights.Instead this is done by the part module itself.
Previously KSP had a hard-coded path to the techtree.cfg file in GameData Folder which was read at startup. Now KSP will look for and concatenate TechTree nodes from the game database which is preloaded on startup of all .cfg files and ConfigNodes.
QuaternionD class now supports LookRotation in double precision.
The FlightVesselOverlays class implements the Center of Mass/Lift/Thrust overlays to be displayed in EVA construction mode.
Parts now have a minimum Rigidbody mass minimumRBMass which affects how small the rigidbodies mass can be. Does not affect part.mass - which is what’s used to calculate force, etc - but does affect rigidbody collisions.
Kerbals are no longer massless, and the weight they carry in their inventories matters in terms of physics. In order to not impact the way existing vessels fly, an amount of mass equal to the size of the crew times the mass of a kerbal with a full jetpack and a parachute (94kg) is subtracted from the vessel mass and added back in function of the crew in the vessel. This is all already done automatically, but if you want to play around with different mass values for a kerbal, the value is kerbalCrewMass in Physics.cfg (defaults to 45 kg).