Moddability API Docs:
https://kerbalspaceprogram.com/api/index.html - Added FlightGlobals.VesselsLoaded and FlightGlobals.VesselsUnloaded which lets us iterate over a specific portion of Vessels without checking the entire list.
- Added onVesselPartCountChanged event, fires any time a part is added or removed, the moment it happens, unlike onVesselModified.
- Added onVesselStandardModification event, collects various vessel events and fires them off with a single one. (onVesselPartCountChanged, onVesselModified, docked, undocked, et al)
- Added onScreenResolutionModified event, fires when the screen resolution is modified.
- Added many accessors/setters.
- Vessel control level can be clamped to a field in Vessel (so can be restricted to Partial even if otherwise would be Full).
- GetModuleMass/Cost methods can now be passed the situation.
- Fix where kerbal mass (if set to nonzero) was not applied in the editor.
- Added two new dictionary-related classes (DictionaryValueList and ListDictionary).
- Celestial bodies now cache all of their PQS Cities.
- All game root nodes now generate a random persistent seed, which is different from game to game.
- All forces on valid parts except wheel forces are now done via Part.AddForce/Torque/AddForceAtPosition. Note that the forcemode used is Force; to use a different forcemode, convert the force to the correct amount. It is the job of the Flight Integrator to then apply all these forces to actual rigidbodies (rather than all the disparate modules' job).
- Use mass-weighted average angular velocity of parts for vessel angular velocity.
- ITorqueProvider now reports two Vector3s, positive torque (that produced by control actuation 1,1,1) and negative torque (that produced by -1,-1,-1).
- Added various accessors.
- Node definitions can take an extra digit after size, either 0 or 1: that sets whether the node can crossfeed. Defaults to 1 (yes). NODE definitions can take crossfeed = True/False
- ModuleEngines now supports
clampPropReceived = True
. This will clamp the ratio of propellant requested based on prior results, so if IntakeAir is listed first and less than the full requirement is returned, it will request only that ratio of further propellants. In this case the "Prop Req Met" display will show the minimum requirement-met ratio rather than the average. Engines that use IntakeAir (or other cases like that) need to have
clampPropReceived = True
in each of their MODULEs that do that, and need to have that PROPELLANT first and the other PROPELLANTs later. See stock jet cfgs for examples.
- Added another crew transfer event.
- Added more startup options for KSPAddon
- Allow kerbals to have/save/load arbitrary experience points.
- ResearchAndDevelopment.GetTechnologyTitle(string id) will convert a tech ID to a tech title and is available as soon as parts start loading (can be used in GetInfo() ).
- Support max pressure (dynamic + static),
maxPressure
, and max G,
gTolerance
, for parts.
- Added system to allow mods to add custom difficulty settings.
- Added CelestialBody.hasSurface so mods that add a PQSController to gas giant don't cause silly things such as "Plant a flag on Jool" contracts.
- Replaced all checks for experience traits (Pilot, Scientist, Engineer) with individual experience effects. They are now loaded before part loading so can be queried in GetInfo().
- Icons in TechTree.cfg can now use a relative path (allows mod icons to live outside the Squad directory).
- Added KSPAssemblyDependencyEqualMajor as an attribute. Use instead of KSPAssemblyDependency if you want to force requiring the stated major version, not >= the major version, from your dependency.
- If you are setting a vessel's position and/or changing its orbit, call Vessel.IgnoreGForces(framecount) on the vessel for the number of frames that g forces should be ignored (try 1, then 2 if that doesn't work, etc).
- ModuleDeployablePart (covers antennas, solars, radiators) also has a gResistance (for Gs) as well as windResistance (for Q).
- Crew transfer now derives from a generic abstract PartItemTransfer class. Classes can derive from it to implement any kind of (crew transfer-style) part-part transfer. Also we fire an event right before a crew transfer is created so mods can just kill it and easily create their own CrewTransfer-derived class and have that be called on that event.
- Extended ModuleScienceContainer to allow sending and, (from ModuleScienceExperiment) receiving, experiment data. Also added support for a Collect All option to such containers.
- ModuleColorChanger supports changing arbitrary shader colors and implements IScalarModule. ModuleAnimationSetter works similarly and is used to more directly link an animation to being set by IScalarModule.
- PartModules now support upgrades. In a MODULE node, add an UPGRADE node. Inside that add one node per techID you wish to provide upgrades, in ascending order. Inside that place keys and nodes you wish to upgrade. e.g.
UPGRADES { basicRocketry { maxThrust = 250 } }
will change maxThrust to 250 once basicRocketry unlocks. Upgrades will never override persistent data. Further, by default they overwrite each other; to make a node apply on a clean slate (so you can, say, add two PROPELLANT nodes and not have them conflict due to the overwrite logic) set
IsExclusiveUpgrade__ = True
in the upgrade's node. That will clear the upgrade state and apply that upgrade fresh. Upgrades are applied only when you add a part to a craft in the VAB/SPH, they don't magically apply in flight. When a part on a craft is upgraded, a new option will appear in the PAW (when in VAB/SPH) where you can view the current stats of all those modules with upgrades.
- ModuleEngines now supports alternate (RealFuels-style) throttling and rates.
- ModuleEngines now supports throttle-Isp interactions. Turn on with useThrottleIspCurve = True and set the throttleIspCurve and throttleIspCurveAtmStrength curves. Final Isp = input Isp - Lerp(1, throttleIspCurve.Eval(throttle state), throttleIspCurveAtmStrength.Eval(atms of pressure))
- Support part upgrades, see docs.
- Added events dealing with kerbals going on/off ladders on parts and added a new vessel field for accessing the vessel of the part of the ladder the kerbal is climbing (if all of those are valid).
- CelestialBody now has thermo/atmo stats methods so FlightIntegrator's temperature calcs can be called from anywhere / any mod.
- Events that throw an exception now print the full stack trace.
- PartModuleUtil.PrintResourceSI() is now just KSPUtil.PrintSI().
- Add ModuleDragAreaModifier with field areaFactor. Note: this will also affect buoyancy and thermo.
- Added ModuleHeatEffects and FXModuleThrottleEffects which can take any number of IScalarModules and are set by skin temp and throttle respectively.
- AvailablePart.entryCost is now get-only and calls a static delegate so they can be
- FindEngineNearby and FindEngineInterface are now PartModuleList methods instead of being duplicates in FXModuleAnimateThrottle and ModuleAlternator.
- Many KerbalEVA, Kerbal, and KerbalExpressionSystem methods made virtual, and kerbal spawning in ProtoCrewMember and EVA spawning in FlightEVA made delegates.
- Added IContractObjectiveModule, which allows mods to specify valid parts for contract objectives, rather than it being configuration based.
- Waypoint captions on the map are now moddable.
- Added game events for CommNet status changes both for the connection in general and the connection to KSC.
- Added game event that fires when PQS starts, just before the sphere is started.
- Added game event that fires when PQSCities start.
- Added game event for orbital resource survey completion.
- Added game event for vessel control state changing.
- Orbit now has a constructor that clones another orbit.
- Vessel now has a method to kill all parts in permanent ground contact (eg: launch clamps).
- Added ModuleGenerator.isGroundFixture for launch clamps.
- The "escape" progress milestone now uses standard World First award methods, which allows it to be disabled by mods properly.
- Icon_Hidden tag now hides all children of the transform so tagged.
- Add requiresFullControl to events, actions, and UI controls. If false, will work normally in full and partial control and refuse to work only with no control. If true, will work only with full control.
- AssemblyLoader ignores abstract classes.
- Support symbols in the font.
- Made Kerbals and EVA kerbals more moddable. EVAs and the flag now have partial part cfgs which can be modded. All Kerbal and KerbalEVA methods are virtual and the FSM is opened up. New hooks added.
- Made vessel load/unload/pack/unpack ranges changeable in Physics.cfg.
- Support adding options to the game difficulty screen.
- Vessel now has radarAltitude. Use it for min(altitude, heightFromTerrain)
- add PartModule.OnIconCreate which runs just before the partmodule is stripped from the icon gameobject when the editor part icon is being created.
- Particle systems can be registered with FloatingOrigin for handling origin/krakensbane offsetting natively.
- ProtoPartResourceSnapshot no longer relies on strings, and its resourceValues node is now inaccessible. Instead, directly get / set the amount/maxAmount/flowState.
- PartModules now come with a resHandler object (of type ModuleResourceHandler) for handling ModuleResource / RESOURCE nodes, so code need not be duplicated.