Configuring core part data

Before configuring the module data for parts, it is recommended to know about [mesh modeling](Modeling the mesh in Blender.md).

General configuration

  1. Add Code Part Data: click on the root object myMod_myPart > Add Component > Core 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, reference the part modules sections for additional config options.

  3. Generate prefab: move the root object to the Asset folder in the project window. This generates a prefab.

  4. 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.

  5. Save JSON: at the bottom of the “Core Part Data” panel, click on “Save Part JSON”. Note

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 4) and save the updated JSON file (step 5).

Features

A part loads only in campaigns that have your mod on. A part can belong to one of the other features of your mod, for example an optional part set. Use the Features section of the Core Part Data panel:

  • To load the part only while a feature is on, list that feature under Features.

  • To remove the part while a feature is on, list that feature under Excluded Features.

  • For a part that is always in your mod, keep both lists empty.

The section writes Addressables labels on the part JSON. The game filters the part JSON, so the prefab and the icon do not need labels.

Part modules

Command modules

  1. Click on Add Component > Module_Command.

  2. Fill in the fields.

Field

Value/Comment

Module_Command


Minimum Crew

1for pods
0 for probes

Has Hibernation

Falsefor pods
True for probes

Requires Comm Net

Falsefor pods
True for probes

Alternate Control Orientations

Id: "Reversed"
Orientation: 0;0;180

Position: 0;0;0

Reaction wheels

  1. Click on Add Component > Module_ReactionWheel.

  2. Fill in the fields.

Field

Value/Comment

Module_ReactionWheel


Pitch Torque

Ex: 5

Yaw Torque

Ex: 5

Roll Torque

Ex: 5

Torque Response Speed

Ex: 30

RequiredResources

Rate: 0.025
ResourceName: "ElectricCharge"

AcceptanceThreshold: 0.01

Decouplers

  1. Click on Add Component > Module_Decouple.

  2. Fill in the fields.

Field

Value/Comment

Core Part Data


Stage Type

Decoupler Horizontal

Decoupler Vertical

Staging Icon Asset Address

“Staging-Icon-Inline.png”

Tags

Ex : “break decouple separat split stag”

Module_Decouple


Explosive Node ID

“top” or “bottom”

Explosive Dir

0;-1;0so that the decoupler goes downwards

0;1;0 so that the decoupler goes upwards

Docking ports

  1. Click on Add Component > Module_Docking Node.

  2. Fill in the fields.

Field

Value/Comment

Module_Docking Node


Docking Transform Name

The name of your game object that defines where the docking port should attach to other docking ports. Remember that foward in Unity is along the blue axis, so point the game object (usually a Empty object) along that direction

Control Transform Name

The direction to change to when clicking on Control from Here in the Parts action menu in game. Again, point the blue axis in the direction you want

Attachment Node id

The node to connect to when docking (I think)

Node Types

Any array of node sizes that determines which types of docking ports yours can dock to. For example, size0 is stock 0.625m diameter docking ports, size1 is 1.25m, and so on.

Since this is an array, you can list multiple different types that the port can dock to.

You can also use this to create custom docking port sizes, since it is an array of strings rather than enums.

Undock Ejection Force

How much force to use when undocking. The default 10 is probably too much for smaller ports. The stock 1.25m port uses a value of 0.4

Min Distance To Reengage

How far away the ship should get before the docking port will dock again

Acquire Range

How close the docking port needs to get to the other port before they will magnetically attract

Acquire Torque

How much torque the docking port can apply to align the connection in the non-roll axis?

Acquire TorqueRoll

How much torque the docking port can apply to align the connection in the roll axis?

Capture Range

How far away the two docking ports need to be before they will lock together

Capture Min Fwd

This value determines how much of a difference there can be in the dot product of the two docking transforms of both docking ports that are currently attempting to dock.

Capture Min Roll Dot

Not sure

Capture Max Rvel

Not sure

fx Dock Prefab Name

The effect to use when docking

fx Undock Prefab Name

The effect to use when undocking

Is Gendered

Se to true to make this docking port gendered, which means that you need a male and female port to dock. This could be useful for recreating soviet style drogue and probe docking ports, for example

Is Gender Female

If using gendered docking ports, marking this true creates a female docking port

Snap Rotation

Set to true if the docking port should snap to angles

Snap Offset

The angle to snap to when using Snap Rotation

Current State

The default state of the port. You probably want to leave this at Ready

Is Deployable Docking Port

Set to true if this is a deployable docking port, like the stock MK1/2 deployable docking ports

Generators

Electric charge

  1. Click on Add Component > Module_Generator.

  2. Fill in the fields.

Field

Value/Comment

Core Part Data


Rate

Ex: 5.5

Resource

"Electric Charge"

Acceptance Threshold

Ex: 5.5