Configuring the core part data: Difference between revisions

From KSP 2 Modding Wiki
(Changed category)
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Configuring the mesh in Unity =
This process will have to be repeated for each part of your mod.
This part will have to be repeated for each mesh of your mod.<blockquote>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.</blockquote>


== General configuration ==
== General configuration ==
 
# Add Code Part Data: click on the root object <code>myMod_myPart</code> '''> Add Component > Core Part Data'''.
# Add Code Part Data: click on the root object <code>myMod_myPart</code> > “Add Component” > “Code Part Data”.
# If this option is not available, right-click on the KSP2 package '''>''' '''Reimport'''.
# If this option is not available, right-click on the KSP2 package > Reimport.
# Fill in the form.
# Fill in the form.


Line 122: Line 114:
#* RCS Port configuration (TODO)
#* RCS Port configuration (TODO)
#* Resource Holder configuration (TODO)
#* Resource Holder configuration (TODO)
#* Decoupler configuration (TODO)
#* [[Configuring a decoupler|Decoupler configuration]]
#* Electric Charge Generator configuration (TODO)
#* [[Configuring an Electric Charge Generator|Electric Charge Generator configuration]]
#* Crewed part configuration (TODO)
#* Crewed part configuration (TODO)
#* Command part configuration (TODO)
#* [[Configuring a command part|Command part configuration]]
#* Reaction Wheel part configuration (TODO)
#* [[Configuring a Reaction Wheel part|Reaction Wheel part configuration]]
#* Antenna part configuration (TODO)
#* Antenna part configuration (TODO)
#* Light caster part configuration (TODO)
#* Light caster part configuration (TODO)
#* Solar panel part configuration (TODO)
#* Solar panel part configuration (TODO)
#* Heatshield configuration (TODO)
#* Heatshield configuration (TODO)
#* [[Configuring a docking port|Docking Port configuration]]
# Generate prefab: move the root object to the Asset folder in the project window. This generates a prefab.
# 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.
'''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).'''
[[Category:Tutorials]]
[[Category:Parts and modules]]

Latest revision as of 11:46, 24 February 2024

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

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, you may also want to check one or more of the following pages.
  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).