Configuring the core part data: Difference between revisions

From KSP 2 Modding Wiki
m (Munix moved page Configuring the mesh to Configuring the core part data: misleading title)
Line 132: Line 132:
#* [[Configuring a docking port|Docking Port configuration]]
#* [[Configuring a docking port|Docking Port configuration]]
# Apply Options: select the root part and in the Inspector window near the top on the Prefab line, click the Overrides dropdown and choose “Apply All”. If this option is not available, then you’ve got nothing you need to do here. Move along, move along.
# Apply Options: select the root part and in the Inspector window near the top on the Prefab line, click the Overrides dropdown and choose “Apply All”. If this option is not available, then you’ve got nothing you need to do here. Move along, move along.
# Save JSON: at the bottom of the “Core Part Data” panel, click on “Save Part JSON”.
# Save JSON: at the bottom of the “Core Part Data” panel, click on “Save Part JSON”. Note
# Generate prefab: move the root object to the Asset folder in the project window. This generates a prefab.
# Generate prefab: move the root object to the Asset folder in the project window. This generates a prefab.
'''Note: It is important to remember that whenever you make any changes to the prefab or its components, you will need to re-apply the overrides (step 3) and save the updated JSON file (step 4).'''
[[Category:Creating parts|<nowiki>[[Category:Tutorials]]</nowiki>]]
[[Category:Creating parts|<nowiki>[[Category:Tutorials]]</nowiki>]]
[[Category:Creating parts]]
[[Category:Creating parts]]

Revision as of 14:19, 13 January 2024

Configuring the core part data in Unity

This part will have to be repeated for each mesh of your mod.

Important
The prefab must be updated after adding a component.
In the Inspector panel: Prefab > Overrides > Apply all.
You also have to re-generate the JSON.

General configuration

  1. Add Code Part Data: click on the root object myMod_myPart > “Add Component” > “Code Part Data”.
  2. If this option is not available, right-click on the KSP2 package > Reimport.
  3. Fill in the form.

Meta Data

Field name Value/comment
Part Name It has to be the same thing as the root game object: myMod_myPart
Author Your modder name

Descriptors

Field name Value/comment
Category See List of categories/families
Family See List of categories/families
Size Category Choose a size

(no name)

Field name Value/comment
Tags Keywords allowing you to find the part in the VAB search (eg: "Apollo")

Properties

Field name Value/comment
Fuel Cross Feed Check it to allow the propellants to pass through the part
Mass In metric tons
Attach Rules Check the desired attachment types.

Note

Stack: allows the part to be stacked to another part

Srf Attach: allows the part to be attached to a surface

Allow Stack: allows another part to be stacked to this part

Allow Srf Attach: allows another part to be attached to the surface of this part

The other options do not seem to have any influence on the game.

Attach Nodes

If “Stack” was checked, you must add a top node and a bottom node. If “Srf Attach” was checked, you must add a srfAttach node.

Field name Value/comment
Node ID “top”, “bottom”, “srfAttach”, etc. (case sensitive!)
Node Type Select the appropriate value.
Attach Method Fixed_Joint for Stack. Hinge_Joint for Surface Attach.
Is Multi Joint Checked
Multi Joint Max Joint 3
Position Enter the node's coordinates. You can pick theme up in Blender. For easier set up, check “Gizmo” in Unity and display the meshes as wireframes.
Orientation Enter the coordinates of the vector in normalized base (length = 1).
Size 1
Visual Size 1
Is Resource Crossfeed True
Is Rigid True

Additional configuration

  1. Add Module Drag: click on “Add Component” > “Module_Drag”.
  2. Depending on what kind of part you are making, you may also want to check one or more of the following pages.
  3. Apply Options: select the root part and in the Inspector window near the top on the Prefab line, click the Overrides dropdown and choose “Apply All”. If this option is not available, then you’ve got nothing you need to do here. Move along, move along.
  4. Save JSON: at the bottom of the “Core Part Data” panel, click on “Save Part JSON”. Note
  5. Generate prefab: move the root object to the Asset folder in the project window. This generates a prefab.

Note: It is important to remember that whenever you make any changes to the prefab or its components, you will need to re-apply the overrides (step 3) and save the updated JSON file (step 4).