Difference between revisions of "CFG File Documentation"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Parts: *light article was renamed;)
(Copy Edit)
Line 6: Line 6:
 
Currently there is a incomplete version in development at [[User:Greys]]. It isn't finished yet but most likely will replace the content here. So changes to the page here will be replaced most likely.}}
 
Currently there is a incomplete version in development at [[User:Greys]]. It isn't finished yet but most likely will replace the content here. So changes to the page here will be replaced most likely.}}
  
At first glance, the configuration file for an addon is a pretty confusing and infuriating thing. This tutorial will walk through the individual parts of the configuration file and hopefully give you an idea what everything does. As we go along, we'll build up a dummy part file that will behave exactly like a real one, only lacking models, sounds, and textures.
+
This tutorial will walk through the individual parts of the configuration file by building a dummy part file that will behave exactly like a real one, only lacking models, sounds, and textures.
  
 
== Basic Part Making Guidelines ==
 
== Basic Part Making Guidelines ==
  
Before you delve into the part file, it's important that you make sure you check through your model for anything that might break the game on loading, but isn't related due to a CFG error.
+
Ensure that the model itself will not break the game on loading:
Before you start editing the part, make sure that:
 
  
* The file is a .dae file. (For me, a .obj file simply doesn't work in game, and others have been saying the same thing. For convenience's sake, stick to .dae)
+
* The file must be a .dae file.
* That every single mesh has a material, even the collision mesh.
+
* Every--even the collision mesh--mesh must have a material.
* That you've named the parts correctly. The collision mesh should always be called "node_collider", etc.
+
* The parts must be correctly named; e.g., the collision mesh should always be called "node_collider"
  
 
== Part file creation ==
 
== Part file creation ==
  
Okay, now that's out the way we can start looking into Part files, and how they work. Although it looks pretty confusing at first glance, it's actually a pretty simple ordeal to create one. To start, we're going to actually need an empty file in the right location.
+
Save an empty notepad file, which will become the .cfg, in the directory of your addon--usually "../KerbalSpaceProgramDirectory/Parts/yourAddon".
  
*Fire up notepad
+
This empty file will become the .cfg
*Save it as "part.cfg" in the directory of your addon
 
** Usually "../KerbalSpaceProgramDirectory/Parts/yourAddon"
 
 
 
There, you now have an empty file waiting for juicy bits of configuration to be stuck into it. So let's keep going.
 
  
 
=== Config file order ===
 
=== Config file order ===
 
The part.cfg file has a pretty much specific order in which things are done. The order is:
 
  
 
<pre>
 
<pre>
Line 55: Line 48:
 
</pre>
 
</pre>
  
So you'll notice those slashes in front of each title - that means that those lines have been '''commented out''' and so will not be read by Kerbal Space Program when it's loading your addon. From the point of view of the program, those lines don't exist. As we go through the tutorial, we'll build up the CFG file from its bare bones to an actual working configuration file.
+
The slashes before each title indicate that the line thereof has been '''commented out'''; the program ignores such lines.
  
 
=== Give your part a title ===
 
=== Give your part a title ===
  
If you look at the very, very top of most part files you'll notice a couple of lines that look like this:  
+
Atop most part files are a couple of lines that resemble the ones below:  
  
 
<pre>
 
<pre>
Line 66: Line 59:
 
</pre>
 
</pre>
  
Those are quite simply, unimportant lines to KSP. The program doesn't read them, and doesn't give a crap about them either way. However, they are useful when other friendly people want to <s>steal your work</s> learn from your part file.
+
These lines are useful when others want to learn from your part file.
  
The first line simply states that this is a part file for KSP, and the second line is simply the name you give your part to other people to identify it.
+
The first line states that this file is a part file for KSP; the second states its name.
 
 
So let's start creating our dummy CFG file.  
 
  
 
<pre>
 
<pre>
Line 80: Line 71:
  
 
== General Parameters: ==
 
== General Parameters: ==
 
Now, let's look at the next section of the file - the general parameters.
 
  
 
<pre>// --- general parameters ---</pre>
 
<pre>// --- general parameters ---</pre>
  
This section comes straight under your title, and provides a few general things that apply to all parts. Here's a list of what goes under General Parameters:
+
This section follows the title and describes several properties of all parts. Below is a list of what goes under General Parameters:
  
 
<pre>
 
<pre>
Line 92: Line 81:
 
author = Il Carnefice
 
author = Il Carnefice
 
</pre>
 
</pre>
 
Pretty easy, huh? No? Still a bit muddled? Okay, explanation time.
 
  
 
;name
 
;name
:This is just that, a name. It can be anything, but notice that it's ''NOT'' commented out. This is what KSP will refer to the part as internally. It's good form to keep it all one word. Don't worry, you won't see it called this in game, so it can honestly be anything. Must be unique and cannot contain the underscore.
+
:It can be anything that is unique, one word, and without an underscore; it's not commented out because KSP will internally (the user will not see this name) thus refer to the part.
 
;module
 
;module
:Now this is slightly more difficult. Each part can be one of several different types of parts, defined by what comes after module. What type the part is defines how it works - for example, a solid rocket booster behaves differently from a liquid rocket motor. See [[#Parts|Valid Part Modules]] for values you can use here.
+
:What comes after module puts each part into a category: for example, a solid rocket booster differs from a liquid rocket motor. See [[#Parts|Valid Part Modules]] for values you can use here.
 
;author
 
;author
:Put your name here, you're the author!
+
:Author name
  
So let's get on with our dummy file.
+
Below is an example:
  
 
<pre>
 
<pre>
Line 113: Line 100:
 
author = YourName
 
author = YourName
 
</pre>
 
</pre>
 
There we go, a liquid engine type part, by proud author YourName.
 
  
 
==== Parts ====
 
==== Parts ====
 
So what part types can you have?
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 126: Line 109:
 
|-
 
|-
 
! [[Parts#Solid Fuel Boosters|SolidRocket]]
 
! [[Parts#Solid Fuel Boosters|SolidRocket]]
| Use this module if you want to make something akin to a solid rocket booster - a continually burning rocket that does not have any thrust controls and cannot be turned off once lit.
+
| Resembles a solid rocket booster - a continually burning rocket that lacks thrust control and cannot be deactivated once lit.
 
|-
 
|-
 
! [[Parts#Liquid Fuel Engines|LiquidEngine]]
 
! [[Parts#Liquid Fuel Engines|LiquidEngine]]
| Use this if you want to make something more like an orbital maneuvering system - a rocket engine which has controllable thrust.
+
| Resmebles an orbital maneuvering system - a rocket engine with controllable thrust.
 
|-
 
|-
 
! [[Parts#Liquid Fuel Tanks|FuelTank]]
 
! [[Parts#Liquid Fuel Tanks|FuelTank]]
| Simply put, use this if you want to make your part contain fuel to feed to other parts.
+
| Contains fuel.
 
|-
 
|-
 
! [[Parts#Pods|CommandPod]]
 
! [[Parts#Pods|CommandPod]]
| Feel like sticking three guys in your part and using it to control the rocket? Use this part.
+
| Contains crew and a control system.
 
|-
 
|-
 
! [[Parts#S.A.S.|SASModule]]
 
! [[Parts#S.A.S.|SASModule]]
| This type of part stops the rocket from rotating and flipping and dropping off course.
+
| Holds course.
 
|-
 
|-
 
! [[Parts#S.A.S.|SASModule2]]
 
! [[Parts#S.A.S.|SASModule2]]
Line 144: Line 127:
 
|-
 
|-
 
! [[Parts#Adapters, Couplers & Struts|Strut]]
 
! [[Parts#Adapters, Couplers & Struts|Strut]]
| A connective module, which allows you to connect different rocket parts together. Has no special abilities.
+
| Connects rocket parts. Has no special abilities.
 
|-
 
|-
 
! [[Parts#Decouplers and Seperators|Decoupler]]
 
! [[Parts#Decouplers and Seperators|Decoupler]]
| This connects rocket parts together but allows you to jettison itself and the parts it's connected to.
+
| Connects rocket parts and can jettison itself and the parts it's connected to.
 
|-
 
|-
 
! [[Parts#Decouplers and Seperators|RadialDecoupler]]
 
! [[Parts#Decouplers and Seperators|RadialDecoupler]]
| This connects parts together much like a Decoupler, but it behaves somewhat differently (as in ejection forces) since it assumes this part will connect laterally to the ship.
+
| Connects and can jettison parts much as does a Decoupler, but radially.
 
|-
 
|-
 
! [[Parts#Parachutes|Parachutes]]
 
! [[Parts#Parachutes|Parachutes]]
| This module can deploy a parachute to slow you down.
+
| Deploys a parachute.
 
|-
 
|-
 
! [[Parts#Controlled wings and surfaces|ControlSurface]]
 
! [[Parts#Controlled wings and surfaces|ControlSurface]]
Line 162: Line 145:
 
|-
 
|-
 
! [[Parts#Wings and Wing Parts|Winglet]]
 
! [[Parts#Wings and Wing Parts|Winglet]]
| A lift producing part. Not movable.
+
| A fixed, lifting part.
 
|-
 
|-
 
! [[Parts#Wings and Wing Parts|Stabilizer]]
 
! [[Parts#Wings and Wing Parts|Stabilizer]]
Line 177: Line 160:
 
|-
 
|-
 
! [[Parts#Jet Engines|AtmosphericEngine]]
 
! [[Parts#Jet Engines|AtmosphericEngine]]
| An engine for use in the atmosphere, with air flow parameters.
+
| Atmospheric engine with air flow parameters.
 
|-
 
|-
 
! [[Parts#S.A.S.|AdvSASModule]]
 
! [[Parts#S.A.S.|AdvSASModule]]
Line 183: Line 166:
 
|-
 
|-
 
! [[Parts#Decouplers and Seperators|DecouplerGUI]]
 
! [[Parts#Decouplers and Seperators|DecouplerGUI]]
| A normal decoupler that can be disconnected using the right-click GUI.
+
| A normal decoupler that can be disconnected via the right-click GUI.
 
|-
 
|-
 
! [[Parts#Docking|DockingPort]]
 
! [[Parts#Docking|DockingPort]]
Line 189: Line 172:
 
|-
 
|-
 
! [[FTX-2 External Fuel Duct|FuelLine]]
 
! [[FTX-2 External Fuel Duct|FuelLine]]
| Allows for transfer of fuel.
+
| Transfers fuel.
 
|-
 
|-
 
! [[Parts#Liquid Fuel Tanks|FuelTankGUI]]
 
! [[Parts#Liquid Fuel Tanks|FuelTankGUI]]
Line 254: Line 237:
 
== Asset Parameters ==
 
== Asset Parameters ==
  
This section defines the assets of our module - it provides us with links to our model and to our texture file, as well as giving us some extra settings to play around with.
+
This section defines the assets of a module - it links to the model and texture file and provides extra settings.
  
 
<pre>
 
<pre>
Line 266: Line 249:
 
//rescaleFactor = 1.25
 
//rescaleFactor = 1.25
 
</pre>
 
</pre>
 
Lets go through them.
 
  
 
;mesh
 
;mesh
:Easy, the name of the mesh you want to use for your model. Just write its name in there, but keep the mesh file in the same directory as the part file.
+
:The name of the mesh. Write its name therein and keep the mesh file in the same directory as the part file.
  
 
;scale
 
;scale
:The scale of your model, depending on how you used the units in your 3D modelling program. If you used one unit = one meter, use a scale of 1. If it's 1 unit = 0.1 meters, use a scale of 0.1, that simple. I tend to stick to using a 0.1 scale factor and then scale my model to fit with the rest of the parts, it's easier than fiddling around with scale factors. Note that this will only affect the units involved in node placement, and will not affect the actual size of the part.
+
:The scale of the model - depending on the units in your 3D modelling program. If you used one unit = one meter, then use a scale of 1. If it's 1 unit = 0.1 meters, then use a scale of 0.1. Using a 0.1 scale factor and then scaling to fit the other parts is easier than fiddling around with scale factors. This factor will only affect the units involved in node placement and will not affect the actual size of the part.
  
 
;texture
 
;texture
:The name of your texture file, which would be found inside the ''KSPDirectory/Parts/yourAddon/textures'' folder. Textures should be either 256x256, 512x512 or 1024x1024
+
:The texture file's name, which is in the ''KSPDirectory/Parts/yourAddon/textures'' folder. Textures should be either 256x256, 512x512 or 1024x1024
  
 
;specPower
 
;specPower
:The specular reflectivity of your part. It's best to leave it as it is.
+
:The specular reflectivity of your part. Leaving it untouched is best.
  
 
;rimFalloff
 
;rimFalloff
:This defines the strength of the highlight effect in game. Higher values lead to a more pronounced effect near the edges.
+
:Defines the strength of the highlight effect. Higher values increase the effect near the edges.
  
 
;alphaCutoff
 
;alphaCutoff
:This number defines the threshold for transparency on the part's texture. If your texture has an alpha channel (transparency), you can adjust this number to make sure your part is transparent or opaque where it should be. A value of 0 means nothing in the texture is considered to be transparent. A value of 1 means a completely transparent part.
+
:Defines the threshold for transparency on the part's texture. A value of 0 means nothing in the texture is considered to be transparent. A value of 1 means a completely transparent part. A texture with an alpha channel (transparency) can be transparent in some places and opaque in others.
  
 
;rescaleFactor
 
;rescaleFactor
:This optional parameter is not usually included in most parts, but the option is available for resizing a part for personal use. Note that in order to retain correct node placements, the scale parameter must also be proportionally changed to match the new rescaleFactor. The default value for rescaleFactor is 1.25, but can be changed to any value.
+
:An optional parameter that is not usually included in most parts, but the option is available for resizing a part for personal use. In order to retain correct node placements, the scale parameter must also be proportionally changed to match the new rescaleFactor. The default value for rescaleFactor is 1.25 but can be changed to any value.
  
There, that's everything under asset parameters covered. Let's continue building our dummy part file.
+
Below, the example:
  
 
<pre>
 
<pre>
Line 309: Line 290:
 
alphaCutoff = 0
 
alphaCutoff = 0
 
</pre>
 
</pre>
 
Onwards!
 
  
 
== Node Definitions ==
 
== Node Definitions ==
  
Another fairly easy section, this defines where we attach our part to other parts. You can have as many as you want, for example, tricouplers have four, three bottom and one top, while most parts simply have two, and a few parts have only one.
+
Defines where parts attach to other parts. Tricouplers have four: three bottom and one at the top, while most parts simply have two, and a few parts have only one.
  
 
<pre>
 
<pre>
Line 322: Line 301:
 
</pre>
 
</pre>
  
There's three example nodes. There are three different kinds, but only two are useful to us at the moment. We have node_stack and node_attach. Node stack is for defining where the part stacks vertically together with other parts, and node attach is used for defining where on the surface of your part other parts attach - so horizontal attachment.
+
Above are three example nodes. Two are useful in this tutorial: node_stack and node_attach. Node stack defines where the part vertically stacks with other parts, and node attach defines where on a part's surface other parts attach - in other words, horizontal attachment.
  
All node attachment values are given with respect to an object's origin, and their values correspond to a model's units and scaling factors. A node_stack_bottom with x, y, and z values of (2.5, 5.0, 3.0) will have an attachment node 2.5 units to the right, 5.0 units up, and 3.0 units forward. The next three values refer to the orientation that a particular node will accept other attachments, on a scale of -1.0 to 1.0. These represent the vector that a part will orient itself on when attaching to the node. For example, a fuel tank with a node_stack_bottom will have angx, angy, and angz values of (0.0, -1.0, 0.0). This represents a vector downward relative to the part model, in the negative y direction. A value of (0.0, -1.0, 1.0) would represent a diagonal vector downward and forward, while a value of (1.0, 1.0, 1.0) would represent a vector to the right, up, and forward.
+
All node attachment values relate to an object's origin, and their values correspond to a model's units and scaling factors. A node_stack_bottom with x, y, and z values of (2.5, 5.0, 3.0) will have an attachment node 2.5 units to the right, 5.0 units up, and 3.0 units forward. The next three values refer to the orientation that a particular node will accept other attachments, on a scale of -1.0 to 1.0. These represent the vector that a part will orient itself on when attaching to the node. For example, a fuel tank with a node_stack_bottom will have angx, angy, and angz values of (0.0, -1.0, 0.0). This represents a vector downward relative to the part model, in the negative y direction. A value of (0.0, -1.0, 1.0) would represent a diagonal vector downward and forward, while a value of (1.0, 1.0, 1.0) would represent a vector to the right, up, and forward.
  
 
Generally, most parts will have angx, angy, and angz values of either (0.0, -1.0, 0.0) for a node_stack_bottom and (0.0, 1.0, 0.0) for a node_stack_top.
 
Generally, most parts will have angx, angy, and angz values of either (0.0, -1.0, 0.0) for a node_stack_bottom and (0.0, 1.0, 0.0) for a node_stack_top.

Revision as of 19:15, 20 October 2013

Large portions of this page are originally incorrect or so outdated that they are no longer useable.


This tutorial will walk through the individual parts of the configuration file by building a dummy part file that will behave exactly like a real one, only lacking models, sounds, and textures.

Basic Part Making Guidelines

Ensure that the model itself will not break the game on loading:

  • The file must be a .dae file.
  • Every--even the collision mesh--mesh must have a material.
  • The parts must be correctly named; e.g., the collision mesh should always be called "node_collider"

Part file creation

Save an empty notepad file, which will become the .cfg, in the directory of your addon--usually "../KerbalSpaceProgramDirectory/Parts/yourAddon".

This empty file will become the .cfg

Config file order

// Title
// Name of your part
// 

// --- general parameters ---

// --- asset parameters ---

// --- node definitions ---

// --- FX definitions ---

// --- Sound FX definition ---

// --- editor parameters ---

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision

// --- standard part parameters ---

// --- specific part parameters ---

The slashes before each title indicate that the line thereof has been commented out; the program ignores such lines.

Give your part a title

Atop most part files are a couple of lines that resemble the ones below:

// Kerbal Space Program - Configuration file
// My super awesome engine that can go at a kajillion miles per hour, lol

These lines are useful when others want to learn from your part file.

The first line states that this file is a part file for KSP; the second states its name.

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine

Onwards!

General Parameters:

// --- general parameters ---

This section follows the title and describes several properties of all parts. Below is a list of what goes under General Parameters:

name = solidBooster
module = SolidRocket
author = Il Carnefice
name
It can be anything that is unique, one word, and without an underscore; it's not commented out because KSP will internally (the user will not see this name) thus refer to the part.
module
What comes after module puts each part into a category: for example, a solid rocket booster differs from a liquid rocket motor. See Valid Part Modules for values you can use here.
author
Author name

Below is an example:

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine

// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName

Parts

Part Name Description
SolidRocket Resembles a solid rocket booster - a continually burning rocket that lacks thrust control and cannot be deactivated once lit.
LiquidEngine Resmebles an orbital maneuvering system - a rocket engine with controllable thrust.
FuelTank Contains fuel.
CommandPod Contains crew and a control system.
SASModule Holds course.
SASModule2 ???
Strut Connects rocket parts. Has no special abilities.
Decoupler Connects rocket parts and can jettison itself and the parts it's connected to.
RadialDecoupler Connects and can jettison parts much as does a Decoupler, but radially.
Parachutes Deploys a parachute.
ControlSurface Movable wing-like surface. Can act as a rudder, aileron, elevator, canard or other aerodynamic control surface - function depends on placement on a ship.
WarpEngine A warp engine. Not functional as of 0.15.2.
Winglet A fixed, lifting part.
Stabilizer Similar to ControlSurface (recommend to not use)
StrutConnector ???
RCSFuelTank A RCS tank.
RCSModule A RCS thruster.
AtmosphericEngine Atmospheric engine with air flow parameters.
AdvSASModule An SAS-type module that alters user input allowing for control of RCS, pod torque, gimballing engines and control surfaces.
DecouplerGUI A normal decoupler that can be disconnected via the right-click GUI.
DockingPort An unfinished docking port?
FuelLine Transfers fuel.
FuelTankGUI A fuel tank with a right-click GUI to disable flow.
LandingLeg A moving landing leg, using .cfg parameters to move.
HLandingLeg A moving landing leg, using animations to move.
HParachutes An animated parachute module?
LandingGear Wheeled, animated landing gear for spaceplanes.
SatELight A flash-light module.
LiquidFuelEngine A liquid fuel engine that uses Thrust and Isp, rather than Thrust and fuel units.

Part Modules

Please read: "0.15 code update - PartModule, KSPField, KSPEvent, ConfigNode and PartResource"

Module Name Description
ModuleAerodynamicLift Lift producing module?
ModuleAnimateHeat ???
ModuleAnimatorLandingGear Animated landing gear module?
ModuleCommand Command module?
ModuleEngineRocketLiquid Liquid rocket engine module?
ModuleGenerator Used by RTG, input/output resources.
ModuleResource Generic resource module?
ModuleResourceIntake Generic resource "intake" module, to add to or take away from "ModuleResource"?
ModuleTest ???

Asset Parameters

This section defines the assets of a module - it links to the model and texture file and provides extra settings.

// --- asset parameters ---
mesh = modelfile.dae
scale = 0.1
texture = texturemap.png
specPower = 0.5
rimFalloff = 3
alphaCutoff = 0
//rescaleFactor = 1.25
mesh
The name of the mesh. Write its name therein and keep the mesh file in the same directory as the part file.
scale
The scale of the model - depending on the units in your 3D modelling program. If you used one unit = one meter, then use a scale of 1. If it's 1 unit = 0.1 meters, then use a scale of 0.1. Using a 0.1 scale factor and then scaling to fit the other parts is easier than fiddling around with scale factors. This factor will only affect the units involved in node placement and will not affect the actual size of the part.
texture
The texture file's name, which is in the KSPDirectory/Parts/yourAddon/textures folder. Textures should be either 256x256, 512x512 or 1024x1024
specPower
The specular reflectivity of your part. Leaving it untouched is best.
rimFalloff
Defines the strength of the highlight effect. Higher values increase the effect near the edges.
alphaCutoff
Defines the threshold for transparency on the part's texture. A value of 0 means nothing in the texture is considered to be transparent. A value of 1 means a completely transparent part. A texture with an alpha channel (transparency) can be transparent in some places and opaque in others.
rescaleFactor
An optional parameter that is not usually included in most parts, but the option is available for resizing a part for personal use. In order to retain correct node placements, the scale parameter must also be proportionally changed to match the new rescaleFactor. The default value for rescaleFactor is 1.25 but can be changed to any value.

Below, the example:

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine

// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName

// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1
texture = awesometexture.png
specPower = 0.5 
rimFalloff = 3 
alphaCutoff = 0

Node Definitions

Defines where parts attach to other parts. Tricouplers have four: three bottom and one at the top, while most parts simply have two, and a few parts have only one.

node_stack_bottom = x, y, z, angx, angy, angz, size
node_stack_top = x, y, z, angx, angy, angz, size
node_attach = x, y, z, angx, angy, angz, size

Above are three example nodes. Two are useful in this tutorial: node_stack and node_attach. Node stack defines where the part vertically stacks with other parts, and node attach defines where on a part's surface other parts attach - in other words, horizontal attachment.

All node attachment values relate to an object's origin, and their values correspond to a model's units and scaling factors. A node_stack_bottom with x, y, and z values of (2.5, 5.0, 3.0) will have an attachment node 2.5 units to the right, 5.0 units up, and 3.0 units forward. The next three values refer to the orientation that a particular node will accept other attachments, on a scale of -1.0 to 1.0. These represent the vector that a part will orient itself on when attaching to the node. For example, a fuel tank with a node_stack_bottom will have angx, angy, and angz values of (0.0, -1.0, 0.0). This represents a vector downward relative to the part model, in the negative y direction. A value of (0.0, -1.0, 1.0) would represent a diagonal vector downward and forward, while a value of (1.0, 1.0, 1.0) would represent a vector to the right, up, and forward.

Generally, most parts will have angx, angy, and angz values of either (0.0, -1.0, 0.0) for a node_stack_bottom and (0.0, 1.0, 0.0) for a node_stack_top.

The last value indication the visual size of an attachment node. Values may be either 0 (small half-meter node), 1 (normal), or 2 (large). This parameter is optional and will default to 1 if nothing is specified. Keep in mind, naming conventions (_stack_bottom, _stack_top) for nodes only apply to node_attach; they are only helpful in identifying a node's position.

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine

// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName

// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1 
texture = awesometexture.png
specPower = 0.5 
rimFalloff = 3 
alphaCutoff = 0 

// --- Node Definitions ---
node_stack_bottom = 0.0, -3.5, 0.0, 0.0, 1.0, 0.0, 1.0

FX definitions:

More definitions! But this time, you're positioning the flame coming out the back of the rocket.

fx_exhaustFlame_yellow = x, y, z, angx, angy, angz, active
fx_exhaustLight_yellow = x, y, z, angx, angy, angz, active
fx_smokeTrail_medium = x, y, z, angx, angy, angz, active

Okay, looks pretty similar to node_definitions, right?

You'll notice, just like node definitions, there are separate parts to each effect. You have fx_exhaustFlame, fx_exhaustLight, and fx_smokeTrail.

There are exactly what they sound like, the flame, the light, and the smoke trail.

There are variations on flame color, blue is also an option. To get a blue flame, you would use fx_exhaustFlame_blue. You would do the same for the exhaustLight.

The 'active' switch on the end is used to define when this effect will be visible. See the FX Groups listing to know which effect groups are available, and when they are used. It's also possible to assign an effect to more than just one FX Group. If for instance, you want a smoke effect to be visible both when the part activates and also when it deactivates itself, you can do this:

fx_gasBurst_white = x, y ,z, angx, angy, angz, activate, deactivate

This is particularly useful if you're defining a lot of effects, like the gas discharges on an RCS module.

Feel like you're getting the hang of this now? Let's keep building the dummy part file, and add in a blue flame and light, but leave out the smoke trail.

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine

// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName

// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1
texture = awesometexture.png
specPower = 0.5 
rimFalloff = 3 
alphaCutoff = 0

// --- Node Definitions ---
node_stack_bottom = 0.0, -3.5, 0.0, 0.0, 1.0, 0.0, 1.0

// --- FX Definitions ---
fx_exhaustFlame_blue = 0.0, -10.0, 0.0, 0.0, 1.0, 0.0, active
fx_exhaustLight_blue = 0.0, -10.0, 0.0, 0.0, 0.0, 1.0, active

Sound FX definition

This is pretty easy to use in a basic way, which will suit our needs just fine.

Under this section, comes:

sound_vent_medium = activate
sound_rocket_hard = active
sound_vent_soft = deactivate

Sounds are added to FX Groups, in much the same way smoke and flame effects are. Of course, sounds do not need to be positioned in space, nor do they have rotations, so all you need is to indicate in which FX Group the sound will be executed. As with effects, you can assign multiple groups to a sound.

There are 3 ways to add a sound to a part. KSP has an internal sound library, which contains a few sound effects. By defining a sound as in the example above, KSP will search for that sound in its internal library. KSP also has a Sounds folder on its main directory. This folder contains sounds that are available to every part in the Parts folder. To use a sound from the Sounds folder, you must include the file extension in the sound name (e.g., sound_vent_medium.wav = activate) The 3rd way is to include your own sound effects to your Part folder (e.g., KSPDirectory/Parts/MyPartFolder/Sounds), and define your sound effect in the same manner as above.

REMEMBER: If you add a custom sound, the file name must start with sound_ (e.g., sound_myNewSoundEffect.wav).

Sounds added to a Sounds folder inside the Part folder may not be accessed by other parts. Think of those as 'private' sounds.

Adding sound FX to our dummy part file:

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine

// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName

// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1 
texture = awesometexture.png
specPower = 0.5 
rimFalloff = 3 
alphaCutoff = 0 

// --- Node Definitions ---
node_stack_bottom = 0.0, -3.5, 0.0, 0.0, 1.0, 0.0, 1.0

*'''// --- FX Definitions ---
fx_exhaustFlame_blue = 0.0, -10.0, 0.0, 0.0, 1.0, 0.0, active
fx_exhaustLight_blue = 0.0, -10.0, 0.0, 0.0, 0.0, 1.0, active

// --- Sound FX definition ---
sound_vent_medium = activate
sound_rocket_hard = active
sound_vent_soft = deactivate

Editor Parameters:

Aha! We're back to parameters! These set of parameters let us decide how our part is displayed in the rocket editor. This section has the following:

// --- editor parameters ---
cost = 450
category = Propulsion
subcategory = 0
title = 
manufacturer =
description = 
cost
This hasn't really been implemented yet, but when it is it sets the cost for spaceship parts. You can set this to anything for now, it's entirely up to you.
category
There are seven categories:
Category Description
Pods Command pods and cockpits go here
Propulsion Engines, Fuel Tanks, RCS Tanks, etc.
Control SAS modules, RCS Thrusters, etc.
Structural Struts, decouplers, adapters, etc.
Aero Wings, Control Surfaces and nose cones.
Utility Parachutes, Escape towers, heat shields, lights, landing gear/legs, ladders, batteries, solar panels, generators, etc.
Science Sensors, Antennae, Satellite Dishes, etc.


subcategory
No use yet. Set it to 0
title
What do you want your part to be called in the rocket editor?
manufacturer
Who built your part?
description
Describe your part here. (Do not use linebreaks. KSP breaks lines automatically in the part's tooltip. A linebreak will cause your description to appear truncated)

And that's that. Updating the dummy cfg file now:

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine

// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName

// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1 
texture = awesometexture.png
specPower = 0.5 
rimFalloff = 3 
alphaCutoff = 0 

// --- Node Definitions ---
node_stack_bottom = 0.0, -3.5, 0.0, 0.0, 1.0, 0.0, 1.0

*'''// --- FX Definitions ---
fx_exhaustFlame_blue = 0.0, -10.0, 0.0, 0.0, 1.0, 0.0, active
fx_exhaustLight_blue = 0.0, -10.0, 0.0, 0.0, 0.0, 1.0, active

// --- Sound FX definition ---
sound_vent_medium = activate
sound_rocket_hard = active
sound_vent_soft = deactivate

// --- editor parameters ---
cost = 120
category = Propulsion
subcategory = 0
title = Mark V Rocket Engine
manufacturer = Awesomely Terrible Spaceship Engines Inc.
description = This part will now get you to space with 60% less limb loss than the mark IV engine.

Attachment rules:

This defines how your part attaches to other parts.

  • // attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
  • attachRules = 1,1,1,1,1

The rules correspond to the numbers below - 1 is allow, 0 is prevent. The tags are:

stack - Can your part be stacked on others?

SrfAttach - Can your part be placed onto a surface?

allowStack - Will you allow other parts to be stacked on your part?

allowSrfAttach Can other parts be placed on the surface of yours?

allowCollision - A special one: Can your part be placed if part of it is intersecting another part?


Note that you can also force parts attached to this part to attach in a specific symmetry.

  • // symmetry rules: 0=1x, 1=2x, 2=3x, 3=4x and so on...
  • stackSymmetry = 3


Easy enough, right? Adding to dummy file and continuing.

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine
// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName
// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1
texture = awesometexture.png
specPower = 0.5
rimFalloff = 3
alphaCutoff = 0
// --- Node Definitions ---
node_stack_bottom = 0.0, -3.5, 0.0, 0.0, 1.0, 0.0, 1.0
// --- FX Definitions ---
fx_exhaustFlame_blue = 0.0, -10.0, 0.0, 0.0, 1.0, 0.0, active
fx_exhaustLight_blue = 0.0, -10.0, 0.0, 0.0, 0.0, 1.0, active
// --- Sound FX definition ---
sound_vent_medium = activate
sound_rocket_hard = active
sound_vent_soft = deactivate
// --- editor parameters ---
cost = 120
category = Propulsion
subcategory = 0
title = Mark V Rocket Engine
manufacturer = Awesomely Terrible Spaceship Engines Inc.
description = This part will now get you to space with 60% less limb loss than the mark IV engine.
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,1,1,1,0

Standard Part Parameters:

This defines how your part performs in the air and its limits. Note that not all of these parameters need to be defined. If they're left out of the cfg file, KSP will use a default value for them.

  • mass =
  • dragModelType = default
  • maximum_drag =
  • minimum_drag =
  • angularDrag =
  • crashTolerance =
  • breakingForce =
  • breakingTorque =
  • maxTemp =
  • heatConductivity =
  • heatDissipation =
  • stageOffset =
  • childStageOffset =
  • fuelCrossFeed =
  • NoCrossFeedNodeKey =

mass - How much does your part weigh? (Or, for parts that also specify a dryMass parameter, how much does it weigh when full?)

dragModelType - Leave this as default.

maximum_drag - What's the maximum amount of drag on your part? (Usually under 1.) Generally drag when part's direction of travel is along its y-axis.

minimum_drag - The minimum amount of drag your part will encounter. (Usually under 1 and lower than maximum_drag) (this value is unused if dragModelType is set to default) Generally drag when the part's direction of travel is perpendicular to its y-axis.

angularDrag - how much angular drag is there/resistance to turning? (Also usually under 1.)

crashTolerance - How good is your part at surviving crashes? The higher the number the more durable. Numbers are approximately maximum impact speed in m/s.

breakingForce - How much will the attachment between this part and the part it's connected to resist to linear forces?

breakingTorque - How much will the attachment resist rotational forces?

maxTemp - The maximum temperature your part can experience before exploding.

heatConductivity - How good is your part at conducting heat? Defaults to 0.08, CFG values are used in 0.13.3, but not in 0.15.2.

heatDissipation - How good is your part at dissipating heat from the ship? Defaults to 0.08, CFG values are used in 0.13.3, but not in 0.15.2.

stageOffset and childStageOffset - Can be 0, 1, etc. defines whether this part will create a new stage before or after itself, or both (as do decouplers). This only applies for the automatically generated staging sequence. These replace stageBefore and stageAfter.

fuelCrossFeed - Will the part crossfeed fuel between parts attached to it?

NoCrossFeedNodeKey - if set to bottom will keep fuel from flowing FROM bottom nodes (avoiding some stack imbalances and partially mitigating the 0.15 bug of engines generating fuel). Used with parts with multiple bottom nodes, such as the TVR-1180C Mk1 Stack Tri-Coupler.

There you go, another section down.

Dummy CFG:

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine
// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName
// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1 
texture = awesometexture.png
specPower = 0.5 
rimFalloff = 3 
alphaCutoff = 0 
// --- Node Definitions ---
node_stack_bottom = 0.0, -3.5, 0.0, 0.0, 1.0, 0.0, 1.0
// --- FX Definitions ---
fx_exhaustFlame_blue = 0.0, -10.0, 0.0, 0.0, 1.0, 0.0, active
fx_exhaustLight_blue = 0.0, -10.0, 0.0, 0.0, 0.0, 1.0, active
// --- Sound FX definition ---
sound_vent_medium = activate
sound_rocket_hard = active
sound_vent_soft = deactivate
// ---Editor parameters ---
cost = 120
category = Propulsion
subcategory = 0
title = Mark V Rocket Engine
manufacturer = Awesomely Terrible Spaceship Engines Inc.
description = This part will now get you to space with 60% less limb loss than the mark IV engine.
// --- Standard part parameters ---
mass = 1.5
dragModelType = default
maximum_drag = 0.4
minimum_drag = 0.2
angularDrag = 0.2
crashTolerance = 5
maxTemp = 2500

Specific Part Parameters:

We're almost finished, a complete part is almost at our hands and you should know almost everything you need to create a part.cfg file. However, remember back when we were setting types? Well each type has an individual set of specific part parameters that change depending on what type of part it is.

You cannot mix and match parameters from different module types - it doesn't work.

These specific parameters are actually public variables defined in the Part classes themselves. The standard parameters are declared in the Part base class, and the specific ones in each Part extension (i.e., Modules)

For example, if your part type (module) was SolidRocket, your specific part parameters would be composed of:

  • thrust = 130
  • dryMass = 0.36
  • heatProduction = 550
  • fuelConsumption = 4
  • internalFuel = 100
  • fullExplosionPotential = 0.8
  • emptyExplosionPotential = 0.1
  • thrustCenter = 0, -0.5, 0
  • thrustVector = 0, 1, 0

Time to go through and see what special parameters each module can have.

Liquid Engine

A liquid engine has the following special parameters:

  • maxThrust =
  • minThrust =
  • heatProduction =
  • fuelConsumption =

Looks pretty easy, and everything is pretty much what you'd expect. By now, you should be able to work out what they all mean, but just in case:

maxThrust - The maximum thrust of the liquid engine.

minThrust - The minimum thrust. Usually 0, unless you want a rocket that can't fully be turned off.

heatProduction - How much heat your rocket puts out.

fuelConsumption - How much fuel your rocket uses.

Solid Rocket Booster

  • thrust =
  • dryMass =
  • heatProduction =
  • fuelConsumption =
  • internalFuel =
  • fullExplosionPotential =
  • emptyExplosionPotential =
  • thrustCenter = x, y, z
  • thrustVector = angx, angy, angz

A lot of those values look pretty similar to the liquid engine parameters, right?

thrust - The thrust of the solid rocket booster. Note how there is no minimum thrust because it can not be turned off once lit.

dryMass - How much the SRB weighs when empty.

heatProduction - Exactly the same as the liquid rocket, how much heat your rocket puts up.

fuelConsumption - How much fuel the rocket uses per second.

internalFuel - How much fuel does the SRB hold inside it?

fullExplosionPotential - The potential for explosion when the rocket is full of fuel

emptyExplosionPotential - And the potential when it's empty.

thrustCenter - Where the thrust comes from.

thrustVector - And which direction it goes.

Fuel Tank

Fuel tanks are a bit different, seeing as they have no thrust parameters.

  • fuel =
  • dryMass =
  • fullExplosionPotential =
  • emptyExplosionPotential =

If you've read above, you should know exactly what those parameters do, and so I won't explain them to you again.

SAS Module

  • maxTorque =

maxTorque - The maximum amount of torque the module can apply to halt the ship's rotation.

Ki, Kd and Kp - These parameters allow for tuning of the internal workings of the SAS module. If you're not experienced in working with PID controllers, just leave them as they are.

Winglets

  • dragCoeff =
  • deflectionLiftCoeff =

dragCoeff - The drag co-efficiency of the wings.

deflectionLiftCoeff - How much lift the wings generate.

Control Surfaces

  • dragCoeff =
  • deflectionLiftCoeff =
  • ctrlSurfaceRange =
  • ctrlSurfaceArea =

ctrlSurfaceRange - How far off centre the control surface (rudder / aileron etc) can move under control

ctrlSurfaceArea - The effective surface area of the control surface - the bigger the surface, the bigger the surface area must be set to

Decouplers

  • ejectionForce =

ejectionForce - How hard it separates on stage ejection.

Note, decouplers also add two lines to Standard Part Parameters, "stageAfter = True" and "stageBefore = True"

Parachutes

  • useAGL =
  • autoDeployDelay =
  • minAirPressureToOpen =
  • deployAltitude =
  • closedDrag =
  • semiDeployedDrag =
  • fullyDeployedDrag =

useAGL - Whether or not the parachute opens at the set altitude above ground level, instead of above sea level.

autoDeployDelay - Time before parachutes attached to jettisoned parts are activated.

minAirPressureToOpen - The minimum air pressure required before the chute will activate.

deployAltitude - At what altitude the parachute deploys fully once activated.

closedDrag - The drag when the parachute is closed.

semiDeployedDrag - The drag when it's semi-deployed

fullyDeployedDrag - And finally, the drag when it's entirely deployed.

Conclusion:

There you go then. By now, you should know the ins and outs of the part.cfg file, and how to create one, edit one, play around with one, etc. All sorts of cool stuff like that. The final dummy part.cfg file will be after this, with the special part parameters added in.

Anyway, that's that, now you know, now go make some cool addons like FTL drives and newton-defying inertial dampeners.

Dummy part.cfg file completed

// Kerbal Space Program - Part CFG file
// Mark V Rocket Engine
// --- General Parameters ---
name = LiquidThrusterV
module = LiquidEngine
author = YourName
// --- Asset Parameters ---
mesh = myMesh.dae
scale = 0.1 
texture = awesometexture.png
specPower = 0.5 
rimFalloff = 3
alphaCutoff = 0
// --- Node Definitions ---
node_stack_bottom = 0.0, -3.5, 0.0, 0.0, 1.0, 0.0, 1.0
// --- FX Definitions ---
fx_exhaustFlame_blue = 0.0, -10.0, 0.0, 0.0, 1.0, 0.0, active
fx_exhaustLight_blue = 0.0, -10.0, 0.0, 0.0, 0.0, 1.0, active
// --- Sound FX definition ---
sound_vent_medium = activate
sound_rocket_hard = active
sound_vent_soft = deactivate
// ---Editor parameters ---
cost = 120
category = Propulsion
subcategory = 0
title = Mark V Rocket Engine
manufacturer = Awesomely Terrible Spaceship Engines Inc.
description = This part will now get you to space with 60% less limb loss than the mark IV engine.
// --- Standard part parameters ---
mass = 1.5
dragModelType = default
maximum_drag = 0.4
minimum_drag = 0.2
angularDrag = 0.2
crashTolerance = 5
maxTemp = 2500
// --- Special Part Parameters ---
maxThrust = 150
minThrust = 0	
heatProduction = 360
fuelConsumption = 7

More Example?

// KSP - Parts
// Chemi Ion engine , using normal fueltank :D
// Mark I Ion engine
// 

// --- general parameters ---
name = ChemiIonEngine
module = LiquidEngine
author = Chemi | G-min
// --- asset parameters ---
mesh = CIonengMK1.dae

scale = 0.1
texture = hotsurf.png
specPower = 0.5
rimFalloff = 4
alphaCutoff = 0

// --- node definitions ---
node_stack_bottom = 0, 0, 0, 0, -1.0, 0, 1

node_stack_top = 0, 0.2, 0, 0, 1.0, 0, 1

// --- FX definitions ---
fx_exhaustFlame_yellow = 0, -0.05, 0, 0, 1.0, 0, active

fx_exhaustLight_yellow = 0, -0.05, 0, 0, 0, 0, active
fx_smokeTrail_medium = 0, 0, 0, 0, 1.0, 0, active
// --- Sound FX definition ---
sound_chemiionengine.wav = activate

sound_chemiionengine.wav = active
sound_vent_soft = deactivate

// --- editor parameters ---
cost = 1000

category = Propulsion
subcategory = 0
title = Chemi Ion engine MK1
manufacturer = Chemi Jet Propulson Laboratory / G-min Parts design
description = The great Ion engine :D with crash resiston G-JPG Around 999 m/s! (not mean inside ion engine will be resist 999 m/s crash!!! I warned you!) and with SPECIAL STRONGER! shock absorber!    now with viscosion coolant!(really absorbs and conduct :D) (it's GEL!) great for Interplanetary jornal.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,1,1,1,0
// --- standard part parameters ---
mass = 1.22

dragModelType = default 
maximum_drag = 0.399 
angularDrag = 0.4
crashTolerance = 29.16
breakingForce = 1024
breakingTorque = 567
maxTemp = 3100
heatConductivity = 3.6
heatDissipation = 0.014
// --- specific part parameters ---
maxThrust = 369

minThrust = 0
heatProduction = 58
fuelConsumption = 0.009
// end!