CFG File Format

From Kerbal Space Program Wiki
Revision as of 14:57, 14 March 2016 by Lexxy Fox (talk | contribs) (Created page with "KSP uses a custom file format for various purposes such as part definitions, save files, and config files. == Low-level Format == Config file nodes contain a list of key = v...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

KSP uses a custom file format for various purposes such as part definitions, save files, and config files.

Low-level Format

Config file nodes contain a list of key = value pairs, and other nested config nodes. Keys and values are both strings and nested config nodes also have a key. Duplicate keys are allowed. CFG Files also support comments.

  • Key-value pairs

Keys and values are separated by an equals sign ("="). Values are read until the end of the line, EOF, or the start of a comment.

  • Nodes

Config nodes start with their key name, followed by an opening curly brace ("{"), their contents, and end with a closing curly brace ("}").

  • Comments

Comments start with a double forward slash ("//") and continue until the end of the line or EOF.