Jump to content

Search the Community

Showing results for tags 'official'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements
    • Welcome Aboard
  • Kerbal Space Program 2
    • KSP2 Dev Updates
    • KSP2 Discussion
    • KSP2 Suggestions and Development Discussion
    • Challenges & Mission Ideas
    • The KSP2 Spacecraft Exchange
    • Mission Reports
    • KSP2 Prelaunch Archive
  • Kerbal Space Program 2 Gameplay & Technical Support
    • KSP2 Gameplay Questions and Tutorials
    • KSP2 Technical Support (PC, unmodded installs)
    • KSP2 Technical Support (PC, modded installs)
  • Kerbal Space Program 2 Mods
    • KSP2 Mod Discussions
    • KSP2 Mod Releases
    • KSP2 Mod Development
  • Kerbal Space Program 1
    • KSP1 The Daily Kerbal
    • KSP1 Discussion
    • KSP1 Suggestions & Development Discussion
    • KSP1 Challenges & Mission ideas
    • KSP1 The Spacecraft Exchange
    • KSP1 Mission Reports
    • KSP1 Gameplay and Technical Support
    • KSP1 Mods
    • KSP1 Expansions
  • Community
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
    • KSP Fan Works
  • International
    • International
  • KerbalEDU
    • KerbalEDU
    • KerbalEDU Website

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL



About me



Found 16 results

  1. Welcome to the Official Kopernicus Discord. First and foremost, Discord is a means of communicating rapidly through instant messages, voice and images. This is definitely suitable for helping others and showing off your own work. We have decided to make this discord because we feel as if a central hub for planet modders is necessary when it comes to helping others - focusing aid is a good idea when creating mods. Features: Communicate with other modders and share ideas Help others to become better at creating planets and visuals for them Suggest ideas or report issues directly to modders quickly and easisly Use of bots with quick-help features Join Here: Server Staff @Thomas P. - Server owner and manager. Author of Kopernicus @GregroxMun - Author of many mods. Server administrator @Sigma88 - Server manager @Gameslinx - Server administrator
  2. Modders Notes the Dev team have thrown together for 1.12.0. We upgraded the project to Unity 2019.4.18f1 LTS to position KSP on a long term support version of Unity. This should not have any major impact on mods. API documentation can be found here. Wheels and Landing Legs changes ModuleWheelBase.useNewFrictionModel by default is false. Which means all wheels and landing legs using this module will use the old behaviour/logic by default. Set it to true in the part.cfg file to use the new friction model. ModuleWheelSuspension.useDistributedMass by default is false. Which means all wheels and landing legs using this module will use the old behaviour/logic by default for suspension processing. Set it to true in the part.cfg file to use the new friction model. ModuleWheelSteering.autoSteeringAdjust by default is false. Which means all wheels and landing legs using this module will use the old behaviour/logic by default for steering processing. Set it to true in the part.cfg file to use the new friction model. Refer to the Wheels Devblog for more information about the functional changes that were made to wheels and landing legs. Maneuver Tool The maneuver tool app has been designed in such a way to allow modders to easily add additional maneuver types to the app. To do this you will need to create your own mod c# class that inherits class TransferTypeBase - Base class for the transfer types. The Manuever Tool app on startup finds all classes based on this base class and adds them into it’s maneuver type list. Refer to the API documentation for the abstract methods your class has to implement. Additionally you must implement your own data class for your transfer type. Use this class as the base and assign to currentSelectedTransfer: TransferDataBase - Base class for the TransferData for each transfer type. This class inherits AppUI_Data class that allows you to define UI fields for your transfer that will appear in the center part of the manuever tool UI. See the section below called “Generic UI framework” on how to define your UI fields. You will also want to assign your dataChangedCAllback and calculationStateChangedCallback. Additionally you can use the following base class to define your own data class for the top slide out section of the maneuver tool app: TransferDataTopDataBase - Base class for the TransferDataTop for each transfer type. This class also inherits from AppUI_Data class. Another important class is ManeuverToolUIFrame. This manages the UI for the Manuever Tool App and has a number of useful methods. Refer to the API documentation. AlarmClock App The Alarm Clock follows a similar idea to most moddable things in KSP. The fundamental building blocks are: AlarmClockScenario: The scenario module that runs and manages the alarms AlarmTypeBase: The abstract class that all alarm types inherit from I won’t go into all the specifics here as the API help should cover many of these things, but here’s some key pointers. The scenario maintains the list of alarms and persists them into the save file. AddAlarm, RemoveAlarm, GetNextAlarm, etc help you manage the alarm list.There are GameEvents for changes to the list as well. There is currently no “GetAllAlarms” method - Triggers apologies - this will be fixed You define the input fields you want by attributing fields or properties with AppUI_Control types. These fields/properties can then be used in the AlarmType class to define the time for the alarm and any other behaviour. An example here is AppUI_InputDateTime which will give you a datetime input when creating/editing an alarm. Some key fields/overrides in the alarm type include: id - the persistent identifier for an alarm GetDefaultTitle() - the string that will be the title of a new alarm iconURL - a gamedatabase path to the icon to use in the drop downs and lists - the default ones are 64x64 pngs ut - the time of the alarm in universal time RequiresVessel() - when true the alarm will only be available in the UI to add when a vessel can be selected CanSetAlarm(AlarmUIDisplayMode displayMode) - lets you control when the inputs are valid in add and edit mode to save changes OnInputPanelUpdate(AlarmUIDisplayMode displayMode) - called in the Monobehavior update loop by the app for each alarm when it is displayed in the app OnScenarioUpdate - called in the Monobehavior update loop by the scenario when the alarm is in the list. Here’s an example of a very simple alarm type that will let you set a date public class AlarmTypeTest : AlarmTypeBase { [AppUI_InputDateTime(guiName = "Alarm Date", datetimeMode = AppUIMemberDateTime.DateTimeModes.date)] public double alarmDate; public AlarmTypeTest() { iconURL = "TriggerTech/TestMod/AlarmIcons/DavesTest"; } public override bool CanSetAlarm(AlarmUIDisplayMode displayMode) { return true; } public override string GetDefaultTitle() { return "Daves Test Alarm"; } public override bool RequiresVessel() { return false; } public override void OnUIEndInitialization(AlarmUIDisplayMode displayMode) { if(displayMode == AlarmUIDisplayMode.Add) { alarmDate = Planetarium.GetUniversalTime() + 600; } AppUIMemberDateTime m = (AppUIMemberDateTime)uiPanel.GetControl("alarmDate"); m.DatetimeMode = AppUIMemberDateTime.DateTimeModes.date; } public override void OnInputPanelUpdate(AlarmUIDisplayMode displayMode) { ut = alarmDate; } } Generic UI framework The key driver for this system is the idea of moddable inputs to applications for various moddable functions. The fundamental idea being that in a UI you can place a panel that has a vertical layout group and an AppUIPanel component, call Setup with a data class and it will present the user with an editable section of UI that correlates to the data inputs. It edits the data class and the code can then use the edited object directly. Steps to use it: Create a “panel” in your UI that will hold the input fields. Create a class that holds the inputs (inherits class AppUI_Data). Apply the attributes to the fields that are for input within the class. “Setup” the panel at the right time in code. Classes of interest AppUI_Data - this is your data class which can use attributes on fields to create UI controls. The following UI controls can be used as attributes on your fields in your AppUI_Data class.: AppUIMemberDataTime AppUIMemberDropdown AppUIMemberDropdownMultiLine AppUIMemberHeading AppUIMemberInput AppUIMemberInputFloat AppUIMemberLabel AppUIMemberLabelList AppUIMemberRadioBool AppUIMmeberSliderFloat AppUIMemberSliderFloatMultiLine AppuiMemberToggleBool File Folder Browser Craft files are still stored as text in .craft files. The thumbnail naming convention has changed, but otherwise the thumbnail itself is generated no differently. The search classes don’t have any exposed methods that can be used to actually do anything aside from literally starting and stopping a search using whatever information is in the search input text field. The folder-action confirmation dialog for deleting and creating folders can be created and passed callbacks that are fired when the indicated action is confirmed. The folder browser doesn’t use any config files that could be modified. Public methods and properties include querying if the currently selected folder is a player-craft or stock-craft folder, and querying if the currently displayed folder structure is for the VAB or SPH. Folder highlighting can be overridden using a craft’s file-path, and folder highlight overrides can also be turned off. Also exposed is a method for updating folder file-counts for all folders as well as for a specific folder. Properties are exposed that return the local machine’s file path for the stock craft folder, the expansion directory folders, and the mission craft folders Lights We added the ability to disable and enable the Color Picker of the lights - use the KSPField disableColorPicker in the part.cfg file. Also if one light has more than one transform you can control it with the same Module light. You can do this by defining one or more LIGHT submodes within the ModuleLight node in your part.cfg file. Eg: MODULE { name = ModuleLight …. (normal ModuleLight fields) LIGHT { lightName = light1 lightR = 1.0 lightG = 1.0 lightB = 1.0 flareRendererName = flare1 } LIGHT { lightName = light2 lightR = 1.0 lightG = 1.0 lightB = 1.0 flareRendererName = flare2 } } Docking Port rotations. Docking port parts are now able to do an alignment rotation once they are docked. In order to make a dock being able to rotate, you need to configure them so: canRotate: set to True, when this rotating feature should be available to this part rotationTransformName: Name of the transform of the model that will rotate. maxMotorOutput: this is used for the electric charge resource consumption calculations. set this according to the part’s design guidelines RESOURCE definition: this one should be the same for all docking ports that use this rotating feature. This is used to specify which resource is consumed by doing the rotation These other KSPFields are optionally available to configure as well: rotationAxis: The rotation axis, defaulted to the z axis. This is necessary as some docks might have a different rotation axis. Can be "X", "X-", "Y", "Y-" or "Z", "Z-" traverseVelocity: The traverse speed (in deg/s for rotational motion) hardMinMaxLimits: The angle range that's defined by the physical limits of the part model and/or the part's designer. The default values are -15, 15. A player must not be able to set an angle beyond this range. This is a Vector2 so, could be defined as “-15, 15“, for example. efficiency: Servo efficiency (1 = 100%) baseResourceConsumptionRate: Base resource consumption on motor output when the servo is moving referenceConsumptionVelocity: The transform velocity (angular or positional) at which the resource consumption is 1 x the baseResourceConsumptionRate New Slim Suit ID Maps ksp_slimsuit_uv_map.zip ksp_1-12_suit_idmap.zip Other misc modding changes Failed reflection calls to incompatible or otherwise invalid mods are now handled, so they don't stop the game from loading. Custom suits now show the corresponding icon in all relevant screens. These have to be provided by the mod, the game will not generate them. Added an additional useCustomThreshold field to ModuleOrbitalSurveyor. Setting it to true will allow the module to recalculate the minimum and maximum altitudes beyond the stock values. When multiple versions of the same assembly are present, KSP now makes sure only the most recent one is loaded. It’s still a good idea to encourage people not to do this, to avoid clutter. Tuned the logic to calculate space object resource percentages based on the lowRange and highRange values, preventing space objects from always having > 80% resources regardless of the range values. Added a GameEvent for revert to launch that returns the current FlightState.
  3. Inventory System 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): EVAConstructionModeController EVAConstructionModeEditor EVAConstructionToolsUI 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. Other Items 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).
  4. The PartTools package is a set of utilities provided by Squad to be used by modders to:- Create their own 3D models and parts in KSP. Create KSPedia pages for their mods. Create Internal 3D models for their parts in KSP. PartTools also includes the coloranimation tool and the KSPAssetCompiler tool (for compiling asset bundles). PartTools have been updated and re-compiled for Unity 2019.4.18f1 for KSP 1.12+ to include all of these tools in one unity asset bundle. Current latest version is here PartTools_AssetBundles_2019.4.18f1.zip To install Follow these Instructions: Download Unity 2019.4.18f1 and run it. Then open your Mod project, upgrade it to Unity 2019.4.18f1. Uninstall the built-in Unity TMPro package from Unity 2019.4.18f1 - Go to Window - Package Manager in Unity and Select TMPro and uninstall it. Download this exact file "TextMesh Pro Release 1.0.56 - Unity 2017.3 " from https://forum.unity.com/threads/useful-information-download-links.458634/#post-3304434 and import it into your Mod project in Unity using Assets - Import Package, Custom Package menu option. Import the custom bundle in the zip file above into your Unity project. Disable "Validate References" for the KSPAssedCompiler.dll and KSPAssets.dll in the "Assets/Plugins/KSPAssets" folder. Restart Unity and reopen your mod project. That's ALL you have to do. For information about how to build and use fonts for Localization please refer to this link. Previous Versions: For the old Unity 2019.2.2f1 PartTools use this file: PartTools_AssetBundles_2019.2.2f1.zip For the old Unity 2017 PartTools you can use this file: PartTools_AssetBundles_2017.zip
  5. This is the Official API documentation. Here are the Doxygen docs for KSP 1.12.0
  6. Here’s some notes and details from the team with regards to the changes that come with KSP 1.10.0. Customizable Kerbal Suits Description of the process to edit and import customized EVA suits. The Suit Picker It is a tool introduced in KSP 1.10 Update, designed to let players choose among the available suits and colors for EVA. The Materials Attached you will find the following (link to attachment below): A UV Map file that lets you identify the wireframe of the model of the character. And an ID Map so it is easier to select colors and create combinations. Adding Customized Suits - Instructions In order to add a new suit variant the player has to create a folder called Suits inside the GameData/Squad folder. Inside Suits, other three folders called Config, Icons and Textures. Then in the Config folder we need to create a .cfg file called SUITCOMBOS with the following properties: DisplayName: The name of the variant shown at the suit title in the suit picker window. SuitType: The suit type the variant belongs to; Default, Vintage (Making History) or Future (Breaking Ground) Gender: The gender this variant belongs to; Male or Female Name: A unique string to identify the suit combo, example CustomSuit1 Suit Texture: The path where the custom suit texture is (Textures folder). Suit Normal Texture: The path where the custom suit normal texture is (Textures folder). Sprite: The path where the texture variant icon is (Icons folder). Primary Color: The primary color used in the texture variant button, in hexadecimal. Secondary Color: The secondary color used in the texture variant button, in hexadecimal. Example: SUITCOMBOS { SUITCOMBO { displayName = Custom Suit 1 suitType = Future gender = Male name = CustomSuit1 suitTexture = Squad/Suits/Textures/futureSuit_diffuse_redBlue suitNormal = Squad/Suits/Textures/futureSuit_normals_redBlue sprite = Squad/Suits/Icons/kerbalicon_suit_future primaryColor = #012957 secondaryColor = #b3313a } } To add more variants there’s no need to create multiple files, adding a new “SUITCOMBO“ block in the cfg like the one above is enough. PNG or DDS: PNG or DDS file formats have a different orientation in the game, if you notice your texture isn’t displaying in a correct way it may be missing a vertical flip. ICON: Icons should be added to the “Icon” folder. It should be a small image only 33 pixels width 54 pixels height, preferably with transparency. Make sure to add the texture and icon files in their respective folders: Icon and Textures. And more importantly; have fun! Here is the link to the map files you can use. Gas Giant Planet Shaders Using the gas giant shader with new celestial bodies Please ensure that you also add a GasGiantMaterialControls component to your object because it controls some of the features of the Terrain/Gas Giant shader. You can also use it to control the way that the shader looks by assigning the appropriate values to members. Using GasGiantMaterialControls Just about everything should be handled automatically for you, but please remember to call GasGiantMaterialControls.UpdateMaterialControlSettings() if you swap the material or shader for the celestial body. If you just set new values using the members on GasGiantMaterialControls, updates will be handled for you. All of the capitalised names referred to below are members of GasGiantMaterialControls. I want to modify the movement speed of Jool's features Get ahold of the GasGiantMaterialControls component on the Jool object and assign new values to the BandMovementSpeed member to change how fast the bands move, swirls can be controlled with the SwirlRotationSpeed, SwirlRotationSwirliness (which controls the final extent of the swirl rotation), and SwirlPanSpeed members. Levels of detail The gas giant shader uses two different levels of detail, so we read the textures in separately and blend the two depending on the distance from the camera to the pixel. The blend happens between the NearDetailDistance and the FarDetailDistance with the strengths of how much of each texturing pattern controlled by the NearDetailStrength (maximum strength of the detail texturing when zoomed in) and FarDetailStrength (maximum strength of the detail texturing when zoomed out). The texturing uvs for the detail texturing use the far uvs multiplied by DetailTiling. I want to modify Jool's pattern CloudPatternMap controls the pattern for far texturing and DetailCloudPatternMap controls the texturing for near texturing. For both we just read the red channel of the texture to get the pattern. (The green channel in CloudPatternMap controls the blend between the colours for the far texturing.) I want to modify Jool's colour The far texturing uses two colour ramps: ColourMap and ColourMap2. For the near texturing, we read the colour of both ramps using the value of the cloud pattern (since it's greyscale). We then take both of those colour ramps and blend between them using the value in the green channel of the CloudPatternMap. The near texturing uses one colour ramp: DetailColourMap. For the near texturing, we just read the colour of the ramp using the value of the cloud pattern (since it's greyscale). I want to change Jool's movement bands The movement bands are controlled by the MovementControlTexture. The red and green channels control the left and right movement speeds (black for no movement, white for full movement speed). The blue channel controls the blend between the texture reads for the two bands. The speeds from the red and green channels are then multiplied by the BandMovementSpeed member. I want to change Jool's swirls The swirls are controlled by the SwirlControlTexture. The red channel represents the x uv position of the centre of rotation, the green channel represent the y uv position of the centre of rotation, and the blue channel controls how much the swirl actually rotates. The pan speed of the swirls is controlled by the alpha channel in MovementControlTexture. Flag Parts Flags composition: 1 parent object without a mesh. At least 1 child object with a mesh 1 background texture 1 flag texture assigned in the Editor (VAB or SPH) Flags Paths Flags can be assigned pre-existing or new textures from the Flag browser. Flag texture path: KSP\GameData\Squad\Flags Stock flag parts path KSP\GameData\Squad\Parts\Utility\flags Stock BackgroundTexture path KSP\GameData\Squad\Parts\Utility\flags\backgroundTextures Flags parts .mu file This is the hierarchy order example from the RFP-1 Flag (1.25m) The parent object “1.25Flags” is just an empty group or object holding the actual flag meshes. When the part is spawned the first available mesh will be set and when the size or orientation is changed, the corresponding mesh will be the only active and visible mesh. But in reality, all the mesh children should be overlapped and centered. Flags CFG The flag meshes from the .mu file must have the same name as the one included in the cfg under the FlagDecalBackground MODULE Flag Mesh Example MESH { name = small displayName = #autoLOC_6006063 //#autoLOC_6006063 = Small meshName = 1.25SmallPortrait orientation = PORTRAIT } In this example we can see how a mesh is referenced All of the members must be included for each MESH added. name is the key of how flag sizes are grouped, as we can have 2 flags of the same size, but with different orientation. displayName This one should match the name but is not necessary. meshName This string MUST match the name of the mesh included in the .mu file. orientation can be only LANDSCAPE or PORTRAIT, as the flags can be toggled between orientations in the Part Action Window. Flags Variants Variant Example VARIANT { name = White displayName = #autoLOC_8007119 //#autoLOC_8007119 = White primaryColor = #ffffff secondaryColor = #ffffff TEXTURE { //shader = KSP/Alpha/CutoffBackground backTextureURL = Squad/Parts/Utility/flags/backgroundTextures/white_background backColor = #ffffffff } } name Name of the variant displayName display name of the variant with an autoloc assigned primaryColor primary color secondaryColor secondary color shader shader that flags use within the game. backTextureURL Background texture assigned, if this is not set it will be transparent. Like the already existing TransparentBackground Variant. Fairing Variants In general, if you create a variant for a fairing part the same way you would any other part, it will be fine. But there are a few extra capabilities for fairings specifically that you can exploit. The following will help you get the most out of them. Variants for fairings have an extra block that you don’t typically see in other variants, called EXTRA_INFO. While this is not new or exclusive to fairings, there are some fairing-specific variables to set up. Take the silver variant for stock fairings as example: VARIANT { name = Silver displayName = #autoLOC_6005005 themeName = Silver description = #autoLOC_6005006 primaryColor = #cecece TEXTURE { materialName=FairingsMat mainTextureURL = Squad/Parts/Aero/fairings/fairings_diff } EXTRA_INFO { FairingsTextureURL=Squad/Parts/Aero/fairings/fairings_silverDiffuse FairingsNormalURL=Squad/Parts/Aero/fairings/fairings_normals FairingsSpecularURL=Squad/Parts/Aero/fairings/fairings_silverSpecular BaseMaterialName=FairingBase shaderName=KSP/Bumped Specular (Mapped) BaseTextureName=Squad/Parts/Aero/fairings/FairingBase_silverDiffuse BaseNormalsName=Squad/Parts/Aero/fairings/FairingBaseNormals_goldSilver _SpecMap=Squad/Parts/Aero/fairings/FairingBase_silverSpecular _SpecMap=Squad/Parts/Aero/fairings/FairingsMat_silverSpecular _Shininess= 0.41 _Opacity= 1.0 _RimFalloff= 2.0 _AmbientMultiplier= 0.3 } } The way the silver variant is different from the rest is that it changes the shader for both the base of the fairing and the panels. This is done through the shaderName parameter as well as some material-texture name matching. If you don’t specify a shader name, the module will assign the usual Bumped Specular to both base and panels. If you do specify a different shader, it will copy the shared properties and you will also be able to specify the rest as parameters in the EXTRA_INFO block (note _Shininess, _Opacity and so on). The aforementioned material-texture name matching means that for the FairingsTextureURL, FairingsNormalURL, FairingsSpecularURL, BaseTextureName and BaseNormalsName textures specified to actually be applied correctly, the material name must be the start of the texture name (e.g. the base mesh has a material named FairingBase applied, the diffuse and normal textures are named FairingBase_silverDiffuse and FairingBaseNormals_goldSilver, both starting with the material name). Repeated material parameters are also differentiated by this same principle (see the two _SpecMap parameters defined in the example). For the toolbox preview to work correctly, the panel icon name must have a material that uses the Bumped Specular shader and that contains IconShell in its name. Also it must have the Icon_Only tag. The bases just work as long as they have the Icon_Only tag also. One additional configuration is that the base mesh must be named Mesh. Drag Cubes Below provides some background and useful information for modders on drag cubes. Changes made for KSP 1.10 are called out below. But first, Drag Cubes: What are they? Simple Explanation A system of defining the drag profile for an object. Complex Explanation Read any books by Michio Kaku, the theoretical physicist? In one of his books he stated that some cultures believe you achieve nirvana if you can mentally visualize a hypercube (also know as a tesseract), a 4 dimensional cube, being rotated in 3 dimensional space. This is a 4 dimensional tesseract being rotated in 3 dimensions. And here is KSP’s drag cube model. It's important to note that the directions x+ (XP), y+ (YP) etc are relative to the part if placed without rotating it first. If you rotate the part the directions are relative to the part's orientation. EG: if I rotate a part upside down so it's pointing opposite to the way when it's first selected in the VAB/SPH then it's cubes would now be opposite when placed. All parts have drag cubes defined in a file called partdatabase.cfg. Fixed, Procedural and Dynamic Drag cubes Fixed A single drag cube is generated and used for the part. Dynamic Multiple Drag Cube entries can be defined for a part as separate cube entries for a part. For parts that have multiple cubes they will have IMultipleDragCube implemented in their PartModule. These are usually defined for parts that move or have different profiles, eg: Deployable parts (fairings, etc), Robotic parts, etc. The partmodule in these cases will calculate which drag cubes are appropriate and set the cube weight of each drag cube the drag system should apply in the DragCubeList (list of drag cube info on a part) Procedural Are generated at runtime by DragCubeSystem when called (not at KSP startup) - eg: Procedural Fairings drag cube generation. Procedural drag cubes come at a performance cost and so are only used when necessary. Part Prefab Drag cubes A DRAG_CUBE node can be defined in a part.cfg file for a specific file. This will always be applied to this part and overrides anything in partdatabase.cfg. These are generally cubes that have been manually calculated, most common are hollow parts as they need special manual handling to get the drag cube definition correct and will override any automatically generated drag cubes in the partdatabase.cfg. DragCubeSystem This system will generate Drag Cubes for parts where a DRAG_CUBE definition has not been found in partdatabase.cfg or the part.cfg file. It is also used to generate Procedural Drag Cubes as required. DragCube format in DRAG_CUBE node cube = <name>, <area>,<drag>,<depth> x 6, <center.x>,<center.y>,<center.z>, <size.x>,<size.y>,<size.z> <name> = the drag cube name. These three floats will appear six times for each cube, the 6 occurrences being the XP, XN, YP, YN, ZP, ZN dimensions. <area> = total pixels taken up by the profile. <drag> = how much drag in the cube. This is calculated based on the red color within the image, applied to the std physics drag curve defined. <depth> = how deep into the cube. This is calculated based on the green color within the image. <center.x>,<center.y>,<center.z> = The center x,y,z position of the drag cube. <size.x>,<size.y>,<size.z> - The x,y,z size of the drag cube. IMultipleDragCubes Any PartModule can implement this Interface. If a part module implements this interface then the DragCubeSystem will use this interface when generating drag cubes for the part. It is up to the PartModule implementing the interface to manage the drag cube weights as appropriate to achieve the correct blend of drag cube information based on its state. Handling multiple PartModules using this interface This is What has changed for KSP 1.10 release. Before KSP 1.10 variants and multiple partmodules could not implement IMultipleDragCubes on the same part. ModuleJettison and ModuleVariants are used frequently together. Usually variants for different engine variants and jettison are used for shrouds on the engine. The DragCubeSystem will define cubes for each of these modules and the two modules work in unison to ensure the correct Drag cube weights are set depending on their state. Note: In this combination the "Bare" cube on ModuleJettison although generated is not used. Instead each variant in ModuleVariants will enable it's variant drag cube entry. The "Shroud" cube is used from ModuleJettison when there is a shroud enabled and the meshes from the ModuleVariants are enabled based on which variant has been set. Any combination of PartModules implementing IMultipleDragCubes on the same part outside of the two modules mentioned will fall back to using Procedural drag cubes, IF more than one of the PartModules has useMultipleDragCubes set to true. You could have two PartModules on the same part but only one or none of them has useMultipleDragCubes set to true. Example: An engine part that has ModuleJettison (for shrouds) set to useMultipleDragCubes true and ModuleVariants that only changes textures (not meshes) with it's useMultipleDragCubes set to false. Other Items ESA Missions without Making History DLC: Yes, the ESA missions can be run by users who have not purchased the Making History DLC. No, this does not mean you can run any other missions without the Making History DLC installed. IPartMassModifier has been added to ModuleJettison. This allows mods to implement mass change to parts when they jettison. Application of mass to resource ratios in ModuleResourceConverter recipes has now been fixed/added. Renamed a duplicated shader "KSP/Particles/Alpha Blended" to now have one named that and another named "KSP/Particles/Alpha Blended Scenery". This probably should have no impact on mods, as they probably don’t use this shader. But you never know.
  7. Here’s some notes and details from the team with regards to the changes that come with KSP 1.9.0 Atlas Terrain Shader (Ultra Detail Shader) Quick Guide: I want to use the fancy new shader on a celestial body that doesn't support it. Teach me how! 1. (Offline) Create a texture map detailing the texture indices and strengths of the textures to be shown on the celestial body. (Rules are provided below.) 2. (Runtime) Find the PQS component for the celestial body that you want to change the shader on. Create a new GameObject, attach a PQSMod_TextureAtlas component to it, then parent the new game object to the PQS object. 3. (Runtime) Use ScriptableObject.CreateInstance<CBTextureAtlasSO>() to create a new CBTextureAtlasSO object, then call CBTextureAtlasSO.CreateMap(MapSO.MapDepth.RGB, texture) using the texture created in step 1 to use your texture map. Assign the new CBTextureAtlasSO object to the textureAtlasMap variable of the PQSMod_TextureAtlas component created in step 2. This will ensure that your texture map is used to specify the positions of the textures on the surface of the celestial body. 4. (Runtime) Create Texture2DArray objects of the textures and the normal maps to be used in the material by using KSPUtil.GenerateTexture2DArray(int textureSize, List<Texture2D> textureList, TextureFormat format, bool createMipMaps). Information about the operation can be found here: https://docs.unity3d.com/ScriptReference/Texture2DArray.html 5. (Runtime) Create a new material using the command new Material(Shader.Find("Terrain/PQS/PQS Triplanar Zoom Rotation Texture Array")) and assign the Texture2DArray objects created in step 4 to the _AtlasTex and _NormalTex properties of the material. Fill in the other properties on the material as desired. 6. (Runtime) Assign the new material to both the highQualitySurfaceMaterial and the surfaceMaterial variables of the PQS component for the celestial body. The PQSMod_TextureAtlas component will ensure that all the necessary data is transferred across to the shader when the planetary surface is displayed. I like your textures! I only want to change where they're used on Kerbin! We appreciate the compliment! Just do steps 1 and 3 in that case. I think that you did an excellent job with the way that the textures are mapped to the biomes on Kerbin! I only want to change the actual textures! You're going to make us blush if you keep flattering us! Just do steps 4 to 6. Texture Map Authoring Rules: Two textures per pixel and the strength of each can be specified so that the artist can control blends between the textures. This is done through an RGB texture (the alpha channel isn't used) with the following rules: R: This value corresponds to the texture array index of the first texture. We multiply the texture index value by 10 to avoid errors and make it easier to author, so array index 0 will be 0, array index 1 will be 10, array index 2 will be 20, and so on. G: This value corresponds to the relative strength of each of the textures. So a full value of 255 means that it will only display the texture referenced in R, a value of 127 means that it will display half of the texture referenced in R and half of the texture referenced in B, and a value of 0 means that it'll only display the texture referenced in B, for example. It blends between the values, so use whatever strength makes the most sense for a nice blend between textures! B: This value corresponds to the texture array index of the second texture. We multiply the texture index value by 10 to avoid errors and make it easier to author, so array index 0 will be 0, array index 1 will be 10, array index 2 will be 20, and so on. A: Not used, so don't create an alpha channel. Other Items KSP now uses only one single camera rendering in DX11. Due to improvements done by Unity with regard to rendering using DX11 (Z order reversal amongst other things) KSP now only uses “Camera 00” when rendering in flight, mapview, tracking station and KSC scenes. This improves performance significantly and exponentially depending on what graphics settings you are using. We are unable at this time to do single camera rendering on OpenGL platforms. Added Per Kerbal PhysicMaterial Accessors for Modders so you can adjust each kerbals bounciness using KerbalEVA.SetPhysicMaterial, KerbalEVA.ResetPhysicMaterial. The KSP Assembly version is now set correctly on game start so KSPAssemblyDependency will work for KSP versions. Added events for Action Groups in flight visibility changes so mods can handle any UI changes they need to in each mode. onGUIActionGroupFlightShowing - Fired when the Action Group Editor is about to open in flight. onGUIActionGroupFlightShown - Fired when the Action Group Editor is finished opening in flight. onGUIActionGroupFlightClosed - Fired when the Action Group Editor is closed in flight. Added Pause/UnPause events when the action groups show/hide in flight. Fires OnGamePause and OnGameUnpause. Fix PQS.radiusMax not including some noise PQSMods in its calculations. Should now mean that PQS.radiusMax is no longer below any vertex in most cases. New PartModule called ModuleResourceDrain for the new stock resource drain part can be used like any other PartModule by modders.
  8. The wiki seems to be missing a few of the available modules. For example, one which I need to use is: ModuleDeployableAntenna and it's not in it
  9. KSP Font system. With the introduction of 1.3 and Localization several changes have been made inside KSP that set the base for the localization process. One of these changes is the introduction of a font system. The purpose of this document is to set a handy guide on how it works and what modders can do with this new font system. How does it work? All the game texts have been changed to use only 2 fonts, one for the MainMenu (JD-LCD) and another for all the rest of the KSP UI (NotoSans). These two fonts are considered the stock fonts of KSP and cannot be changed. That said however, KSP uses TMPro to handle all the UI/Text in the game and it allows us to create fallback fonts so you can create new fonts (sub-fonts) and attach them to the KSP stock fonts expanding the list of characters supported by KSP. The fallback font system works when you request a character in the font. For example, if you request a character let's say japanese letter A -> あ the font looks for it in the font character list and if the character is not found then it look for it in fallback fonts. NotoSans - Game Font This stock font contains the following characters of the Unicode standard (Basic Latin, C1 Controls and Latin-1 Supplement, Latin Extended-A, Latin Extended-B and Cyrillic). JD-LCD - MainMenu Font This stock font contains the follow characters of the Unicode standard (Basic Latin, C1 Controls and Latin-1 Supplement, Latin Extended-A, Latin Extended-B). Unicode standard reference: http://billposer.org/Linguistics/Computation/UnicodeRanges.html Additional to these stock fonts KSP contains several sub-fonts that handle additional characters for Russian, Japanese, Chinese and Korean and this is where the KSP font system enters into the scene. The KSP font system manages all sub-font related activities (load fonts, add them to a stock font, remove them, etc). The stock fonts and their character set cannot be changed, but all the KSP sub-fonts can be removed or replaced by custom fonts. Each sub-font is connected to a language code, this is done by design as the KSP font system manages and creates new sub-font without adding more character ranges to the existing stock fonts. How to add sub-fonts. Create a new Unity Project. Download/Import from the Unity AssetStore the TextMesh pro version 1.0.55 March 2017 Download KSP parttools and import the unity packages into a Unity project. You should have KSPAssets.dll and KSPAssetsCompiler.dll in your project. You can download it from here. Create a TMPro FontAsset with the desired font, following this tutorial https://www.youtube.com/watch?v=qzJNIGCFFtY Create a KSPFontAsset from the created TMP_FontAsset on the previous step by right clicking on the font and using the option “KSP Fonts/Generate KSPFontAsset”. You should now have 2 files as per the following image: Now you need to create a bundle name and associate the font assets. First you need to select the font files you want to include in your bundle and set a bundle name in the unity inspector. Select the New.. option to create a new bundle name. Type the name of your new bundle name. Now you should see that your font files have the bundle name associated with them. Make sure you assign the AssetBundle to both the TMPro asset file and the KSPFontAsset you created in step 5. Now we need to create an asset bundle of that font using the KSPAssetCompiler, First open the “KSPAssets/AssetCompiler” menu on the Unity top bar. This will bring up the Asset Compiler window and there you will see the bundle name you just created. You need to click on the create button to create the bundle definition file. Finally you only need to click on the “Build All as Fonts” button to start the bundle creation. After the process is complete a new folder AssetBundles will be created on your project root folder and there you will see your font bundle. Place that bundle anywhere in the GameData folder. The font will be loaded at the beginning of the game, you will the see the name of the bundle been loaded in the loading screen. Now you need to create a mod to activate the font by using the method AddGameSubFont or AddMenuSubFont of the FontLoader class depending on where you want the font to be active. You can follow the example below or read the mods API.
  10. Here are the Doxygen docs for KSP 1.2 (NOTE: IN PROGRESS) Note they are current as of a couple days ago, we will continue to update them as interfaces change during the prerelease process.
  11. The following describes how you can setup your mod to support Localization languages for KSPedia asset bundles and static files. KSPedia With only the free version of TMPro available to modders unfortunately this means modders cannot use TMPro/AutoLoc language tags in KSPedia pages. The current solution for modders is to create separate KSPedia asset bundles for each language you wish to support and then to implement your own patching files as per the following patching section below. Static Files (such as textures) Static files for Localization cannot be automatically replaced by mods. For Stock KSP this is performed via Steam automatically when the user selects their language. But what modders can do is implement their own patch files to switch and replace static files for different languages. Please refer to the patching section below. Patching - Windows Localization patches for KSP Windows version are created using Inno Setup, this software allows you to create installers for Windows (2000 - Win 10) and also includes other very useful options such as multilingual support to create installers. It is best to create a separate script for each language you want to support. Here is an example of how to create a patch using Inno Setup: Download the Unicode version of the program here and install it Chinese is not officially supported, but the language file can be downloaded from here, then the file just needs to be placed in the “Languages” folder located in the Inno Setup installation folder. To expedite things, here is a full configuration script used to create a language patch for KSP, some parts will be explained (click here to download the file), in any case we recommend to visit the documentation. Some parts of the configuration script are very straightforward, as mentioned before we recommend you visit the documentation to clarify any concerns or questions you may have. Here is a brief explanation of the most important aspects to consider: [Setup] Section OutputBaseFilename=KSP-LANG_PATCH-EN_US; This will the name of the resulting installer PrivilegesRequired=admin; Privileges required to run the patcher SetupIconFile=icons\kspInstIcon.ico; Location of the icon file UninstallDisplayIcon=icons\kerbalIcon.ico; Location of the icon file [Languages] Section This part is very important for localization. If you want your resulting installer to be in Japanese for instance, you will need to change the language: Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" [Files] Section Source: "en-us\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs This is the location of the files that will be installed by the patcher app, in this case is the content of the “en-us” folder. Note: “Default.isl” contains the Messages for the English language [Run] Section Here you specify the actions to perform once the installation has completed, in the example case we have configured it to execute the launcher and the Readme file. {CODE} Section Inno setup offers the possibility to add functionality to your installers, for Stock KSP patchers we needed to be sure that the player has a version of the game that supports the localisation features. We resolved this by validating the build id number contained in the buildid.txt file, and this is precisely what is contained in the code section. If you don’t want this additional functionality, this entire section can be completely erased from the configuration script. Patching - OSX & Linux Patching for OSX requires you to write a script .command file to replace KSPedia bundles and static files as per the example below. Patching for Linux requires you to write a script .sh file to replace KSPedia bundles and static files as per the example below. Example script (used for KSP Store language patcher) #!/bin/bash cd "`dirname "$0"`" if [ -f buildID.txt ]; then sed -n '2p' < buildID.txt > temp.txt read uno dos tres buildid < temp.txt if [ "$buildid" -ge "1730" ]; then rm temp.txt printf '\nThis script will patch Kerbal Space Program to translate it to English\n' if [ -f KSP-LANG-EN-US.zip ]; then unzip -oq KSP-LANG-EN-US.zip echo ' ************************************************************** ' echo ' ****************************************************************' echo '** Kerbal Space Program has been translated to English US **' echo ' ****************************************************************' echo ' ************************************************************** ' else printf '\nERROR: \nThe ZIP file was not found, please verify that it is located in the same folder as this script...\n\n' exit -1 fi else rm temp.txt printf '\nWarning: \nYou are running a version of KSP that does not support the Localization feature, please go to KSP Store and download the most recent version of the game. \n\n' fi else printf '\nLooks like Kerbal Space Program its not stored on this folder...\nMove the Localization files to the folder where Kerbal Space Program is located and run again this script... \n' fi Linux #!/bin/bash cd "`dirname "$0"`" if [ -f buildID.txt ]; then sed -n '2p' < buildID.txt > temp.txt read uno dos tres buildid < temp.txt if [ "$buildid" -ge "1730" ]; then printf '\nThis script will patch Kerbal Space Program to translate it to English\n' if [ -f KSP-LANG-EN-US.zip ]; then unzip -oq KSP-LANG-EN-US.zip echo ' ************************************************************** ' echo ' ****************************************************************' echo '** Kerbal Space Program has been translated to English US **' echo ' ****************************************************************' echo ' ************************************************************** ' else printf '\nERROR: \nThe ZIP file was not found, please verify that it is located in the same folder as this script...\n\n' exit -1 fi else printf '\nWarning: \nYou are running a version of KSP that does not support the Localization feature, please go to KSP Store and download the most recent version of the game. \n\n' fi else printf '\nLooks like Kerbal Space Program its not stored on this folder...\nMove the Localization files to the folder where Kerbal Space Program is located and run again this script... \n' fi
  12. Hi folks, here are the modders notes for KSP 1.2.9/1.3 as they stand for the latest prerelease. Any updates and changes will be posted in this thread. Localisation Localisation is done using a system of tags. The format of these tags is #autoLOC_xxxxxxx. It is suggested you use a similar format so you can easily detect if a tag is not loaded in the system. Tags are used as keys in a dictionary so they should be unique over all .cfg files in a single language, otherwise the first one found will override any other duplicated keys. You will find these tags throughout the cfg files in the Localization folder. The game has a database of tags that it loads on startup from config files. There are two ways these get formatted into the currently selected language. Either via a call to the Localizer class (good idea to do regardless and especially before joining or manipulating strings). The UI TMPro plugin will also call the Localizer format method before displaying text to the screen. In a lot of cases either strings have been converted to use these tags, or additional display versions of strings have been added to modules, etc. (Listed below, but there are probably others we have missed). All fonts are loaded regardless of language selected which allows display of names, etc in different languages where saves are used across different language settings. Lingoona Guidelines When using a tag that includes the characters “{” and “}”, the characters “「” and “」” should be used instead. Lingoona and TMPro support utf-16 and utf-32. So if you need a leading or trailing space in your tag you should use the unicode symbol “\u0020” as <spaces> will be automatically trimmed by the cfg loader. Format of the tag cfg files. You can create as many .cfg files as you like anywhere in GameData and they will be loaded automatically. The Config node name is “Localization” followed by language data inside the first block and then the tags and their values in the second block. Format is: Localization { es-es { #autoLOC_600040 = <b>¡PODEMOS CONSTRUIRLO!</b> } } How to add a language to KSP. Currently there is only one safe way to add a language to KSP. This method allows you to add additional languages to KSP with just a few lines of code. Method Steps: Create a duplicate of all the files located in the folder “GameData/Squad/Localization” to any other folder under the “GameData” folder. Open those files with a text editor. Edit the language tag on each of those files for example you are translating from English to German the file language tag should change from “en-us” to “de”. This is important as this game tag tells the game which translations correspond to which language and if you forget to edit this value you may end up with a mix of languages at the same time. Then edit all the #autoLoc_xxxx entries with the appropriate translated text, preserving the special format strings like <<1>> parameters or style tags <color=orange> untranslated. This special tags are used to give format to the text or inject variable values to dynamic texts. Create a simple mod, that Starts instantly and changes the language settings like in the following code example. The first method in the example updates the localization table to the desired language. The cfg url’s are stored in the game database and using the Localizer.SwitchToLanguage will switch the Localizer to use the appropriate values for that language. The second method in the example changes the font setting for the main menu to a set of characters supported by the stock font sets, keep in mind that if your language is not supported in the stock font set you may need to include a font set mod. Localizer class. The Localizer class is used to format the strings for localization. It reads the localization tags from the cfg files and replaces them with the appropriate translated texts and parses them through the Lingoona Grammar engine as necessary. Public members Instance - This the singleton instance reference allowing static access to non-static class methods and variables. Tags - This is a reference to the internal tags dictionary that is currently loaded. TagsLength - Returns the tags dictionary size. CurrentLanguage - Returns the current language code. Public methods string Format(string, params object) - This method receives a text template that can be either a localization tag or a Lingoona format string and a list of optional parameters of any type that can also be tags or Lingoona format strings, the method returns the processed string by the Lingoona Grammar engine replacing the tags with the appropriate value if found. string GetStringByTag(string) - This method receives a localization tag, the method returns the tag value if found, if the tag value is not found it will throw a KeyNotFoundException. bool TryGetStringByTag(string, out string) - This receives a localization tag and tries to get the value and save it on the out parameter, returns whatever value was found or flalse/null. void TranslateBranch(ConfigNode) - This method translates the config node values that contains either a Lingoona string or a localization tag. string GetLanguageIdFromFile - This method returns the language code from the game build settings, this value is managed by steam or downloaded language. bool SwitchToLanguage(string) - This method receives a language code and reloads the tags dictionary with the appropriate values for the specified language, returns whatever the language switch was performed. Fonts Information on adding fallback fonts and updated Parttools can be found in other posts in this sub-forum. Misc Propellent.displayName = UI display of propellent.name localized. - Is looked up from Resource definition displayName field. Resource definitions now have displayName field. FlightGlobals.GetHomeBodyDisplayName() is the localized equivalent of FlightGlobals.GetHomeBodyName() Vessel & Protovessel displaylandedAt is the localized equivalent of landedAt string. Vessel.SetLandedAt() - now has two new optional input variables, the gameobject that the vessel is landed on and/or a string with the localized version of what the vessel is landed on. Fix reflected KSPModule attribute on PartModule. Added GameEvent onCommandSeatInteractionEnter which fires before a Kerbal enters/leaves external command seat. Added a mod hook in for science values. Add public accessors to MapView MapNodes for modders. Event for Kerbal name change (to match with type/status change events). Some object renames for clashes with Unity classes BaseEventData -> BaseEventDetails BaseEventDataDelegate -> BaseEventDetailsDelegate MaterialProperty -> MaterialPropertyExtensions.MaterialProperty Add public accessor to instance of tutorial dialog CustomParameterNode.LocalizedSection is a string containing the localized tag for the Difficulty settings section you want your mods settings to appear in. Added displayseatName and displayseatIndex to InternalSeat Node. These two fields can be used in combination for the seatname that appears in game. displayseatName will be localized and if displayseatIndex is present will be passed into the localization formatter as a parameter. MultiOptionDialog and PopupDialog - the methods for creating these have been changed to include new dialogName or name fields split from the window title fields. These should contain a string that will be the name of the object in Unity, which needs to be different (and not localised) from the window title string. Atmospheric and Exospheric harvesters can now make use of an optional Intake Transform (this can be set via the ‘intakeTransformName’ field. Fixed costs for Upgrade nodes being applied in TechTree. Fixed upgraded parts to now display upgraded stats in TechTree and Parts picker in VAB/SPH. Fixed upgrade modules not displaying correctly in expanded part tooltips in TechTree and Part picker. Added GameEvent onFairingsDeployed when fairings deploy. Abstract method DisplaySection for GameParameters.CustomParameterNode have been added and need to be implemented, this method returns the localized string while the previous method Section returns the non-localized string used for compatibility. KeyBindings primary and secondary have changed from KeyCode to ExtendedKey so they cannot be used in Input.GetKey, Input.GetKeyUp, Input.GetKeyDown. instead mods should use the methods GetKeyDown, GetKeyUp & GetKey of the KeyBindings class. Added IscalarModule to ModuleJettison and public Enumerator for DragCubeSystem. Added an extra parameter on the GenericAppFrame method to receive a displayName separated from the logic. PartModule.GetModuleDisplayName() should return localized version of PartModule Name which is used extensively in UI components. IModuleInfo requires implementation of GetModuleTitle() - which is the internal/English name and GetModuleDisplayName() - which is the Localized name for UI. AGENT definition nodes should include a title = xxxx field. This is the UI localized version of the name = field and can be the same or set to a localization tag. Contracts TextGen.GenerateBackStories This method generates a contract backstory that consist of 3 sentences an introduction, a problem statement and a conclusion. The values are read from a list of possible predefined sentences that are located in the StoryDefs.cfg file. The logic of this method was modified to be more simple, localization friendly and to generate more consistent backstories. The mindset and motivation parameters have been removed and 4 new parameters have been added instead: contractType: A string containing the contract type value, this is used to read a valid sentence from the config file. allowGenericIntroduction: This value specifies if the contract introduction could be a generic introduction text. allowGenericProblem: This value specifies if the contract problem could be a generic problem text. allowGenericConclusion: This value specifies if the contract conclusion could be a generic conclusion text. Each sentence is generated by the following logic: It starts by looking for the contractType value in the current section (introduction, problem, conclusion) and reads all the possible sentences for that type. Then it does the same for the subject value and reads all the possible sentences. Then it checks if generic sentences are allowed for the current section and if so it will read all the possible generic sentences for the current section. Then using a seed value it will pick a valid sentence from any of the possible values that were read before. After obtaining a valid sentence for each part those are concatenated and then the placeholder values from agency and topic are replaced with the ones supplied in the method. CelestialBody displayName is the Celestial Body name that is used in UI displays. It includes the planets Gender tag for grammar purposes. bodyName is the Celestial Body name. It will always be in English. bodyDisplayName is the localized equivalent of bodyName - With Gender theName is removed. It is now part of the displayName fields. use_The_InName bool is removed. GetDisplayName() returns the displayName. GetName() returns the bodyName. RevealDisplayName() returns the displayName. CBAttributeMapSO contains a two new fields ; localizationTag and displayname which is the localized equivalent of the name field. CBAttributeMap for Biomes has a displayName and localizationTag miniBiome array added containing MiniBiome class of minibiomes for a body. Science ResearchAndDevelopment. - GetExperimentSubject has a new optional displaybiomeID which should be localized string of the biomeID field. ResearchAndDevelopment.GetBiomeTags(CelestialBody cb, bool IncludeMiniBiomes) will return a string list of BiomeTag names for body and optionally minibiomes depending on the value of IncludeMiniBiomes. ResearchAndDevelopment.GetBiomeTagsLocalized(CelestialBody cb) will return a list of BiomeTag names for a body and minibiomes in localized text. (equivalent of GetBiomeTags method). ResearchAndDevelopment.GetMiniBiomedisplayNameByScienceID will return either a localization tag or localized string for a minibiome where a scienceID is passed in. ResearchAndDevelopment.GetMiniBiomedisplayNameByUnityTag will return either a localization tag or localized string for a minibiome where a Unity Tag is passed in. ScienceData.displaytitle is the localized equivalent of ScienceData.title All Science IDs for Experiments and Subjects retain the old format in English. That is why there are many new display* fields and methods. the display* fields are used in UIs and strings (such as science title) that appear in UIs. All Biomes and Vessel Situations - same treatment as they are used in the Science IDs and other internal processing. Science.GetBiomedisplayName returns localized string for a biome (including minibiomes). Science.GetExperimentBodyName will return the BodyName from a science subjectID. The Vessel.landedAt field is usually populated with either the KSC Biome name or the regular Biome names by science experiments when conducted. This still occurs, but the Vessel.displaylandedAt field will be populated with a MiniBiome localization tag field if one is found in contact with the vessel (when landed). Getting the experiment biome. ScienceUtil.GetExperimentBiiome now has optional displayBiome string. You can specify null and the displayBiome will be set to the English-only biome name string. If you want to Localize then the correct process is to get both the biome name and displayBiome name (localized) strings. To do this get the vessel biome name via the Vessel.GetLandedAtString method and the display biome name via the vessel.displayLandedAt string (don’t forget to call Localizer.Format on it though!). You should always check that the landedAt string is not empty, in which case the vessel isn’t landed and you use the ScienceUtil.GetExperimentBiome and ScienceUtil.GetBiomedisplayName methods to get this information for a vessel in flight. Getting the experiment subject also can have the biome name and display biome name (Localized) and it will create subject with the english biome name (which is what the game uses internally) and the subject.title will contain the localized display biome name. If you don’t supply the localized biome name the title will just contain the English biome name.
  13. Due to the public backlash surrounding the newly designed ground launched BGM-86 Cruise Missile, it was decided by the military branch of the KSC that the prototype would be destroyed immediately and all data surrounding it wiped from the record So all the info was erased from the computers and all the schematics were shredded, every bit of information was scrubbed from existence (sometimes you can catch a whisper of 'The Missile That Shall Not Be Named' muttered under hushed voices in the halls of the KSC ... getting caught talking about it is punishable by flames and salty tears) However there was a problem ... It hadn't occurred to anyone that the missile itself needed to be destroyed so they just left it stored at the island airport and when a disgruntled KSC employee by the name of Waldo went postal, management wasn't prepared for what was in store for them ........ ........ this time it is Waldo who is looking for them! ------------------------------------------------------------ THE MISSION The 'Missile That Shall Not Be Named' prototype is at the Island airport and Waldo Kerman, with the help of his minions, is trying to activate and launch the missile at the KSC - It must be destroyed before they can hot-wire it (they're looking for a paper clip) There are 4 turrets defending the area as well as 2 mini drones on the runway with one being inoperable (needs a paper clip) Your mission is to obliterate the missile and anything that stands (or fly's) in your way (as well as any paper clips) RULES - 2 crafts allowed with no cost restrictions Craft #1 - 70 parts Max (must be Kerbaled) Craft #2 - 50 parts max (can be a drone or Kerbaled) - Altitude settings must remain at default (1500 and 500 respectfully) ... All other settings can be changed - No Turrets of any kind - You must have a Weapon Manager and an AI Pilot which are toggled to hotkey '1' (Toggle Guard Mode and Toggle AI Pilot respectively) - Your craft is designated as Team A - YOUR CRAFTS MUST BE ABLE TO LAUNCH AND ATTAIN STABLE FLIGHT UNDER AI CONTROL - You must upload your crafts to the 'It's Waldo's Island' hangar on KerbalX ... https://kerbalx.com/hangars/11010 Mods Allowed: BDAc - https://github.com/PapaJoesSoup/BDArmory/releases BDMk22 - https://github.com/PapaJoesSoup/BDMk22Plugin/releases I will record and post video's of each challenger from launch to beautiful disaster on YouTube for all to revel in the glorious destructive ability of BDAc HALL OF FAME 1- TBA - THIS COULD BE YOU 2- TBA - THIS COULD BE YOU 3- TBA - THIS COULD BE YOU 4- TBA - THIS COULD BE YOU 5- TBA - THIS COULD BE YOU
  14. Hello everyone! I have a request from the devs to find saves and craft that will really put KSP through its paces, so they can narrow down on the best places to focus on optimisation. And as we want to make KSP the best it can be for you, the players, it stands to reason to use saves and ships that you girls and guys use in KSP. So what better way could there be than to make this a challenge to the community? The challenge is simple, submit a craft or a save file that stresses the stock game in some way and tell us about it, high part count vessels is an obvious one but we're also looking to stress other areas, such as... Mining Resource transfer Physics Thermals Docking Vessel count Cluttered saves And anything you can think of really, if you can slow the game down or grind it to a halt in novel ways we want to hear from you! The 'winner' and runner up's are whoever posts a file that causes the devs game the most stress, and will be immortalized here on the challenge leaderboard. Leaderboard @DoctorDavinci @Cunjo Carl @Monsterlunch @Castille7 @Sharpy Well done guys!
  15. General: Unity Engine has been upgraded to 5.4.0p4 - This is a patch version. Go to the Unity site and "get Unity" then go to the patch releases page. KSPUtil.dll has been merged into Assembly-CSharp.dll - change references in your Project. A LOT of redudant classes that were not being used any more have been removed. KSP now uses 9.80665 and 6.67408e-11 instead of 9.81 and 6.674e-11 for gravity equations. KSPedia and asset bundles generation still has to be built in Unity 5.2.4 editor. GameEvents: Changed: onCrewTransferPartListCreated Now contains a HostedFromToAction. The Host is the Source part the transfer is initiating from. New: onCrewTransferFullPartSelected Fires on a crew transfer when User selects a FullPart as the destination part BEFORE the ScreenMessage is posted. Allows mod to customise the CrewTransfer.fullMessage. onAttemptTransfer Fires when the user clicks the Transfer Crew button. You can then set the CrewHatchController.overrideTransfer to false and the stock transfer will stop there. Allowing a mod to completely control their own crew transfer. onAttemptEva Fires when the user clicks the EVA button. You can then set the FlightEVA.overrideEVA to false and the EVAr will stop there. Allowing a mod to completely control or block EVAs. onItemTransferStarted Fires when a PartItemTransfer is commenced. (see info on this class below). onVesselPartCountChanged Fires any time a part is added or removed, the moment it happens, unlike onVesselModified. onVesselStandardModification Collects various vessel events and fires them off with a single one. Specifically - onPartAttach,onPartRemove,onPartCouple,onPartDie,onPartUndock,onVesselWasModified,onVesselPartCountChanged onPartPriorityChanged Fires whenever a parts priority (staging, etc) are changed. onPartCrossfeedStateChange Fires whenever a parts crossfeed state changes. onPartFuelLookupStateChange Fires whenever fuelline states change. onScreenResolutionModified Fires when the screen resolution is modified. onCustomWaypointSave Fires whenever a custom waypoint is created/saved. onCustomWaypointLoad Fires whenever a custom waypoint is loaded. onEditorSetBackup Fires whenever events cause the undo logic to save in the editor. onEditorPodPicked Fires after a Pod is actually added to the vessel in the Editor. onEditorNewShipDialogDismiss Fires when the user dismisses the “do you want to save this new ship” dialog in the Editor. OnNetworkInitialized Called when the CommNet is Initialised at startup. OnNetworkCreated Fired when the node network initializes - can take a few frames OnVesselCommChange Called when KerbNet vessel changes onOverG When the Gforces on vessel exceed a parts gTolerance this event will fire. (per part). onPartLadderEnter Fired when a kerbal grabs a ladder attached to a part onPartLadderExit Fired when a kerbal leaves a ladder attached to a part onVesselPrecalcAssign Fires right before a vessel's VesselPrecalculate component is added so something else can add a different one onPhysicsEaseStart Fires when the VesselPrecalculate component engages physics easing. onPhysicsEaseStop Fires when the VesselPrecalculate component ends physics easing. OnOrbitalSurveyCompleted Fires when an orbital survey is completed. onKerbalLevelUp Fires when a Kerbal is levelled up. OnEfficiencyChange Fires when Resource Converter Efficiency changes. OnOverPressure When the Pressure on vessel exceed a parts maxPressure this event will fire. (per part). onKerbalActiveChange Fires when a kerbals active/inactive state changes. (Unconscious) Game Parameters: New Game Parameters Highlogic.CurrentGame.Parameters.CustomParams<GameParameters.DifficultyParams>().EnableCommNet - True/False Commnet can be turned Off or On. Highlogic.CurrentGame.Parameters.CustomParams<GameParameters.DifficultyParams>().RespawnTimer - This is the Kerbal Respawn period. Is initially set to GameSettings.DEFAULT_KERBAL_RESPAWN_TIMER but user can change it for each save game. Mods should look to use this parameter for kerbal respawn. Highlogic.CurrentGame.Parameters.CustomParams<GameParameters.AdvancedParams>().EnableKerbalExperience - If this is off all kerbals start with maximum experience. If on then kerbals gain experience over time and gain that experience on recovery or immediately depending on the value of ImmediateLevelUp. Highlogic.CurrentGame.Parameters..CustomParams<GameParameters.AdvancedParams>().ImmediateLevelUp - Applies experience immediately and kerbals level up immediately instead of when they are recovered. Highlogic.CurrentGame.Parameters..CustomParams<GameParameters.AdvancedParams>().AllowNegativeFunds - If on Career games can go into negative funds. Highlogic.CurrentGame.Parameters..CustomParams<GameParameters.AdvancedParams>().AllowNegativeScience - If on science and career games can go into negative science. Highlogic.CurrentGame.Parameters.CustomParams<GameParameters.AdvancedParams>().BuildingImpactDamageMult - A multiplier applied to and building damage. Highlogic.CurrentGame.Parameters.CustomParams<GameParameters.AdvancedParams>().IResourceTransferObeyCrossfeed - If enabled prevents manual resource transfers across parts where crossfeed has been disabled. HighLogic.CurrentGame.Parameters.CustomParams<CommNetParams>().DSNModifier - Multiplier applied to the size of the DSN. (default = 1). HighLogic.CurrentGame.Parameters.CustomParams<CommNetParams>().occlusionMultiplier - Multiplier applied to the effective size of objects that can occlude antennas. (default 0.9f). HighLogic.CurrentGame.Parameters.CustomParams<CommNetParams>().rangeModifier - Modifier added to the effective range of antenna. (Default = 1). HighLogic.CurrentGame.Parameters.CustomParams<CommNetParams>().requireSignalForControl - If true ModuleCommand requires a connection (or crew) to have control or partial control of the vessel. (Used by all ModuleCommand parts). HighLogic.CurrentGame.Parameters.CustomParams<GameParameters.AdvancedParams>().PartUpgradesInSandbox - If true allows Part upgrades in Sandbox mode. Other notes: Do not call FlightGlobals.SetActiveVessel from inside OnGUI code against an unloaded vessel or it will cause Unity to crash to desktop. If you need logic in OnGUI for this, store the switch/vessel in a static and call SetActiveVessel in next Update cycle. KSPAddon now supports the following: KSPAddon.Startup.AllGameScenes, KSPAddon.Startup.FlightAndEditor, KSPAddon.Startup.FlightAndKSC Having a const field defined on a PartModule is now supported. Support for custom Mod TechTree Icons and loading of TechTree added. In the TechTree.cfg just specify a GameData relative path to the Icon you want. Mods can now use the Stock Game Difficulty Settings Menus through extensions for New Games and the In-Game Settings Menus. For more details see the “Mod Integration into Stock Settings section below”. Vessel now has a Vessel.resourcePartSet which uses the PartSet class. For more Details see the “PartSet Class” section below. There is now a FlightGlobals.VesselsLoaded and FlightGlobals.VesselsUnloaded which lets us iterate over a specific portion of Vessels without checking the entire list. 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). There is a public get accessor:- Vessel.CurrentControlLevel which will return one of Vessel.ControlLevel's values. 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). DictionaryValueList<TKey, TValue> can be used to store TKey, TValue dictionary also supplies an updated TValue List. ListDictionary : ICollection, IDictionary, IEnumerable. An IDictionary using a singly linked list. Recommended for collections that typically contain 10 items or less. Celestial bodies now cache all of their PQS Cities. PQSCity[] CelestialBody.pqsCities. GetAtmoThermalStats, GetAtmoSolarStats, GetFullTemperature(pos) and GetFullTemperature(alt, atmoTempOffset) have been moved from FlightIntegrator to CelestialBody. All game root nodes now generate a random persistent seed, which is different from game to game. HighLogic.CurrentGame.Seed. Is used by stock for chances to see anomolies in KerbNet, but mods can use it for other random number seed generation. 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). You must convert from rb.addforce!! Inverse rot thresh is clamped to be >= atmo depth. The CBs bodyPosition is passed on to PQS as 'precisePosition'. All PQSSurfaceObjects are tracked (PQSCity derives from that now) - that array is set in Start. The CBs recip of the rotation period is cached. There are more and faster lat/long/alt methods. 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). Node definitions can take an extra digit after size, either 0 or 1: that sets whether the node can crossfeed. Defaults to 1 (yes). 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 only request 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. ModuleEngines now supports Real Fuels-style throttling and rates. ModuleEngines now supports throttle-Isp interactions. Turn on with useThrottleIspCurve = True and set the throttleIspCurve and throttleIspCurveAtmStrength curves. throttleMin is set by minThrust/maxThrust 0 throttle = 0 thrust, else it lerps between minThrust and maxThrust throttlingBaseDivisor should be set to 1 for RF engines, 0.2 is for the 5x-as-heavy stock ones. Final Isp = input Isp * Lerp(1, throttleIspCurve.Eval(throttle state), throttleIspCurveAtmStrength.Eval(atms of pressure)). Allow kerbals to have/save/load arbitrary experience points. ProtoCrewMember.ExtraExperience can be used to record Additional arbitrary experience points for a kerbal (automatically added to the kerbals experience and Level). Replaced all checks for experience traits (Pilot, Scientist, Engineer) with individual experience effects. ModuleExperienceManagement partmodule added - Is configured to the MPL (Science Lab) but can be added to any part. Allows recording of experience/flight logs without having to return crew to Kerbin. ResearchAndDevelopment.GetTechnologyTitle(string id) will convert a tech ID to a tech title. Support max pressure (dynamic + static), `maxPressure`, and max G, `gTolerance`, for parts. Added CelestialBody.hasSolidSurface so mods that add a PQSController to gas giant don't cause silly things such as "Plant a flag on Jool" contracts. Added CelestialBody.minOrbitalDistance - this is set in CB Setup to be the minimum safe orbital radius. Added CelestialBody.scaledEllipsoid - can use this horizon culling for occlusion. Added CelestialBody.scaledElipRadMult - the ellipsoid axes. Added CelestialBody.scaledRadiusHorizonMultiplier - mult to radius. I.e. Kerbin has 0.72 or so due to bouncing off atmosphere 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. AssemblyDependancy has been fixed and new KSPAssemblyDependencyEqualMajor added. 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). NOTE: (This is old but still true): Vessel.obt_velocity and .srf_velocity and the spd versions are not valid in FixedUpdate unless on rails. This is because they are based off what the orbit is estimated to be after PhysX integration runs (i.e. after all FixedUpdates run). 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 an event is fired 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 (see also new GameEvents). KerbalRoster.ExperienceConfig is now GameDatabase.Instance.ExperienceConfigs There is a new PartItemTransfer abstract class that is applied to CrewTransfer (previous point), and ExperimentTransfer (ModuleScienceExperiment and ModuleScienceContainer). For more information see the PartItemTransfer Class section below. Extended ModuleScienceContainer to send and, from (from ModuleScienceExperiment) receive, experiment data. ModuleDeployableSolarPanel.panelStates has moved to ModuleDeployablePart.DeployState. ModuleDeployableSolarPanel now inherits ModuleDeployablePart. You can now delete Editor Custom Part Filters. KSP.UI.Screens.PartCategorizer.DeleteCategory() and DeleteSubcategory() are now public. You can now access the SelectedVessel and SetVessel method in the TrackingStation. KSP.UI.Screens.SpaceTracking.SelectedVessel and KSP.UI.Screens.SpaceTracking.SetVessel. New PartModule ModuleColorChanger - effectively split off from ModuleAblator. Allows you to animate a shader on a part eg: emissive, lights, ablator, whatever you can think of. For more details see the “Module ColorChange” section below. PartModules now support upgrades. (see the ”Partmodule Upgrades” section below). New module ModuleRCSFX is available inverseStageCarryover - new field added to part config files (true by default). Governs whether a parts inverseStage should carry over to child parts. Disabled on all fairings. vessel.EVALadderVessel - returns the vessel of the part of the ladder the kerbal is on, or just vessel (if non kerbal, no ladder, non ladder-on-part-on-vessel). That's beyond kerbalEVA.LadderPart, which returns the part of the ladder the kerbal is on, or null. It can be used when say, you want the correct situation (i.e. if a kerbal is on a ladder, use the ladder vessel's SITUATION, otherwise use the actual vessel's). All Methods and properties in ModuleDataTransmitter have been made virtual. All Methods in VesselPrecalculate have been made virtual. InputLockManager now has IsAllLocked() and IsAnyUnlocked() VesselModule now has a public reference to the actual Vessel KerbalEVA, Kerbal, and KerbalExpressionSystem are now all virtuals and PCM.Spawn is now a static delegate (and so can be replaced) FlightEVA pulls from the PartLoader's part list so EVA kerbals can be replaced AssemblyLoader now ignores abstract classes. Added 'requiresFullControl' as an option to UI_Controls, actions, and events. Apply it to the thrust limiter on engines so it cannot be changed when only in partial control. GLimits can now be applied to crew and they can go inactive for periods of time. See ProtoCrewMember.outDueToG/setInactive. When Inactive they affect vessel control and are excluded from EVA and Crew Transfer processing. Add missing add and remove methods to PartResourceList, add event which fires when the list changes. VesselType enum now includes Plane and Relay as a valid vessel type. Public interface IJointLockState. Mods that allow free joint between parts (IR mostly) should implement it on their module so the autostruts don't lock the joint with struts. If you want to check the result there is a "Visualize Autostruts" options in the Physics tab of the console. You can add new display mode to the KerbNet by creating subclass of KerbNetMode and they will be automatically loaded. IContractObjectiveModule interface added to Contracts. Part.highlighter changes. See Part.Highlight/HighlightRecursive/SetHighlight/SetHighlightColor/SetHighlightDefault/SetHighlightType. See also Highlighter and HighLightingSystem classes. VesselType enum now has new values for Plane and Relay ExperimentResultDialogPage has changed and ScienceData. ScienceData.transmitValue is now ScienceData.baseTransmitValue ScienceData.labBoost is now derived from ScienceData.transmitBonus which is also used for CommNet transmit boost/bonus. ExperimentResultDialogPage is now based on the above two values. PartLoader's behaviour has changed. Do not use PartLoader.parts, use Partloader.LoadedPartsList. The three pre-built Part Modules are now available to be modified (FlagSite, KerbalEVA, kerbalEVAfemale). The are located in \GameData\Squad\Parts\Prebuilt. So you can modify using Module Manager config files instead of via code (as was the only way to do this in previous versions). ProtoPartResourceSnapshot.resourceValues is now protected. If you want to read/write packed resources for a ProtoPart use ProtoPartResourceSnapshot.amount which is no a public get/set. Resource handler is now part of the base PartModule. Vessel contains a number of new accessors and counters around Crew. Vessel.crewableParts is the count of parts that can contain crew. Vessel.crewedParts is the count of parts that actually do contain crew. Vessel.GetCrewCount() is the count of crew onboard the vessel. Vessel.getVesselCrew() returns a list of crew onboard the vessel. Vessel.CrewListSetDirty() will set the cached crew list as dirty forcing it to be rebuilt. Vessel.CrewWasModified(vessel) will force the crewlist to be rebuild and fire GameEvents.onVesselCrewWasModified. Vessel.CrewWasModified(vessel, vessel) will do the same as previous but for two vessels passed in. The vesselCrew and crewedParts, crewableParts counts are also stored in the protoVessel when a vessel is unloaded. Staging fields are now part of the base PartModule class. You can set them as part of the PartModule node in the part config file. bool stagingEnabled - indicates if staging is enabled for a part. stagingEnableText is a text string you can set that will appear in the PAW (Part Action Window). bool stagingToggleEnabledEditor if true allows the user to toggle staging for a part in the editor. bool stagingToggleEnabledFlight if true allows the user to toggle staging for a part in flight. PartModule Upgrades: PartModules now support upgrades. Upgrades are unlocked via the Tech Tree in career mode and Use the entryCost field. PartModule PartStatsUpgradeModule is used to upgrade PART node stats. PartModule.showUpgradesInModuleInfo is a new KSPField bool. If true Upgrade information will be compiled into the PartInfo and shown where applicable. An UPGRADES node can be added to a PartModule Node to upgrade stats within a PartModule. Multiple UPGRADE nodes are specified within the UPGRADES node to upgrade stats. A PARTUPGRADE node is added which is us ed for displaying the Icons and tooltips in the TechTree. The PartUpgradeManager ScenarioModule handles the Upgrading. Mods can Interface to this to modify the stock upgrade behaviour and extend. UPGRADE nodes can now have ExclusiveWith__ = [some string] This means you can chain upgrades. Only the last found upgrade of the given string is applied. PartStatsUpgradeModule can now specify mass = [amount] and/or cost = [amount] for an UPGRADE node to specify specific mass or cost to an upgrade. You can also alternatively specify massAdd = [amount] and/or costAdd = [amount] for an UPGRADE node to additively add mass or cost to the previous values. An Example is easier, this MM file will update the LVT45 maxThrust on the ModuleEngines and maxTemp on the part at GeneralRocketry and AdvRocketry. Note the "IsAdditiveUpgrade__" field. This field tells the PartModule Load to add the UPGRADE nodes additive. If it is false the nodes will overwrite each other this is only applicable to the PartStatsUpgradeModule. @PART[liquidEngine2] { @MODULE[ModuleEngines] { showUpgradesInModuleInfo = true UPGRADES { UPGRADE { name__ = LVT45-GenRocketry-Thrust techRequired__ = generalRocketry maxThrust = 400 } UPGRADE { name__ = LVT45-AdvRocketry-Thrust techRequired__ = advRocketry maxThrust = 900 } } } MODULE { name = PartStatsUpgradeModule showUpgradesInModuleInfo = true UPGRADES { UPGRADE { name__ = LVT45-GenRocketry-Thrust techRequired__ = generalRocketry IsAdditiveUpgrade__ = True PartStats { maxTemp = 2500 } } UPGRADE { name__ = LVT45-AdvRocketry-Thrust techRequired__ = advRocketry IsAdditiveUpgrade__ = True PartStats { maxTemp = 2900 } } } } } PARTUPGRADE { name = LVT45-GenRocketry-Thrust partIcon = liquidEngine2 techRequired = generalRocketry entryCost = 10000 title = LV-T45 Thrust Upgrade description = The LV-T45 engine now generates 400 kN of thrust and has a max temp of 2500. } PARTUPGRADE { name = LVT45-AdvRocketry-Thrust partIcon = liquidEngine2 techRequired = advRocketry entryCost = 50000 title = LV-T45 Thrust Upgrade description = The LV-T45 engine now generates 900 kN of thrust and has a max temp of 2900. } PartSet Class: Vessels now have a Vessel.resourcePartSet which uses the PartSet class. PartResource is no longer derived from MonoBehaviour, PartResources are built as part of the PartSet for a vessel. Public static in _id is the current counter for the number of Partsets. Public static int NextID - will return the next _id. Public int setId - is the globally valid ID for this set. Interfaces: public virtual void GetConnectedResourceTotals(int id, out double amount, out double maxAmount, bool pulling) public virtual void GetConnectedResourceTotals(int id, out double amount, out double maxAmount, double threshold, bool pulling) The above two methods will return the amount and maxamount of the passed in resource(id) in the partset. Set pulling true if you want to get how much of the resource is actually stored, set pulling false if you want to know how much capacity is available (push) - amount and maxamount will return the amounts of free capacity there is, not how much of the resource is actually stored). The second method obeys threshold amount. public virtual void GetConnectedResourceTotals(int id, out double amount, out double maxAmount, bool pulling) public virtual void GetConnectedResourceTotals(int id, out double amount, out double maxAmount, double threshold, bool pulling) This method replaces the old RequestResource mechanic, and is called by Part.RequestResource. public virtual double RequestResource(Part part, int id, double demand, bool usePri) usePri - if true, will request resource with respect to the priority set, If false will request resource from all parts regardless of priority. Accessors: public bool ContainsPart(Part p) - returns true if partset contains a part. public HashSet<Part> GetParts() - returns the set of parts or a new one if set contains none. public bool SetsEqual(HashSet<Part> set) - will do a compare on the passed in set with this set and return true if they contain the same parts or false if they do not. Constructors: public PartSet(HashSet<Part> parts) - Creates a PartSet that is passed in. (not vessel wide) that will be hooked into GameEvents.onPartResourceFlowStateChange & GameEvents.onPartResourceFlowModeChange. So when these events fire the PartSet will automatically be updated. public PartSet(Vessel v) - same as the previous, but this is a Vessel wide PartSet. public PartSet(PartSet set) - Makes a copy of a PartSet. public virtual void RebuildVessel(Vessel newVessel) - will recreate PartSet vessel wide. public virtual void RebuildParts(HashSet<Part> newParts) - Rebuilds a PartSet as a crossfeed set. public static void BuildPartSets(List<Part> parts, Vessel v) - Builds the PartSet for a list of parts (say in the editor) or for the entire Vessel if v is not null. public static void AddPartToSet(HashSet<Part> set, Part p, Vessel v) - Recursively add a part to a set, if not in the editor it will also check the vessel for p matches v. Also obeys fuel crossfeed rules. PartItemTransfer Class: PartItemTransfer is a new Abstract class attached to CrewTransfer and ExperimentTransfer. CrewTransfer is tied to the CrewHatchController ExperimentTransfer is tied to the ModuleScienceExperiment and ModuleScienceContainer TransferDataEvent's. You can now hook into CrewTransfer and override the following: bool IsValidPart(Part p) bool IsSemiValidPart(Part p) HookAdditionalEvents() UnhookAdditionalEvents() AfterPartsFound() OnPartSelect(Part p) You can now hook into ExperimentTransfer and override the following: bool IsValidPart(Part p) bool IsSemiValidPart(Part p) OnSrcPartSelect(Part p) OnPartSelect(Part p) Mod integration into Stock Settings: From V1.2 there is an ability to integrate your mod into the Stock New Game and In-Game Settings Menus. The class is: GameParameters.CustomParameterNode You can add a class to your mod derived from this type. It will automatically appear in the new game and in-game settings menus based on parameters you set. Data is automatically persisted for you into a ConfigNode under the PARAMETERS config node in the save file. The fields in this class of interest are, you must define public get accessors for these: string Title - The title that will appear at the top of your settings section. string Section - This defines the Tab Name/Section your settings will appear in (name of the table). int SectionOrder - This defines the Order within the Tab for this CustomParameterNode (order within the tab, if you have multiple columns). GameParameters.GameMode GameMode - The gamemodes your settings will appear for. HasPresets - If you have preset values for the difficulty settings (more below) There are Four Virtual Methods: void SetDifficultyPreset(GameParameters.Preset preset) - Can be overridden to set the various parameters based on the Difficulty button the user presses at the top of the settings window. bool Interactible(MemberInfo member, GameParameters parameters) - Can be overridden to set the various fields to be Interactible or not based on whatever conditions you want to set. Interactible means the field can be set/changed by the user or not. bool Enabled(MemberInfo member, GameParameters parameters) - Can be overridden to set the various fields to be Enabled or not based on whatever conditions you want to set. Enabled means the field will be Visible in the UI or not. IList ValidValues(MemberInfo member) UI Fields The following Class Types can be assigned to Variables in the CustomParameterNode:- CustomFloatParameterUI - Define a type Float UI parameter. CustomIntParameterUI - Define a type Int UI parameter. CustomStringParameterUI - Define a type String UI parameter. - This is NOT an input parameter but a String that you can define that will be displayed in the UI. It has a special Field public int lines = 1; which you can set to the number of Lines you want the string to be in the UI. Note: any string you assign to this field will NOT auto-wrap but you can insert "\n" returns into the string. They all inherit Type CustomParameterUI (more below) and have the following public fields:- public float minValue - Set the minimum value for the Input field. public float maxValue = 1f - Set the maximum value for the Input field. public float stepSize = 1f - Set the Step size for the UI slider for the field. (Except for CustomFloatParameterUI) Public int stepCount = 11; - The Step count for the slider. (CustomFloatParameterUI only) Public float logBase; - Log base value for calculating the slider step.(CustomFloatParameterUI only) public string displayFormat = "N0" - Set the Display format for the field in the UI. public bool asPercentage - If true field is displayed/calculated as a percentage. CustomParameterNode is inherited by the above UI paramater types and also can handle two other types:- Enum and IList (more to follow below). It contains the following public fields that you can set on any of the UI parameters:- public string title; - This is the Title String that can override/appear in the UI above the field input. this field is Truncated based on the UI size. This is a limitation that cannot be changed. public string toolTip; - Set this to a string and a tooltip will automatically be provided for your field. public GameParameters.GameMode gameMode = GameParameters.GameMode.ANY; - Set this to the gamemodes you want this field to appear for. public bool newGameOnly; - If set to true only appears in the new game settings menu and won't appear in the in-game settings menu. If false it will appear in both. public bool autoPersistance = true; - Set to false if you don't want this field persisted in the PARAMETERS config node in the save file. Enum type field You can define Enum types to a CustomParameterUI. First define an Enum somewhere and use it's type for a CustomParameterUI. (See MyEnum in the example below). ILIST type field You can define a List to a CustomParameterUI. (See the Example below) How to access your settings fields You can access your fields by doing :- HighLogic.CurrentGame.Parameters.CustomParams<TestCustomParams>().MyBool (or whatever field) Depending on how your mod operates you may also want to register for the GameEvents:- GameEvents.onGameStatePostLoad GameEvents.OnGameSettingsApplied GameEvents.onGameStateLoad etc An Example: using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using UnityEngine; namespace TestCustomSettings { public class TestCustomParams : GameParameters.CustomParameterNode { public enum SomeEnum { EASY, MEDIUM, HARD, } public override string Title { get { return "My Cool Mod's Options"; } } public override GameParameters.GameMode GameMode { get { return GameParameters.GameMode.ANY; } } public override string Section { get { return "MyCoolMod"; } } public override int SectionOrder { get { return 1; } } public override bool HasPresets { get { return true; } } [GameParameters.CustomParameterUI("My Boolean - Mod Enabled?", toolTip = "test bool tooltip")] public bool MyBool = true; [GameParameters.CustomStringParameterUI("Test String UI", autoPersistance = true, lines = 2, title = "This is what should show Test string#1", toolTip = "test string tooltip")] public string UIstring = ""; [GameParameters.CustomFloatParameterUI("My Float", minValue = 0.0f, maxValue = 50.0f)] public double MyFloat = 1.0f; [GameParameters.CustomIntParameterUI("My Integer", maxValue = 10)] public int MyInt = 1; [GameParameters.CustomIntParameterUI("My Non-Sandbox Integer", gameMode = GameParameters.GameMode.CAREER | GameParameters.GameMode.SCIENCE)] public int MyCareerInt = 1; [GameParameters.CustomIntParameterUI("My New Game Integer", newGameOnly = true)] public int MyNewGameInt = 1; [GameParameters.CustomFloatParameterUI("My Percentage", asPercentage = true)] public double MyPercentage = 0.5f; [GameParameters.CustomIntParameterUI("My Stepped Integer", maxValue = 500000, stepSize = 1000)] public int MySteppedInt = 1000; [GameParameters.CustomParameterUI("My Enum")] public SomeEnum MyEnum = SomeEnum.MEDIUM; [GameParameters.CustomIntParameterUI("My Int Property", minValue = 100, maxValue = 500)] public int MyProperty { get { return myPropertyBackingField; } set { myPropertyBackingField = value; } } private int myPropertyBackingField = 100; [GameParameters.CustomParameterUI("My IList Field", toolTip = "ILIST field values")] public string MyIlist = ""; public override void SetDifficultyPreset(GameParameters.Preset preset) { Debug.Log("Setting difficulty preset"); switch (preset) { case GameParameters.Preset.Easy: MyInt = 1; break; case GameParameters.Preset.Normal: MyInt = 2; break; case GameParameters.Preset.Moderate: MyInt = 3; break; case GameParameters.Preset.Hard: MyInt = 4; break; } } public override bool Enabled(MemberInfo member, GameParameters parameters) { if (member.Name == "MyBool") //This Field must always be enabled. return true; if (MyBool == false) //Otherwise it depends on the value of MyBool if it's false return false { if (member.Name == "UIstring" || member.Name == "MyFloat") // Example these fields are Enabled (visible) all the time. return true; return false; } return true; //otherwise return true } public override bool Interactible(MemberInfo member, GameParameters parameters) { if (member.Name == "MyBool") //This Field must always be Interactible. return true; if (MyBool == false) //Otherwise it depends on the value of MyBool if it's false return false return false; return true; //otherwise return true } public override IList ValidValues(MemberInfo member) { if (member.Name == "MyIlist") { List<string> myList = new List<string>(); foreach (CelestialBody cb in FlightGlobals.Bodies) { myList.Add(cb.name); } IList myIlist = myList; return myIlist; } else { return null; } } } } New Game Settings: ModuleColorChanger & ModuleAnimationSetter: ModuleColorChanger is an IScalarModule, and also has an animation version of it, ModuleAnimationSetter public string moduleID = "colorChanger" public string shaderProperty = "" public int shaderPropertyInt public FloatCurve redCurve; - Define a Red floatcurve. public FloatCurve greenCurve; - Define a Green floatcurve. public FloatCurve blueCurve; - Define a Blue floatcurve. public FloatCurve alphaCurve; - Define the alpha floatcurve. public float animRate = 1f; - The speed at which the floatcurve is applied to the colors. Is multiplied by the flixeddeltatime. public bool animState = false; - false = 0 (normalized value) applied to the colors. True = 1. public bool useRate = true; - True will automatically apply the color floatcurve public bool toggleInEditor = true; - Action button to toggle the animation available in the editor public bool toggleInFlight = true; - Action button to toggle the animation available in flight public bool toggleUnfocused = false; - GUI action is available when unfocused public bool toggleAction = false; - Action is set to active or not. public float unfocusedRange = 5f; - The unfocused range. public string toggleName = "Toggle Color"; - Will appear on the Action Button public string eventOnName - Will appear on the Action Button public string eventOffName - Will appear on the Action Button Interfaces: public void SetState(bool val) - Set the rgba values to normalized value 0 (if you pass in false) or 1 (if you pass in true). public void SetState(float val) - Will set the rgba to the normalized value along the floatcurves based on the value passed in. public void SetState(Color val) - Pass in a Color and the rgba values will be set to the passed in color.
  16. The PartTools package is a set of utilities used by modders to import 3D models into KSP. PartTools have been updated for KSP 1.1 and can be downloaded here.
  • Create New...