Facility config files - KerbalColonies/KerbalColoniesCore GitHub Wiki
Facility config files
A facility config contains two parts, the root node and the level nodes.
All facilities have default parameters, some are required and some are optional. Facilities often contain additional parameters, please look at the wiki page of the respective facility.
Root node
A root node must be named "KCFacilityConfig" and may be placed anywhere in the gamedata folder.
REQUIRED parameters:
- name (string): the name of the facility refered to in the configs, it must be unique
- displayName (string): the name of the facility shown to the player ingame, while it's recommended to keep it unique it can be duplicated
- type (string): the name of the type
types:
the types are the name of the c# class, KC itself has the following types available:
- KC_CAB_Facility
- KCStorageFacility
- KCCommNetFacility
- KCHangarFacility
- KCLaunchpadFacility
- KCCrewQuarters
- KCMiningFacility
- KCProductionFacility
- KCResourceConverterFacility
- KCResearchFacility
level node:
A facility config must have an level node containing nodes with the level as name (referred to as subnodes), level 0 is required and used for creating the facility. Normally facilities can be upgraded when aditionall level nodes are available.
Parameters:
- basegroupName (string): the name of the KK base group that gets copied when creating it, any KK group might be used for this, even custom ones, the requirement is that the basegroup must be on kerbin
- upgradeType (string): how the facility gets upgraded, currently supported types:
- withoutGroupChange: (default if not defined) no change to the facility groups
- withGroupChange: replaces the last group
- withAdditionalGroup: adds an additional group to the facility
- resources: a node containing the required resources for this level, it has the resouce config name as name (string) and the amount as value (double), see the example below
- Funds (double): the required funds for this level (if funds are available), can be a decimal number
- upgradeTime (double): how long it'll take to build/upgrade this level
The level 0 node requires the basegroupName parameter. The resources, the funds and the upgradetime have 0 as default value.
Example:
KCFacilityConfig //the root node
{
name = CAB
displayName = Colony Assembly Building
type = KC_CAB_Facility
level
{
0
{
basegroupName = KC_Base_CAB_T1
resources
{
RocketParts = 5000 //5000 EL rocketparts are required to create a colony
}
}
}
defaultFacilities
{
KCBarracksFacility = 1
KCProductionFacility = 1
KCStorageFacility = 1
KCLandingZoneSmallFacility = 1
}
}