This guide helps you make a mod for Kerbal Space Program 2. Souviens-toi, Programme spatial Kerbal 2 ne’t officially endorse modding. D'abord, install BepInEx + SpaceWarp to enable mods in the game.
Modding Text Assets
Modding text assets lets us tweak part stats, create or edit missions, and modify the tech tree in Kerbal Space Program 2. Anything mentioned in a text asset can be altered, and new ones can be added using Patch Manager.
To start a text assets mod, download and install Patch Manager and its dependencies. Suivant, create a new folder within
../Kerbal Space Program 2/BepInEx/plugins/
using your mod’s title as the folder name.
Si vous le pouvez’t locate the Kerbal Space Program 2 dossier, right-click the game in the Steam library, then choose Manage -> Parcourir les fichiers locaux. A patch file is simply a text file renamed to the .patch file extension, so create a new one in the mod folder.
Sous Windows, simply right-click inside the folder and choose New -> Text Document.
Que’c'est tout! Maintenant, we can begin customizing the patch. Lancez le jeu, go to Settings -> Mods, et activer « Always Invalidate Cache » for Patch Manager. This ensures it updates every time the game starts.
Accédez à
../Kerbal Space Program 2/BepInEx/plugins/PatchManager/cache/
to view all the changed text assets and confirm that patches worked as intended.
For additional insights, check the BepInEx log file, which includes output from Patch Manager. If there are errors, this log file, located at
../Kerbal Space Program 2/BepInEx/LogOutput.log
can help you understand what went wrong.
Viewing Text Assets (Simple)
The simplest way to view text assets is to have Patch Manager generate them in its cache. Pour faire ça, laisser’s create a basic patch to understand the fundamentals.
:parties { test: 1; }
This patch goes through all the parts, adds a test field, and sets the value to 1. Pendant qu'il’s a patch with no practical impact in the game, Patch Manager finds it helpful, especially for beginners in rocket science.
Save this in the patch file and lancer le jeu. Patch Manager should then execute approximately 400 correctifs, one for each part. After quitting the game, navigate to the cache to find a list of all the part text assets.
For other text asset types, generate the cache by adding the same inconsequential patch:
:missions { test: 1; } :science { test: 1; } :ressources { test: 1; } :expériences { test: 1; }
Viewing Text Assets (Avancé)
All game assets, including text, modèles, and images, are stored in Unity Asset Bundles. To inspect these bundles, a separate program is needed. This guide will use Asset Studio for this purpose.
Télécharger Asset Studio from the releases page, unzip the file, and run AssetStudioModGUI.exe. In the program’l'interface utilisateur, go to File -> Open Folder, and navigate to the game assets directory inside
../Kerbal Space Program 2/KSP2_x64_Data/StreamingAssets/aa/StandaloneWindows64/
Note that loading assets may take some time and utilize a significant amount of your PC resources. Once all assets are loaded, go to the Asset List tab to browse. You can click the Type tab to sort by type and scroll down to the Text Asset list, as it contains the most commonly sought assets.
Text Asset Type: Parties
Parts are the most common game assets, and their text assets define their stats and modules. Each part is identified by its name, comme lab_2v_science_marine, which represents the water science part.
The text asset starts with top-level fields like « catégorie, » determining the part’s category in the VAB part list. As you scroll down, toi’ll find additional fields like « masse, » specifying the part’le poids.
Further below, you encounter part modules. Parts use modules for unique and optional functionalities. Par exemple, engine parts require an engine module to enable engine functionality. Many parts also include a color module to set their color.
Whether creating custom parts or editing existing part stats, a solid grasp of part definitions is crucial.
Text Asset Type: Missions
Missions have a straightforward text asset definition, especially when compared to parts. The mission names typically start with KSP2Mission_ – like KSP2Mission_Main_Kerbin_01, which is the first stock mission.
At the top level, a fundamental field is « État, » indicating whether the mission is active or inactive. Active missions are visible in Mission Control, while inactive ones are initially hidden.
Within mission definitions, là’s a list of stages, including at least one for the objective and one for the reward. Objectives can consist of multiple conditions that must be met simultaneously.
Further down, toi’ll find dialog lists for the briefing and debriefing.
Dernièrement, the submit action can activate other missions once the current one is completed. This feature is used to sequence missions, ensuring that a mission only appears after the one preceding it is finished.
Text Asset Type: Technologie
Tech Nodes have a straightforward text asset definition. Each tech in the tech tree starts with a name beginning with tNode_ – like tNode_1v_start representing the start technology.
The top-level fields are quite self-explanatory. Par exemple, RequiredSciencePoints determines the technology cost.
RequiredTechNodeIDs specifies any prerequisite technologies that must be unlocked before accessing this one.
The UnlockedPartsIDs list contains each part name, matching the names used in the text asset definitions for parts discussed earlier.
Dernièrement, the position field is a simple x,y coordinate value, determining the tech node’s placement on the R&D screen.
Example Patches
The Patch Manager wiki offers a syntax guide and examples to help you understand how to write patches. Examining existing mods, comme KSRe, is often a quicker way to grasp patch creation, covering parts, tech tree, missions, et plus.
Here are some introductory parts patches:
:parties {
#seat_0v_external_crew {
masse: 1.0;
}
}
This patch, starting with the :parts filter, selects all parts text assets. It then targets the seat part with the specified name and adjusts its mass to 1.0.
:parties { @if $$crewCapacity > 0 { * > Module_ReactionWheel { @delete; } } }
This patch selects parts with a crewCapacity greater than 0. It then navigates to the Reaction Wheel Module and removes it from the part.
:parties { ~#probe_* > Module_ReactionWheel > Data_ReactionWheel { PitchTorque *: 0.1; RollTorque *: 0.1; YawTorque *: 0.1; } }
This patch chooses parts whose names don’t start with probe_ (excluding stock probe cores). It goes down to the Reaction Wheel Data, adjusting the torque values by multiplying them by 0.1, reducing the reaction wheel’la force.
:parties { #booster_1v* { +Module_Gimbal { +Data_Gimbal { gimbalRange: 0.5; } } } }
This patch selects parts with names starting with booster_1v (larger stock SRBs). It adds a Gimbal Module with the gimbal range set to 0.5 inside the Data module.
C'est tout ce que nous partageons aujourd'hui pour cela Programme spatial Kerbal 2 guide. Ce guide a été initialement créé et rédigé par Karbles. Si nous ne parvenons pas à mettre à jour ce guide, vous pouvez trouver la dernière mise à jour en suivant ceci lien.