Search the Community

Showing results for tags 'official'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements
    • The Daily Kerbal
  • Kerbal Space Program 2
    • KSP 2 Discussion
  • General KSP
    • KSP Discussion
    • Suggestions & Development Discussion
    • Challenges & Mission ideas
    • The Spacecraft Exchange
    • KSP Fan Works
  • Gameplay and Technical Support
    • Gameplay Questions and Tutorials
    • Technical Support (PC, unmodded installs)
    • Technical Support (PC, modded installs)
    • Technical Support (PlayStation 4, XBox One)
  • Add-ons
    • Add-on Discussions
    • Add-on Releases
    • Add-on Development
  • Community
    • Welcome Aboard
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
  • Making History Expansion
    • Making History Missions
    • Making History Discussion
    • Making History Support
  • Breaking Ground Expansion
    • Breaking Ground Discussion
    • Breaking Ground Support
  • International
    • International
  • KerbalEDU Forums
    • KerbalEDU
    • KerbalEDU Website

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 13 results

  1. 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: 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.
  2. This is the Official API documentation. Here are the Doxygen docs for KSP 1.9.1
  3. The PartTools package is a set of utilities used by modders to import 3D models into 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.2.2f1 for KSP 1.9 to include all of these tools in one unity asset bundle. It can be downloaded here. To install: Uninstall the built-in TMPro from Unity 2019.2.2f1 - Go to Window - Package Manager. Select TMPro and uninstall it. Download "TextMesh Pro Release 1.0.56 - Unity 2017.1" from and install it Disable "Validate References" for the KSPAssedCompiler.dll and KSPAssets.dll in the "Assets/Plugins/KSPAssets" folder Import the custom bundle in the zip file into your Unity project. For information about how to build and use fonts for Localization please refer to this link. For the old Unity 2017 PartTools you can use this link: Unity 2017 Part Tools
  4. 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
  5. 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
  6. 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: 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 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.
  7. 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.
  8. 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 ]; then unzip -oq 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 ]; then unzip -oq 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
  9. 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 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.
  10. 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 ... Mods Allowed: BDAc - BDMk22 - 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
  11. 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!
  12. 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, 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(; } 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.
  13. 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.